Skip to content

Dynamic chunks for lidar meshing#2140

Open
servantftransperfect wants to merge 3 commits into
developfrom
dev/e57meshroom
Open

Dynamic chunks for lidar meshing#2140
servantftransperfect wants to merge 3 commits into
developfrom
dev/e57meshroom

Conversation

@servantftransperfect

@servantftransperfect servantftransperfect commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

E57 multi-file fix and dynamic LiDAR meshing chunks

Summary

This PR fixes several bugs in E57 point cloud reading when handling files containing multiple scans, adds debug instrumentation for E57 data pointers, and introduces dynamic parallelization chunk sizing for LiDAR meshing nodes.


Changes

Fix E57 multi-scan file reading (E57Reader.hpp, main_importE57.cpp)

The core bug: _idMesh was used both as a per-file scan index (passed to libE57's ReadData3D, GetData3DSizes, SetUpData3DPointsData) and as a global unique mesh counter (used as the map key in the SfM cameras map). When iterating over multiple files, _idMesh was reset to 0 on each new file, causing all reads after the first file to always read scan #0.

  • Introduced a dedicated _idMeshInFile counter for addressing scans within the current file.
  • _idMesh now acts as a strictly increasing global counter across all files.
  • Fixed GetData3DSizes which was always passing hardcoded 0 instead of _idMeshInFile.
  • Added datareader.close() after reading each scan's point data.
  • Fixed Octree::regroup(): child nodes are now recursively regrouped before the leaf compaction check, ensuring bottom-up tree consolidation.
  • Fixed a missing space in a log message ("Generating Nsub regions""Generating N sub regions").

E57 debug logging (E57Reader.hpp)

  • Added ALICEVISION_LOG_DEBUG statements logging all Data3DPointsFloat field pointers (cartesian, color, intensity, spherical, row/column indices, timestamps) on each read batch to help diagnose E57 file compatibility issues.
  • Added a null-pointer guard before accessing cartesianInvalidState[pos], fixing a potential crash on E57 files that do not provide that field.

Dynamic parallelization for LiDAR meshing (LidarMeshing.py, LidarDecimating.py, parallelization.py)

Replaced the hardcoded StaticNodeSize(10) in LidarMeshing and LidarDecimating with a new DynamicLidarMeshingSize callable. This class reads the JSON file referenced by the node's input attribute at graph evaluation time and returns the number of elements in the root array, so the number of parallel chunks matches the actual number of input regions rather than a fixed constant.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces dynamic parallelization sizing for Lidar Decimating and Lidar Meshing nodes by replacing static sizes with a new DynamicLidarMeshingSize class. This class determines the parallelization size based on the number of elements in a JSON array. The feedback suggests ensuring a minimum size of 1 when returning the length of the JSON array to prevent potential pipeline execution errors if the array is empty.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread src/aliceVision/python/parallelization.py Outdated
@sonarqubecloud

Copy link
Copy Markdown

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