+++ /dev/null
-<HTML>\r
- <HEAD>\r
- <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">\r
- <META NAME="GENERATOR" CONTENT="Microsoft FrontPage 4.0">\r
- <TITLE>Camera Calibration Tool</TITLE>\r
- <!-- Changed by: Jean-Yves Bouguet, 31-Dec-1999 -->\r
- </HEAD>\r
- <BODY TEXT="#000000" BGCOLOR="#FFFFFF" LINK="#0000CC" VLINK="#0000FF" ALINK="#FF0000">\r
- <A NAME="TOP">\r
- <!-- <CENTER>\r
-\r
- <BLOCKQUOTE>\r
-\r
- <table border = 3 WIDTH="70%" >\r
-\r
- <TR><TD>\r
-\r
- -->\r
- <CENTER><TABLE CELLSPACING=0 CELLPADDING=5 WIDTH="90%" BGCOLOR="#6A9BED" NOSAVE >\r
- <TR NOSAVE>\r
- <TD NOSAVE>\r
- <CENTER><I><FONT COLOR="#000000"><FONT SIZE=+4>Camera Calibration Tool</FONT></FONT></I></CENTER>\r
- </TD>\r
- </TR>\r
- </TABLE></CENTER>\r
- <!--\r
- \r
- </TD></TR>\r
- \r
- </table>\r
-\r
- </BLOCKQUOTE>\r
- \r
- </center>\r
-\r
- -->\r
-\r
- <br><br>\r
-\r
- <CENTER><IMG SRC="pict_calib.jpg" HEIGHT=600 WIDTH=990></CENTER>\r
-\r
- <H1>\r
- Description\r
- </H1>\r
- The camera calibration tool lets you calibrate any video camera very accurately\r
- and in few seconds.\r
- \r
- <br><br>\r
- The user presents a flat checkerboard pattern in front of the camera,\r
- and the program automatically acquires a number of images and uses them\r
- to compute the intrinsic camera parameters (focal length, principal point,\r
- distortion coefficients) as well as the extrinsic parameters (3D position\r
- of the pattern for each image).\r
- <br><br>\r
- Since the corners of the pattern are located automatically on each image,\r
- the entire procedure is fully automatic. Once calibration is done, the\r
- program lets you undistort the video images in real time (at frame rate).\r
- The lens distortion model consists of two terms: a radial distortion term\r
- (up to the fourth order) and a tangential distortion term (two scalars\r
- for encoding the angular orientation of the focal plane with respect to\r
- the sensor plane). Consequently, the lens distortion model is parameterized\r
- using four scalar coefficients.\r
-<br><Br>\r
- A complete tutorial of the algorithm with matlab code is provided, see\r
- <A HREF="#Tutorial">Tutorial Section below</A>.\r
- \r
- <H2>\r
- DirectShow Filter Application\r
- </H2>\r
- Note that this filter requires that you have DirectShow 6.0 or greater installed\r
- with <B>graphedt.exe </B>(DirectShow 6.0 for NT4.0, DirectShow 7.0 for\r
- Win 98 or Win2000) \r
- (<A HREF="http://www.microsoft.com/downloads/release.asp?ReleaseID=16927">http://www.microsoft.com/downloads/release.asp?ReleaseID=16927</A> ~128MB[!]). \r
- You will also need a video camera source filter which should\r
- be supplied by your USB camera vendor. <!-- except most don't support NT4.0. -->\r
-<!-- %%Some friendly advice from Uncle Gary?? -->\r
-<!-- Win2000 is your best bet for development, for just running the filter graph, Win98 will do.. An example filter graph is shown below (with the calibration filter processing a video source from a Matrox Meteor II card that we wrote ourselves) and then passing the output to a video renderer. -->\r
-\r
- Microsoft* Windows* 2000 may be the most suitable operating system\r
- for development since many vendors do not supply filters for\r
- Windows NT 4.0. However, Windows 98 will be adequate for just\r
- running the filter graph\r
- <br><br>\r
- An example filter graph is shown below. It is running our own\r
- calibration filter that processes a video source from a Matrox\r
- Meteor II card and then passes the output to a video renderer.\r
-\r
- <BR><br>\r
- <CENTER><IMG SRC="CalibFilterGraph.png" HEIGHT=210 WIDTH=601></CENTER>\r
-\r
- <a name="properties">\r
- <br>Right clicking on the CalibFilter brings up its property control page\r
- as follows:\r
-\r
-\r
- <br>\r
- <BR>\r
- <CENTER><IMG SRC="CalibFilterLabled.png" HEIGHT=284 WIDTH=384></CENTER>\r
- \r
- <H2>\r
- Controls\r
- </H2>\r
- <B><FONT SIZE=+2>[1]</FONT></B> Enter the\r
- number of columns (Squares per row)in your calibration checkerboard.\r
- Click "Apply" [12] to enter.<br>\r
- \r
- <B><FONT SIZE=+2>[2]</FONT></B> Enter the\r
- number of rows (Squares per column)in your calibration checkerboard.\r
- Click "Apply" [12] to enter.<br>\r
- \r
- <B><FONT SIZE=+2>[3]</FONT></B> Actual\r
- size of squares in your calibration checkerboard (in whatever units --\r
- say cm). Click "Apply" [12] to enter.<br>\r
- \r
- <B><FONT SIZE=+2>[4]</FONT></B> Start automatic\r
- collection of calibration frames.<br>\r
-\r
- <B><FONT SIZE=+2>[5]</FONT></B> Save current\r
- set of calibration parameters to disk.<br>\r
- \r
- <B><FONT SIZE=+2>[6]</FONT></B> Load previously\r
- saved calibration parameters.<br>\r
-\r
- <B><FONT SIZE=+2>[7]</FONT></B> If you've\r
- just calibrated the camera, or have loaded [6] previous calibration parameters,\r
- checking this box causes the computation of the undistorted image in real\r
- time. If this box is not checked, the raw video frames are displayed.\r
- You must click "Apply" [12] to register the check.<br>\r
-\r
- <B><FONT SIZE=+2>[8]</FONT></B> Checking\r
- this box causes an OpenGL display to show the tracking of the calibration\r
- checkerboard. You must click "Apply" [12] to register the check.<br>\r
-\r
- <B><FONT SIZE=+2>[9]</FONT></B> Set how\r
- many frames of the calibration checkerboard you want to collect before\r
- performing calibration (between 10 and 20 is usually enough, use more only\r
- if high accuracy is desired). Click "Apply" [12] to enter.<br>\r
-\r
- <B><FONT SIZE=+2>[10]</FONT></B> Set how\r
- number of miliseconds of delay between collecting frames of the calibration\r
- checkerboard when you start [4] calibration. This allows you as much\r
- time as desired to move the calibration checkerboard around the video scene\r
- before the next frame is taken during calibration. Click "Apply"\r
- [12] to enter.<br>\r
- \r
- <B><FONT SIZE=+2>[11]</FONT></B> The current\r
- calibration parameters are displayed in this box.<br>\r
- \r
- <B><FONT SIZE=+2>[12]</FONT></B> You must\r
- click "Apply" after setting any or all of [1], [2], [3], [9] and/or [10].\r
-\r
- <H2>\r
- How To...\r
- </H2>\r
- \r
- <h3>\r
- Calibrate a camera\r
- </h3>\r
-\r
- <B>(a)</B> Get or make a black and white checkerboard calibration object\r
- as shown in the images above or animated gif's below.\r
- <BR><B>(b)</B> Enter the number of columns ("squares per row") in [1] and\r
- number of rows (squares per column) in [2]; Enter the size of a square\r
- <!-- %%Whatever units? -->\r
- in whatever units in [3] (optional) ; Enter the number of frames that you\r
- want to collect in [9] (10-20 usually suffices); Enter the minimum time\r
- between capturing frames to allow you time to move the calibration object.\r
- <BR><B>(c)</B> Click "Apply" [12].\r
- <BR><B>(d)</B> Click "Start" [4].\r
- <BR><B>(e)</B> Move the checkerboard around. The number of frames\r
- collected will display in [11]. When all frames are collected it will solve\r
- for the calibration parameters and display them in [11].\r
- <BR><B>(f)</B> Checking [7] followed by clicking "Apply" [12] causes the\r
- rectified video image to be displayed as shown in the second example below.\r
- \r
- <br><br>Notes: When calibrating, the video image flashes when a frame is captured.\r
- It won't capture unless the colored lines are drawn on the checkerboard\r
- as shown in the examples below. You must move the calibration object\r
- around -- if your views are too much alike, you will get an ill-conditioned\r
- matrix with resultant divide by zero when the filter solves for the camera\r
- calibration parameters.\r
- \r
- <h3>\r
- Save calibration parameters to a file:\r
- </h3>\r
- <B>(a) </B>Click "Save" [5] and a dialog box will prompt you for\r
- saving the calibration parameters under a text file. Click this\r
- <a href="cam_model.htm">link</a> for information on the camera model, and the content of the text file.\r
- \r
- <h3>\r
- Load previously stored calibration parameters:\r
- </h3>\r
- <B>(a)</B> Click "Load" [6] and a dialog box will allow you to select\r
- a calibration parameter file.\r
- <BR><B>(b)</B> Calibration parameters will appear in [11].\r
- \r
- <h3>\r
- Turn image rectification on and off:\r
- </h3>\r
- <B>(a)</B> On: Check the "Undistortion" box [7]. Click "Apply" [12].\r
- <BR><B>(b)</B> Off: Un-check the "Undistortion" box [7]. Click "Apply"\r
- [12].\r
- \r
- <h3>\r
- Turn the 3D OpenGL window on and off:\r
- </h3>\r
- <B>(a)</B> On: Check the "Show 3D window" box [8]. Click "Apply" [12].\r
- <BR><B>(b)</B> Off: Un-check the "Show 3D window" box [8]. Click\r
- "Apply" [12].\r
-\r
- <H1>\r
- Examples\r
- </H1>\r
- The following movie shows the 3D pose of the calibration object being computed\r
- in real time after the camera has been calibrated.\r
- <br>\r
- <BR>\r
- <CENTER><IMG SRC="calibration_shot.png" HEIGHT=253 WIDTH=528></CENTER>\r
-\r
-\r
- <br>\r
- The next picture shows image undistortion performed by the filter.\r
-\r
- <br><BR>\r
- <CENTER><IMG SRC="undistortion_shot.png" HEIGHT=226 WIDTH=721></CENTER>\r
-\r
- <H1>\r
- <A NAME="Tutorial"></A>Tutorial and calibration toolbox</H1>\r
- In addition to the <A HREF="../../ref/OpenCVRef_3dReconstruction.htm#ch6_calibration">\r
- OpenCV implementation</A> of the calibration functions and tool, we provide a complete\r
- tutorial and calibration toolbox for MATLAB. It can be downloaded from\r
- <a href="http://www.sourceforge.net/projects/opencvlibrary">OpenCV page at Source Forge</a>\r
- <br><br>\r
- <hr noshade size=2 width=100%>\r
-\r
- </BODY>\r
-</HTML>\r
-\r
-\r
-\r