i would need some help for getting correct distance from disparity map ( had read through the opencv Book and checked forums but not sure where i got wrong)
i have done these steps:
- single calibrate for both camera
- Stereo calibrate both found image points with object points(with sqaure size in mm) and get 0.2+ rms
- Bring the output from 2 to StereoRectify function with flag= default (stereo camera abit converge to each other)
- Call InitUndistortRectifyMap for both cameramatrix, distortion,R,P
- Call remap for the stereo images that i wan to compute for.
6.using (StereoSGBM stereoSolver = new StereoSGBM(0, 144, 5,p1,p2))
stereoSolver.Compute( left_rectified, right_rectified, outputDispartyMap);
7.outputDispartyMap.ConvertTo(show1, DepthType.Cv32F, 1.0F / 16.0F, 0);
8.CvInvoke.ReprojectImageTo3D(show1 , points, Q, true, DepthType.Cv32F);
Q matrix
[0,0]=1
[0,3]=-1415.0339965820313
[1,1]=1
[1,3]=-1028.3931045532227
[2,3]=2813.3757918960027
[enter image description here][1] [3,2]=-0.021503753085993917
[3,3]=11.559548597134219
Here the link to see my disparity map: Pasteboard - Uploaded Image
Here the link to see my rectified map: Pasteboard - Uploaded Image
**its a mouse and pendrive
However, the top of the mouse does not show the brightest instead its end of edge show more bright