Quantcast
Channel: OpenCV Q&A Forum - RSS feed
Viewing all articles
Browse latest Browse all 41027

Problems with rectified pictures for stereo vision

$
0
0
I m trying to do stereo matching but it doesnt work well until now. I determined the "tvecs" and "rvecs" for each camera. So i can use these relationships to get the translation vector and rotation matrix : R = Rright.Rleft.T and T = Tright - R.Tleft with the meaned values of Tleft , Tright, Rright and Rleft But i have a problem during the rectification step... The scale of rectified pictures have changed...and i dont know how to fix it... A piece of my code for the left picture : #i obtained the new camera matrix for the rectification C1new = cv2.getOptimalNewCameraMatrix(C1,dist1,(2048,2048),alpha=1)[0] #with C1 and dist1 respectively the #camera matrix and the distorsion values #and i obtained the map and i remap... left_maps = cv2.initUndistortRectifyMap(C1, dist1, R1, C1new, (2048, 2048), cv2.CV_32FC2) a = left_maps[0] left_img_remap = cv2.remap(left_stereo_image2, a[:,:,0], a[:,:,1], cv2.INTER_CUBIC) And i got that... : ![image description](/upfiles/1457374121672352.png) To improve my results i tried to concatenate empty arrays to plot all the picture but when i do that and modify the size in "getOptimalNewCameraMatrix" and "initUndistortRectifyMap", i got : ![image description](/upfiles/14573742442814559.png) This time i got all the pictures but the scale between them is not good...so i cant determine disparity... Thanks for your help ;)

Viewing all articles
Browse latest Browse all 41027

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>