Image Component Library (ICL)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
OpenCVCamCalib.h
Go to the documentation of this file.
00001 /********************************************************************
00002 **                Image Component Library (ICL)                    **
00003 **                                                                 **
00004 ** Copyright (C) 2006-2013 CITEC, University of Bielefeld          **
00005 **                         Neuroinformatics Group                  **
00006 ** Website: www.iclcv.org and                                      **
00007 **          http://opensource.cit-ec.de/projects/icl               **
00008 **                                                                 **
00009 ** File   : ICLGeom/src/ICLCV/OpenCVCamCalib.h                     **
00010 ** Module : ICLGeom                                                **
00011 ** Authors: Christian Groszewski                                   **
00012 **                                                                 **
00013 **                                                                 **
00014 ** GNU LESSER GENERAL PUBLIC LICENSE                               **
00015 ** This file may be used under the terms of the GNU Lesser General **
00016 ** Public License version 3.0 as published by the                  **
00017 **                                                                 **
00018 ** Free Software Foundation and appearing in the file LICENSE.LGPL **
00019 ** included in the packaging of this file.  Please review the      **
00020 ** following information to ensure the license requirements will   **
00021 ** be met: http://www.gnu.org/licenses/lgpl-3.0.txt                **
00022 **                                                                 **
00023 ** The development of this software was supported by the           **
00024 ** Excellence Cluster EXC 277 Cognitive Interaction Technology.    **
00025 ** The Excellence Cluster EXC 277 is a grant of the Deutsche       **
00026 ** Forschungsgemeinschaft (DFG) in the context of the German       **
00027 ** Excellence Initiative.                                          **
00028 **                                                                 **
00029 ********************************************************************/
00030 
00031 #pragma once
00032 
00033 #include <ICLCore/Img.h>
00034 #include <ICLUtils/BasicTypes.h>
00035 #include <ICLMath/DynMatrix.h>
00036 
00037 #include <ICLUtils/Macros.h>
00038 #include <ICLUtils/Uncopyable.h>
00039 
00040 #include <ICLCore/OpenCV.h>
00041 
00042 
00043 namespace icl{
00044   namespace cv{
00045     
00047     class ICLCV_API OpenCVCamCalib : public utils::Uncopyable{
00048       
00049       struct Data;
00051       Data *m_data;
00052       
00053       public:
00055 
00060       OpenCVCamCalib(unsigned int boardWidth=6, unsigned int boardHeight=9, unsigned int boardCount=8);
00061       
00063       ~OpenCVCamCalib();
00064       
00066       /*@param img image to be searched for chessboard and points
00067           @return overall current number of found chessboard for calibration
00068           */
00069       int addPoints(const core::ImgBase *img);
00070       
00072       void calibrateCam();
00073         
00075       /*@return the new undistorted image*/
00076       core::ImgBase *undisort(const core::ImgBase *img);
00077   
00079       /*@param width of the chessboard
00080           @param height of the chessboard
00081           @param count minimum number of chessboards to be found on images before calibration*/
00082       void resetData(int width, int height, int count);
00083   
00085       /*@return intrinsic params*/
00086       math::DynMatrix<icl64f> *getIntrinsics();
00087   
00089       /*@return distortion params*/
00090       math::DynMatrix<icl64f> *getDistortion();
00091   
00093       void loadParams(const char* xmlfilename);
00094   
00096       void saveParams(const char* xmlfilename);
00097   
00098     };
00099   } // namespace geom
00100 
00101 }
00102 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines