Ask Your Question

How to rectify points, stereo camera calibration

asked 2016-06-12 06:55:39 -0600

minok gravatar image

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 this documentation. Not everything is clear there for me, but I can't see anything close to rectifypoints there.


edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2016-06-12 17:48:14 -0600

Tetragramm gravatar image

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.

edit flag offensive delete link more

Question Tools

1 follower


Asked: 2016-06-12 06:55:39 -0600

Seen: 10,557 times

Last updated: Jun 12 '16