How to rectify points, stereo camera calibration

Hi guys,

I'm looking for the proper function that I can use to rectify my points, and either I cannot understand the documentation or perhaps there is no such function that I'm looking for. I will try to shortly describe you my program. The goal is to find X, Y and Z coordinates of little green balls that I'm taking the photos of. In order to do so, I use two cameras. First I made 15 chessboard photos to perform camera calibration. I do it for each camera using calibrateCamera() function. Then I undistort images with green balls using undistort(). Once that is done, I find the x and y coordinates of the green balls position on the image (coordinates in pixels). What I want to do next is to rectify those points to get canonical geometry. I'd like to rectify just points, not the whole images. As far as I know, what I need is essential and fundamental matrix. I get them by using the stereoCalibrate() function, where I pass my chessboard corners that I've already found before. So here I'm at the point that I have my 2d coordinates from both camera images, and I also have essential and fundamental matrix. And absolutely no idea what to do next to rectify those points. I use http://docs.opencv.org/2.4/modules/ca... this documentation. Not everything is clear there for me, but I can't see anything close to rectifypoints there.

Thanks!

edit retag close merge delete

Sort by ยป oldest newest most voted

Use the Stereo Rectify function to calculate the R1, R2, P1, P2 matrices of the stereo system. Along with all the other outputs of Stereo Calibrate.

Then, use the function undistortPoints in imgProc that takes the camera matrix, distortion matrix, R and P for that camera and properly undistorts them. I don't know why there's not at least a reference in the camera calibration module.

more