I have a disparity map of an image .I need to convert it to a set of 3D points and normals.How can I do this and is there any such existing implementation which can do this
Have a look at this OpenCV function: http://docs.opencv.org/modules/calib3d/doc/camera_calibration_and_3d_reconstruction.html#reprojectimageto3d
The Gnu Triangulated Surface library?
When I've did this before I had a depth-map (or disparity map if you prefer) and - knowing the original camera calibration - was able to perform the re-projection back into R3 for the points.
Knowing the neighbourhood of each point (by their original neighbouring pixels) it's quite trivial to then create a basic triangulation to connect them up.
(If you didn't know this you would have to attempt some form of Delaunay triangulation or other more advanced algorithm...)
Make sure you get the vertex order correct for each triangle to ensure all the normals point the correct way/consistently.
Meshlab is quite handy for any additional post processing.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With