Skip to content

Conversation

servantftransperfect
Copy link
Contributor

@servantftransperfect servantftransperfect commented Sep 8, 2025

This pull request introduces FlatBuffers support for SfM data serialization and deserialization in AliceVision, enabling more efficient and structured storage and interchange of SfM data. The changes include adding FlatBuffers as a dependency, integrating schema compilation into the build system, implementing read/write logic for FlatBuffers files, and updating core data structures to support smart pointers for easier memory management.

FlatBuffers Integration

  • Added FlatBuffers as a dependency and integrated schema compilation into the build system (src/CMakeLists.txt, src/aliceVision/sfmDataIO/CMakeLists.txt). [1] [2] [3]

SfMData FlatBuffers IO Implementation

  • Implemented new FlatBuffers read/write logic for SfMData, including packing/unpacking of all relevant structures (src/aliceVision/sfmDataIO/FlatBuffersIO.cpp, src/aliceVision/sfmDataIO/FlatBuffersIO.hpp). [1] [2]
  • Added FlatBuffers serialization helpers for core types (e.g., CameraPose, Eigen vectors) in dedicated headers (src/aliceVision/sfmDataIO/FlatBuffersIO/CameraPose.hpp, src/aliceVision/sfmDataIO/FlatBuffersIO/Eigen.hpp). [1] [2]

Build System and Format Support

  • Registered new FlatBuffers file format ("fbd") as an option for SfM file output (meshroom/aliceVision/ConvertSfMFormat.py).
  • Included new FlatBuffers IO source and header files in the build (src/aliceVision/sfmDataIO/CMakeLists.txt). [1] [2]

Core Data Structure Improvements

  • Added sptr (shared pointer) typedefs to core classes for easier pointer management (Distortion, Undistortion, ImageInfo). [1] [2] [3]
  • Extended Undistortion with new overload for setSize to accept a vector argument (src/aliceVision/camera/Undistortion.hpp).
  • Enhanced View to support getting/setting image info via shared pointers (src/aliceVision/sfmData/View.hpp).

These changes collectively enable FlatBuffers-based serialization for SfM data, improve build integration, and enhance core data structures for future extensibility.

@servantftransperfect servantftransperfect force-pushed the dev/flatBuffers branch 2 times, most recently from 243646b to a69eabd Compare September 9, 2025 13:24
@servantftransperfect servantftransperfect changed the title Dev/flat buffers Adding flatbuffers as new I/O for sfmData Sep 10, 2025
@servantftransperfect servantftransperfect added this to the 3.4.0 milestone Sep 10, 2025
@servantftransperfect servantftransperfect marked this pull request as ready for review September 10, 2025 07:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant