Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.4k views
in Technique[技术] by (71.8m points)

opencv - Disparity map and finding distance point Z wrong

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:

  1. single calibrate for both camera
  2. Stereo calibrate both found image points with object points(with sqaure size in mm) and get 0.2+ rms
  3. Bring the output from 2 to StereoRectify function with flag= default (stereo camera abit converge to each other)
  4. Call InitUndistortRectifyMap for both cameramatrix, distortion,R,P
  5. 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: https://pasteboard.co/JLmkoMp.png

Here the link to see my rectified map: https://pasteboard.co/JLmkIri.png

**its a mouse and pendrive

However, the top of the mouse does not show the brightest instead its end of edge show more bright

question from:https://stackoverflow.com/questions/65895053/disparity-map-and-finding-distance-point-z-wrong

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...