AIBluefisher / DAGSfM

Distributed and Graph-based Structure from Motion. This project includes the official implementation of our Pattern Recognition 2020 paper: Graph-Based Parallel Large Scale Structure from Motion.
https://aibluefisher.github.io/GraphSfM/
BSD 3-Clause "New" or "Revised" License
406 stars 86 forks source link

About depth range and depth interval of sparse point cloud #7

Closed yao520131415926 closed 5 years ago

yao520131415926 commented 5 years ago

Thank you for your open source! I am trying to compute depth ranges and depth interval of the sparse point cloud. Could you please give me some idea on how to get these information?

AIBluefisher commented 5 years ago

As the sparse point clouds locate in 3D space, the z-coordinate is the depth value. Thus, you can just traverse all the 3D points to extract their depth value. The code may seem like below:

for (auto it = sfm_data.structures.begin(); it != sfm_data.structures.end(); ++it) {
    Landmark landmark = it->second;
    Eigen::Vector3d X = landmark.X;
    // Your code here to do what you want with X[2]
}
yao520131415926 commented 5 years ago

Thank you so much for your help!