/usr/include/visp/vpCalibration.h is in libvisp-dev 2.9.0-3+b2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 | /****************************************************************************
*
* $Id: vpCalibration.h 4663 2014-02-14 10:32:11Z fspindle $
*
* This file is part of the ViSP software.
* Copyright (C) 2005 - 2014 by INRIA. All rights reserved.
*
* This software is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* ("GPL") version 2 as published by the Free Software Foundation.
* See the file LICENSE.txt at the root directory of this source
* distribution for additional information about the GNU GPL.
*
* For using ViSP with software that can not be combined with the GNU
* GPL, please contact INRIA about acquiring a ViSP Professional
* Edition License.
*
* See http://www.irisa.fr/lagadic/visp/visp.html for more information.
*
* This software was developed at:
* INRIA Rennes - Bretagne Atlantique
* Campus Universitaire de Beaulieu
* 35042 Rennes Cedex
* France
* http://www.irisa.fr/lagadic
*
* If you have questions regarding the use of this file, please contact
* INRIA at visp@inria.fr
*
* This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
* WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
*
* Description:
* Camera calibration.
*
* Authors:
* Eric Marchand
* Francois Chaumette
* Anthony Saunier
*
*****************************************************************************/
/*!
\file vpCalibration.h
\brief Tools for camera calibration.
\author Eric Marchand (INRIA) using code from Francois Chaumette (INRIA)
\sa the example in calibrate.cpp
*/
#ifndef vpCalibration_h
#define vpCalibration_h
#include <visp/vpMatrix.h>
#include <visp/vpHomogeneousMatrix.h>
#include <visp/vpCameraParameters.h>
#include <visp/vpExponentialMap.h>
#include <visp/vpMath.h>
#include <visp/vpDisplay.h>
#include <visp/vpImage.h>
#include <visp/vpCalibrationException.h>
#include <visp/vpImagePoint.h>
#ifdef VISP_BUILD_DEPRECATED_FUNCTIONS
# include <visp/vpList.h>
#endif
#include <list>
#include <vector>
/*!
\class vpCalibration
\ingroup Calibration
\brief Tools for perspective camera calibration.
*/
class VISP_EXPORT vpCalibration
{
public:
/*!
Minimization algorithm use to estimate the camera parameters.
*/
typedef enum{
CALIB_LAGRANGE, /*!< Lagrange approach without estimation of the distortion. */
CALIB_VIRTUAL_VS, /*!< Virtual visual servoing approach without estimation of the distortion (results are similar to Lowe approach). */
CALIB_VIRTUAL_VS_DIST, /*!< Virtual visual servoing approach with estimation of the distortion. */
CALIB_LAGRANGE_VIRTUAL_VS, /*!< Lagrange approach first, than virtual visual servoing approach, without estimation of the distortion. */
CALIB_LAGRANGE_VIRTUAL_VS_DIST, /*!< Lagrange approach first, than virtual visual servoing approach, with estimation of the distortion. */
} vpCalibrationMethodType ;
vpHomogeneousMatrix cMo ; //!< the pose computed for the model without distortion
//!< (as a 3x4 matrix [R T])
vpHomogeneousMatrix cMo_dist ; //!< the pose computed for perspective projection
//!< with distortion model
//!< (as a 3x4 matrix [R T])
vpCameraParameters cam; //!< camera intrinsic parameters for perspective
//!< projection model without distortion
vpCameraParameters cam_dist; //!< camera intrinsic parameters for perspective
//!< projection model with distortion
vpHomogeneousMatrix rMe; //!< position of the effector in relation to the
//!< reference coordinates (manipulator base coordinates)
vpHomogeneousMatrix eMc; //!< position of the camera in relation to the effector
vpHomogeneousMatrix eMc_dist;
public:
// Constructor
vpCalibration() ;
vpCalibration(const vpCalibration& c) ;
// Destructor
virtual ~vpCalibration() ;
// Add a new point in this array
int addPoint(double X, double Y, double Z, vpImagePoint &ip) ;
// = operator
vpCalibration& operator=(const vpCalibration& twinCalibration);
static void calibrationTsai(std::vector<vpHomogeneousMatrix> &cMo,
std::vector<vpHomogeneousMatrix> &rMe,
vpHomogeneousMatrix &eMc);
//! Suppress all the point in the array of point
int clearPoint() ;
void computeStdDeviation(double &deviation, double &deviation_dist);
int computeCalibration(vpCalibrationMethodType method,
vpHomogeneousMatrix &cMo_est,
vpCameraParameters &cam_est,
bool verbose = false) ;
static int computeCalibrationMulti(vpCalibrationMethodType method,
std::vector<vpCalibration> &table_cal,
vpCameraParameters &cam,
double &globalReprojectionError,
bool verbose = false) ;
static int computeCalibrationTsai(std::vector<vpCalibration> &table_cal,
vpHomogeneousMatrix &eMc,
vpHomogeneousMatrix &eMc_dist);
double computeStdDeviation(const vpHomogeneousMatrix &cMo_est,
const vpCameraParameters &camera);
double computeStdDeviation_dist(const vpHomogeneousMatrix &cMo,
const vpCameraParameters &cam);
int displayData(vpImage<unsigned char> &I, vpColor color=vpColor::red,
unsigned int thickness=1) ;
int displayGrid(vpImage<unsigned char> &I, vpColor color=vpColor::yellow,
unsigned int thickness=1) ;
//! Set the gain for the virtual visual servoing algorithm.
static double getLambda(){return gain;}
//!get the residual in pixels
double getResidual(void) const {return residual;}
//!get the residual for perspective projection with distortion (in pixels)
double getResidual_dist(void) const {return residual_dist;}
//!get the number of points
unsigned int get_npt() const {return npt;}
int init() ;
int readData(const char *filename) ;
static int readGrid(const char *filename,unsigned int &n,
std::list<double> &oX, std::list<double> &oY, std::list<double> &oZ,
bool verbose = false);
//!set the gain for the virtual visual servoing algorithm
static void setLambda(const double &lambda){gain = lambda;}
int writeData(const char *filename) ;
#ifdef VISP_BUILD_DEPRECATED_FUNCTIONS
/*!
@name Deprecated functions
*/
static void calibrationTsai(unsigned int nbPose, vpHomogeneousMatrix cMo[],
vpHomogeneousMatrix rMe[],
vpHomogeneousMatrix &eMc);
static int computeCalibrationMulti(vpCalibrationMethodType method,unsigned int nbPose,
vpCalibration table_cal[],
vpCameraParameters &cam,
bool verbose = false) ;
vp_deprecated static int computeCalibrationTsai(unsigned int nbPose,
vpCalibration table_cal[],
vpHomogeneousMatrix &eMc,
vpHomogeneousMatrix &eMc_dist);
vp_deprecated static int readGrid(const char *filename,unsigned int &n,
vpList<double> &oX,vpList<double> &oY,vpList<double> &oZ,
bool verbose = false);
#endif
private:
void computePose(const vpCameraParameters &cam, vpHomogeneousMatrix &cMo);
void calibLagrange( vpCameraParameters &cam , vpHomogeneousMatrix &cMo) ;
//! Compute the calibration using virtual visual servoing approach
void calibVVS( vpCameraParameters &cam , vpHomogeneousMatrix &cMo,
bool verbose = false) ;
static void calibVVSMulti(unsigned int nbPose, vpCalibration table_cal[],
vpCameraParameters &cam, bool verbose = false);
static void calibVVSMulti(std::vector<vpCalibration> &table_cal,
vpCameraParameters &cam,
double &globalReprojectionError, bool verbose = false) ;
void calibVVSWithDistortion( vpCameraParameters &cam,
vpHomogeneousMatrix &cMo,
bool verbose = false) ;
static void calibVVSWithDistortionMulti( unsigned int nbPose,
vpCalibration table_cal[],
vpCameraParameters &cam,
bool verbose = false );
static void calibVVSWithDistortionMulti( std::vector<vpCalibration> &table_cal,
vpCameraParameters &cam,
double &globalReprojectionError,
bool verbose = false);
private:
unsigned int npt ; //!< number of points used in calibration computation
std::list<double> LoX, LoY, LoZ ; //!< list of points coordinates (3D in meters)
std::list<vpImagePoint> Lip ; //!< list of points coordinates (2D in pixels)
double residual ; //!< residual in pixel for camera model without distortion
double residual_dist ; //!< residual in pixel for perspective projection with distortion model
static double threshold;
static unsigned int nbIterMax;
static double gain;
} ;
#endif
/*
* Local variables:
* c-basic-offset: 2
* End:
*/
|