Matlab Calibration of Binocular Camera (Stereo_gui)

Source: Internet
Author: User

This period of time in the calibration of binocular camera, from the MATLAB help document found about binocular camera calibration method, took a little time to translate a bit, hope that people can learn from it!

Like many blog posts, the first thing to do is to list the original:

Http://www.vision.caltech.edu/bouguetj/calib_doc/index.html#examples

Document cited a few examples, about double purpose is the 5th one, look carefully oh!

This is the text!

This example shows how to use the Toolbox to calibrate a stereoscopic system (internal and external) and use stereo calibration results for stereo image correction and 3 D triangulation measurements.

Download the Stereo_example.zip stereo DataSet, which contains 14 pairs of left and right images. The pictures are named Left01.jpg,..., left14.jpg and right01.jpg...,right14.jpg. This package contains the respective two calibration result files Calib_results_left and calib_results_right (the calibration results of two cameras are generated using the standard program described in the first example)

In the Command Line window, enter Stereo_gui to run the Stereoscopic calibration toolbox. Such as:

(Put Calib_results_left.mat and calib_results_right.mat two files in the folder you are running now)

Click the first button

The command-line window prompts the following:

Enter the first name of your two correction results.

(It is best to first change your two files to this default name, so you can press ENTER here, two files are loaded, will show two file parameters, such as)

The values of the initial internal parameters, in addition to the estimated OM and T of the external parameters, also describe the relative positions of the left and right cameras. Internal parameters Fc_left, cc_left, alpha_c_left, kc_left, fc_right, cc_right , alpha_c_right and kc_right and the traditional FC, CC, Alpha_c and KC are equivalent. In three-dimensional space a point P of two attitude parameters om and T definition: its two in the left and right reference coordinate system coordinate vector XL and XR respectively and each other, although strict motion conversion: XR = R * XL + T r is 3 x3 corresponding rotation vector om rotation matrix.

Click the button run stereo calibration running global stereo optimizer

Here if the warning message "Disabling view kk-reason:the left and right images was found inconsistent" is encountered, this may mean that the first KK pair of images, Is captured in a different position in space. This means that the two views are inconsistent and therefore cannot be used for stereo calibration.

When capturing your image, make sure that you are not moving the correction mode while capturing the left and right images. Patterns in space can (and should) only be moved between two groups (left and right) images.

Another reason for inconsistency is that you choose a set of different points in the pattern to run independent calibrations (resulting in two files Calib_results_lef). Ensure that the same points are selected in two separate calibrations. In other words, points need to be consistent.

Click on save Stereo calib results to Save the stereo calibration results as follows:
<align= "Left" > click on Show Extrinsics of the stereo rig to display the spatial configuration and calibration plane of two cameras in a 3D figure

Finally, click rectify the calibration images to calibrate the stereoscopic image by correcting it. All images are left_rectified01.bmp, right_rectified01.bmp,..., left_rectified14.bmp,right_rectified14.bmp are calibrated (the outer polar line matches the horizontal scan line). In addition to generating these correction pictures, the script also saves the newly set calibration parameters to Calib_results_stereo_rectified.mat.

Since the original image is provided, the two initial independent calibrations can be obtained Calib_results_left.mat and Calib_results_right.mat. Through the corner extraction process, it is important to keep in mind that for each pair of images, you must select the same set of points for the left and right images, that is, the same grid point and the same origin (in order to ensure the same pattern reference system). Therefore, it is important to ensure that the same origin point (first click) has been selected. An easy way is to always select the upper left corner of the grid as the origin (this is done to generate two supplied calibration files). In your own stereoscopic calibration, you can use different strategies, such as the origin point of the flag in the grid mode itself.

A bit of a hasty end, there is no time and mood, please handle it yourself! Good bye!

Matlab Calibration of Binocular Camera (Stereo_gui)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.