MATLAB: I want to construct an intrinsic matrix corresponding to the camera views rectified by Matlab, what should I use for focal length and principal point

Computer Vision Toolbox

I was trying to find information on the effect of rectification (rectifyStereoImages function in Computer Vision System Toolbox) on the camera parameters, and couldn’t find it in the documentation (or the source, since the actual rectification apparently happens in native code).
I am quite familiar with the overall process, but since there are certain design choices that can be done, I’d like to make sure what those are in the Matlab implementation.
In order to be considered rectified, the rotation and translation of the rectified views have to be respectively eye(3) and [0 norm(old_baseline) 0].
However, there are several valid options for the intrinsic parameters. I.e. if I wanted to construct an intrinsic matrix corresponding to the camera views rectified by Matlab, what should I use for focal length and principal point?

Best Answer

The intrinsic matix is constructed in the following file:
>> edit vision.vision.internal.calibration.StereoParametersImpl
Please have a look at the following methods in the above file:
rectifyStereoImagesImpl
computerRectificationParameters
computeNewIntrinsics (This function would calculate and set the new focal lengths and principal point.)
For a reference you can refer to "Learning OpenCV" by Gary Bradski and Adrian Kaehler. The section titled "Calibrated stereo rectification: Bougeuet's algorithm" (page 433 in first edition) will give more details about the algorithm.
You can have a look at the following documentation for more information about the "rectifyStereoImages" function: