PointsClouds Generated by Reporjectimageto3D is So Bad

asked 2014-09-03 01:59:58 -0600

jestshen gravatar image

updated 2014-09-03 02:03:12 -0600

image description

Disparity image seems well but Points Clouds is too bad, anyone catch the problem? image description You can find that coordinate x,y are ok, while z is far from reality.

edit retag flag offensive close merge delete

Comments

1

In order to help you, you should provide parts of the relevant code. Debugging from just two images is hard :-)

PhilLab gravatar imagePhilLab ( 2014-09-03 02:50:42 -0600 )edit

This the code to getting points clouds- - if (disparity.empty()) { return 0; }

cv::reprojectImageTo3D(disparity, pointClouds, m_Calib_Mat_Q, true);
pointClouds *= 1.6;


for (int y = 0; y < pointClouds.rows; ++y)
{
    for (int x = 0; x < pointClouds.cols; ++x)
    {
        cv::Point3f point = pointClouds.at<cv::Point3f>(y,x);
        point.y = -point.y;
        pointClouds.at<cv::Point3f>(y,x) = point;
    }
}

Q is right, error rate is only 0.181

jestshen gravatar imagejestshen ( 2014-09-03 03:46:39 -0600 )edit

I recognize that you were using Yuhua Zou's program- I've tried his program and it worked perfectly (from getting good disparity map to getting good point cloud). So my suggestion is change BM/SGBM's parameters and play with them, the disparity map you got is really not good enough in order to get a good point cloud.

For me, I just use BM and results are pretty good. SGBM is too slow for me.

Hope it helps.

bennygato gravatar imagebennygato ( 2014-09-30 13:34:59 -0600 )edit