Stereo_match.cpp to generate point cloud data
I am using OpenCV 2.4.3 version. When I tried to use stereo_match.cpp to generate point cloud data from a pair of rectified stereo images, the function reprojectImageTo3D generated weird results. The point cloud data looks like a "cone" instead of the real shape of an object. Does anyone have the same experience? Are there other ways to generate 3D point cloud data from a pair of rectified stereo images in OpenCV?
Thank you,
yea, same here.. if you take a closer look, it's more a pyramid( think frustum ) than a cone.
using better cameras and trying harder with the calibration (and the rigging of the cameras !) helped in the end.
also, there's a lot of things, that can go wrong in the blockmatching step.
i know it's not what you want in the end, but if you build a pointcloud just from x,y,depth (skipping the reproject step), at least you can look at what came out of the bm. (like a cube)
good luck!
I can generated a nice disparity image with intrinsics and extrinsics matrices if skipping the reproject step. However, if I incluesd the reproject step, it does give me a pyramid. Does this mean that my calibration wasn't quite right?
yea, at least it does not feel like a total failure this way ;) and yes, it's most probably the calibration, that's responsible for the 'overshooting' of the reprojection (it's supposed to apply a bit of frustum pyramid, but if it's done right, you should never even see any of it).
Also, related to the calibration, make shure , your cams stay as 'rigid' as possible after that, if you ever change the focus, their distance/direction, or even if your neighbour sneezes, you'll have to do it all again!