cdcseacave / openMVS

open Multi-View Stereo reconstruction library
http://cdcseacave.github.io
GNU Affero General Public License v3.0
3.17k stars 891 forks source link

Question about point cloud color estimation #765

Closed tsrobcvai closed 2 years ago

tsrobcvai commented 2 years ago

I'm new to openMVS, here's a question that puzzles me: How does it estimate the color of the point cloud during dense point cloud reconstruction? Is there a relevant paper or literature to use as a source of information? Every response is beneficial to me; thank you!

pierotofy commented 2 years ago

https://github.com/cdcseacave/openMVS/blob/master/libs/MVS/DepthMap.cpp#L1314

So the color comes from the closest image where a point has been seen.

tsrobcvai commented 2 years ago

https://github.com/cdcseacave/openMVS/blob/master/libs/MVS/DepthMap.cpp#L1314

So the color comes from the closest image where a point has been seen.

I'm very glad you responded, I tried hard to understand the code. But embarrassingly I am not good at C++, and my possibly wrong assumption is this: for each point in a dense point cloud, first find the image closest to this point, and then get the position in the nearest image corresponding to this point in the 2D pixel coordinate system based on the inverse projection of the camera pose. Due to the errors that exist, this position usually does not correspond to exactly one pixel point. Therefore, the pixel points in the region near this position are selected, and then sampled from all the pixel points in the nearby region by bilinear interpolation, and finally, the interpolated RGB values are assigned to this point. By performing this operation for each point, the color estimation of the whole dense point cloud is completed. Is this correct? Thank you for your time and consideration, I hope to hear from you again.