Main MRPT website > C++ reference
MRPT logo
chessboard_find_corners.h
Go to the documentation of this file.
00001 /* +---------------------------------------------------------------------------+
00002    |          The Mobile Robot Programming Toolkit (MRPT) C++ library          |
00003    |                                                                           |
00004    |                       http://www.mrpt.org/                                |
00005    |                                                                           |
00006    |   Copyright (C) 2005-2011  University of Malaga                           |
00007    |                                                                           |
00008    |    This software was written by the Machine Perception and Intelligent    |
00009    |      Robotics Lab, University of Malaga (Spain).                          |
00010    |    Contact: Jose-Luis Blanco  <jlblanco@ctima.uma.es>                     |
00011    |                                                                           |
00012    |  This file is part of the MRPT project.                                   |
00013    |                                                                           |
00014    |     MRPT is free software: you can redistribute it and/or modify          |
00015    |     it under the terms of the GNU General Public License as published by  |
00016    |     the Free Software Foundation, either version 3 of the License, or     |
00017    |     (at your option) any later version.                                   |
00018    |                                                                           |
00019    |   MRPT is distributed in the hope that it will be useful,                 |
00020    |     but WITHOUT ANY WARRANTY; without even the implied warranty of        |
00021    |     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         |
00022    |     GNU General Public License for more details.                          |
00023    |                                                                           |
00024    |     You should have received a copy of the GNU General Public License     |
00025    |     along with MRPT.  If not, see <http://www.gnu.org/licenses/>.         |
00026    |                                                                           |
00027    +---------------------------------------------------------------------------+ */
00028 
00029 #ifndef mrpt_vision_find_chessboard_H
00030 #define mrpt_vision_find_chessboard_H
00031 
00032 #include <mrpt/utils/CImage.h>
00033 
00034 #include <mrpt/vision/types.h>
00035 #include <mrpt/vision/link_pragmas.h>
00036 
00037 namespace mrpt
00038 {
00039         namespace vision
00040         {
00041                 /** \addtogroup chessboard_calib
00042                     @{ */
00043 
00044                 /** Look for the corners of a chessboard in the image using one of two different methods.
00045                   *
00046                   *  The search algorithm will be OpenCV's function cvFindChessboardCorners or its improved
00047                   *   version published by M. Rufli, D. Scaramuzza, and R. Siegwart. See: http://robotics.ethz.ch/~scaramuzza/Davide_Scaramuzza_files/Research/OcamCalib_Tutorial.htm
00048                   *    and the papers:
00049                   *             - 1. Scaramuzza, D., Martinelli, A. and Siegwart, R. (2006), A Toolbox for Easily Calibrating Omnidirectional Cameras, Proceedings of the IEEE/RSJ International Conference on Intelligent Robots and Systems  (IROS 2006), Beijing, China, October 2006.
00050                   *             - 2. Scaramuzza, D., Martinelli, A. and Siegwart, R., (2006). "A Flexible Technique for Accurate Omnidirectional Camera Calibration and Structure from Motion", Proceedings of IEEE International Conference of Vision Systems  (ICVS'06), New York, January 5-7, 2006.
00051                   *             - 3. Rufli, M., Scaramuzza, D., and Siegwart, R. (2008), Automatic Detection of Checkerboards on Blurred and Distorted Images, Proceedings of the IEEE/RSJ International Conference on Intelligent Robots and Systems (IROS 2008), Nice, France, September 2008.
00052                   *
00053                   *  After detecting the corners with either method, it's called "cvFindCornerSubPix" to achieve subpixel accuracy.
00054                   *
00055                   * \param cornerCoords [OUT] The pixel coordinates of all the corners.
00056                   * \param check_size_x [IN] The number of squares, in the X direction
00057                   * \param check_size_y [IN] The number of squares, in the Y direction
00058                   * \param normalize_image [IN] Whether to normalize the image before detection
00059                   * \param useScaramuzzaMethod [IN] Whether to use the alternative, more robust method by M. Rufli, D. Scaramuzza, and R. Siegwart.
00060                   *
00061                   * \return true on success
00062                   *
00063                   * \sa findMultipleChessboardsCorners, mrpt::vision::checkerBoardCameraCalibration, drawChessboardCorners
00064                   */
00065                 bool VISION_IMPEXP findChessboardCorners(
00066                         const mrpt::utils::CImage &img,
00067                         std::vector<TPixelCoordf>       &cornerCoords,
00068                         unsigned int  check_size_x,
00069                         unsigned int  check_size_y,
00070                         bool  normalize_image = true,
00071                         bool  useScaramuzzaMethod = false );
00072 
00073                 /** Look for the corners of one or more chessboard/checkerboards in the image.
00074                   *  This method uses an improved version of OpenCV's cvFindChessboardCorners published
00075                   *   by M. Rufli, D. Scaramuzza, and R. Siegwart. See: http://robotics.ethz.ch/~scaramuzza/Davide_Scaramuzza_files/Research/OcamCalib_Tutorial.htm
00076                   *    and the papers:
00077                   *             - 1. Scaramuzza, D., Martinelli, A. and Siegwart, R. (2006), A Toolbox for Easily Calibrating Omnidirectional Cameras, Proceedings of the IEEE/RSJ International Conference on Intelligent Robots and Systems  (IROS 2006), Beijing, China, October 2006.
00078                   *             - 2. Scaramuzza, D., Martinelli, A. and Siegwart, R., (2006). "A Flexible Technique for Accurate Omnidirectional Camera Calibration and Structure from Motion", Proceedings of IEEE International Conference of Vision Systems  (ICVS'06), New York, January 5-7, 2006.
00079                   *             - 3. Rufli, M., Scaramuzza, D., and Siegwart, R. (2008), Automatic Detection of Checkerboards on Blurred and Distorted Images, Proceedings of the IEEE/RSJ International Conference on Intelligent Robots and Systems (IROS 2008), Nice, France, September 2008.
00080                   *
00081                   *  That method has been extended in this MRPT implementation to automatically detect a
00082                   *   number of different checkerboards in the same image.
00083                   *
00084                   * \param cornerCoords [OUT] A vector of N vectors of pixel coordinates, for each of the N chessboards detected.
00085                   * \param check_size_x [IN] The number of squares, in the X direction
00086                   * \param check_size_y [IN] The number of squares, in the Y direction
00087                   *
00088                   *
00089                   * \sa mrpt::vision::checkerBoardCameraCalibration, drawChessboardCorners
00090                   */
00091                 void VISION_IMPEXP findMultipleChessboardsCorners(
00092                         const mrpt::utils::CImage &img,
00093                         std::vector<std::vector<TPixelCoordf> >         &cornerCoords,
00094                         unsigned int  check_size_x,
00095                         unsigned int  check_size_y );
00096 
00097                 /** @} */
00098         }
00099 }
00100 #endif
00101 



Page generated by Doxygen 1.7.5 for MRPT 0.9.5 SVN: at Thu Oct 13 21:25:36 UTC 2011