Commit df491588 authored by Bernat Gabor's avatar Bernat Gabor

Added the "Camera calibration With OpenCV" tutorial. Extended with a few global…

Added the "Camera calibration With OpenCV" tutorial. Extended with a few global links the conf.py file. Corrected an error in the linux_install.rst and one in the cascade_classifier.rst file. 
parent 0ed6d86a
This diff is collapsed.
...@@ -26,6 +26,25 @@ Although we got most of our images in a 2D format they do come from a 3D world. ...@@ -26,6 +26,25 @@ Although we got most of our images in a 2D format they do come from a 3D world.
:height: 90pt :height: 90pt
:width: 90pt :width: 90pt
+
.. tabularcolumns:: m{100pt} m{300pt}
.. cssclass:: toctableopencv
===================== ==============================================
|CameraCalibration| **Title:** :ref:`cameraCalibrationOpenCV`
*Compatibility:* > OpenCV 2.0
*Author:* |Author_BernatG|
Camera calibration by using either the chessboard, circle or the asymmetrical circle pattern. Get the images either from a camera attached, a video file or from an image collection.
===================== ==============================================
.. |CameraCalibration| image:: images/camera_calibration.png
:height: 90pt
:width: 90pt
.. raw:: latex .. raw:: latex
\pagebreak \pagebreak
...@@ -34,3 +53,4 @@ Although we got most of our images in a 2D format they do come from a 3D world. ...@@ -34,3 +53,4 @@ Although we got most of our images in a 2D format they do come from a 3D world.
:hidden: :hidden:
../camera_calibration_square_chess/camera_calibration_square_chess ../camera_calibration_square_chess/camera_calibration_square_chess
../camera_calibration/camera_calibration
...@@ -28,7 +28,7 @@ All the libraries above can be installed via Terminal or by using Synaptic Manag ...@@ -28,7 +28,7 @@ All the libraries above can be installed via Terminal or by using Synaptic Manag
Getting OpenCV source code Getting OpenCV source code
============================ ============================
You can use the latest stable OpenCV version available in *sourceforge* or you can grab the latest snapshot from the `SVN repository < http://code.ros.org/svn/opencv/>`_. You can use the latest stable OpenCV version available in *sourceforge* or you can grab the latest snapshot from the `SVN repository <http://code.ros.org/svn/opencv/>`_.
Getting the latest stable OpenCV version Getting the latest stable OpenCV version
------------------------------------------ ------------------------------------------
......
...@@ -22,7 +22,7 @@ Theory ...@@ -22,7 +22,7 @@ Theory
Code Code
==== ====
This tutorial code's is shown lines below. You can also download it from `here <https://code.ros.org/svn/opencv/trunk/opencv/samples/cpp/tutorial_code/objectDetection/objectDetection.cpp>`_ . The second version (using LBP for face detection) can be found `here <https://code.ros.org/svn/opencv/trunk/opencv/samples/cpp/tutorial_code/objectDetection/objectDetection2.cpp>`_ This tutorial code's is shown lines below. You can also download it from `here <https://code.ros.org/svn/opencv/trunk/opencv/samples/cpp/tutorial_code/objectDetection/objectDetection.cpp>`_ . The second version (using LBP for face detection) can be `found here <https://code.ros.org/svn/opencv/trunk/opencv/samples/cpp/tutorial_code/objectDetection/objectDetection2.cpp>`_
.. code-block:: cpp .. code-block:: cpp
...@@ -63,13 +63,13 @@ This tutorial code's is shown lines below. You can also download it from `here < ...@@ -63,13 +63,13 @@ This tutorial code's is shown lines below. You can also download it from `here <
{ {
while( true ) while( true )
{ {
frame = cvQueryFrame( capture ); frame = cvQueryFrame( capture );
//-- 3. Apply the classifier to the frame //-- 3. Apply the classifier to the frame
if( !frame.empty() ) if( !frame.empty() )
{ detectAndDisplay( frame ); } { detectAndDisplay( frame ); }
else else
{ printf(" --(!) No captured frame -- Break!"); break; } { printf(" --(!) No captured frame -- Break!"); break; }
int c = waitKey(10); int c = waitKey(10);
if( (char)c == 'c' ) { break; } if( (char)c == 'c' ) { break; }
......
<?xml version="1.0"?>
<opencv_storage>
<images>
images/CameraCalibraation/VID5/xx1.jpg
images/CameraCalibraation/VID5/xx2.jpg
images/CameraCalibraation/VID5/xx3.jpg
images/CameraCalibraation/VID5/xx4.jpg
images/CameraCalibraation/VID5/xx5.jpg
images/CameraCalibraation/VID5/xx6.jpg
images/CameraCalibraation/VID5/xx7.jpg
images/CameraCalibraation/VID5/xx8.jpg
</images>
</opencv_storage>
\ No newline at end of file
<?xml version="1.0"?>
<opencv_storage>
<Settings>
<!-- Number of inner corners per a item row and column. (square, circle) -->
<BoardSize_Width> 9</BoardSize_Width>
<BoardSize_Height>6</BoardSize_Height>
<!-- The size of a square in some user defined metric system (pixel, millimeter)-->
<Square_Size>50</Square_Size>
<!-- The type of input used for camera calibration. One of: CHESSBOARD CIRCLES_GRID ASYMMETRIC_CIRCLES_GRID -->
<Calibrate_Pattern>"CHESSBOARD"</Calibrate_Pattern>
<!-- The input to use for calibration.
To use an input camera -> give the ID of the camera, like "1"
To use an input video -> give the path of the input video, like "/tmp/x.avi"
To use an image list -> give the path to the XML or YAML file containing the list of the images, like "/tmp/circles_list.xml"
-->
<Input>"images/CameraCalibraation/VID5/VID5.xml"</Input>
<!-- If true (non-zero) we flip the input images around the horizontal axis.-->
<Input_FlipAroundHorizontalAxis>0</Input_FlipAroundHorizontalAxis>
<!-- Time delay between frames in case of camera. -->
<Input_Delay>100</Input_Delay>
<!-- How many frames to use, for calibration. -->
<Calibrate_NrOfFrameToUse>25</Calibrate_NrOfFrameToUse>
<!-- Consider only fy as a free parameter, the ratio fx/fy stays the same as in the input cameraMatrix.
Use or not setting. 0 - False Non-Zero - True-->
<Calibrate_FixAspectRatio> 1 </Calibrate_FixAspectRatio>
<!-- If true (non-zero) tangential distortion coefficients are set to zeros and stay zero.-->
<Calibrate_AssumeZeroTangentialDistortion>1</Calibrate_AssumeZeroTangentialDistortion>
<!-- If true (non-zero) the principal point is not changed during the global optimization.-->
<Calibrate_FixPrincipalPointAtTheCenter> 1 </Calibrate_FixPrincipalPointAtTheCenter>
<!-- The name of the output log file. -->
<Write_outputFileName>"out_camera_data.xml"</Write_outputFileName>
<!-- If true (non-zero) we write to the output file the feature points.-->
<Write_DetectedFeaturePoints>1</Write_DetectedFeaturePoints>
<!-- If true (non-zero) we write to the output file the extrinsic camera parameters.-->
<Write_extrinsicParameters>1</Write_extrinsicParameters>
<!-- If true (non-zero) we show after calibration the undistorted images.-->
<Show_UndistortedImage>1</Show_UndistortedImage>
</Settings>
</opencv_storage>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment