- Main Page
- Related Pages
- Namespaces
- Classes
- Files

- File List
- File Members

# C:/opt/OpenCV-2.2.0/modules/legacy/include/opencv2/legacy/compat.hpp

Go to the documentation of this file.

    00001 /*M///////////////////////////////////////////////////////////////////////////////////////
    00002 //
    00003 //  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
    00004 //
    00005 //  By downloading, copying, installing or using the software you agree to this license.
    00006 //  If you do not agree to this license, do not download, install,
    00007 //  copy or use the software.
    00008 //
    00009 //
    00010 //                        Intel License Agreement
    00011 //                For Open Source Computer Vision Library
    00012 //
    00013 // Copyright( C) 2000, Intel Corporation, all rights reserved.
    00014 // Third party copyrights are property of their respective owners.
    00015 //
    00016 // Redistribution and use in source and binary forms, with or without modification,
    00017 // are permitted provided that the following conditions are met:
    00018 //
    00019 //   * Redistribution's of source code must retain the above copyright notice,
    00020 //     this list of conditions and the following disclaimer.
    00021 //
    00022 //   * Redistribution's in binary form must reproduce the above copyright notice,
    00023 //     this list of conditions and the following disclaimer in the documentation
    00024 //     and/or other materials provided with the distribution.
    00025 //
    00026 //   * The name of Intel Corporation may not be used to endorse or promote products
    00027 //     derived from this software without specific prior written permission.
    00028 //
    00029 // This software is provided by the copyright holders and contributors "as is" and
    00030 // any express or implied warranties, including, but not limited to, the implied
    00031 // warranties of merchantability and fitness for a particular purpose are disclaimed.
    00032 // In no event shall the Intel Corporation or contributors be liable for any direct,
    00033 // indirect, incidental, special, exemplary, or consequential damages
    00034 //(including, but not limited to, procurement of substitute goods or services;
    00035 // loss of use, data, or profits; or business interruption) however caused
    00036 // and on any theory of liability, whether in contract, strict liability,
    00037 // or tort(including negligence or otherwise) arising in any way out of
    00038 // the use of this software, even if advised of the possibility of such damage.
    00039 //
    00040 //M*/
    00041
    00042 /*
    00043    A few macros and definitions for backward compatibility
    00044    with the previous versions of OpenCV. They are obsolete and
    00045    are likely to be removed in future. To check whether your code
    00046    uses any of these, define CV_NO_BACKWARD_COMPATIBILITY before
    00047    including cv.h.
    00048 */
    00049
    00050 #ifndef __OPENCV_COMPAT_HPP__
    00051 #define __OPENCV_COMPAT_HPP__
    00052
    00053 #include "opencv2/core/core_c.h"
    00054 #include "opencv2/imgproc/types_c.h"
    00055
    00056 #include <math.h>
    00057 #include <string.h>
    00058
    00059 #ifdef __cplusplus
    00060 extern "C" {
    00061 #endif
    00062
    00063 typedef int CvMatType;
    00064 typedef int CvDisMaskType;
    00065 typedef CvMat CvMatArray;
    00066
    00067 typedef int CvThreshType;
    00068 typedef int CvAdaptiveThreshMethod;
    00069 typedef int CvCompareMethod;
    00070 typedef int CvFontFace;
    00071 typedef int CvPolyApproxMethod;
    00072 typedef int CvContoursMatchMethod;
    00073 typedef int CvContourTreesMatchMethod;
    00074 typedef int CvCoeffType;
    00075 typedef int CvRodriguesType;
    00076 typedef int CvElementShape;
    00077 typedef int CvMorphOp;
    00078 typedef int CvTemplMatchMethod;
    00079
    00080 typedef CvPoint2D64f CvPoint2D64d;
    00081 typedef CvPoint3D64f CvPoint3D64d;
    00082
    00083 enum
    00084 {
    00085     CV_MAT32F      = CV_32FC1,
    00086     CV_MAT3x1_32F  = CV_32FC1,
    00087     CV_MAT4x1_32F  = CV_32FC1,
    00088     CV_MAT3x3_32F  = CV_32FC1,
    00089     CV_MAT4x4_32F  = CV_32FC1,
    00090
    00091     CV_MAT64D      = CV_64FC1,
    00092     CV_MAT3x1_64D  = CV_64FC1,
    00093     CV_MAT4x1_64D  = CV_64FC1,
    00094     CV_MAT3x3_64D  = CV_64FC1,
    00095     CV_MAT4x4_64D  = CV_64FC1
    00096 };
    00097
    00098 enum
    00099 {
    00100     IPL_GAUSSIAN_5x5 = 7
    00101 };
    00102
    00103 typedef CvBox2D  CvBox2D32f;
    00104
    00105 /* allocation/deallocation macros */
    00106 #define cvCreateImageData   cvCreateData
    00107 #define cvReleaseImageData  cvReleaseData
    00108 #define cvSetImageData      cvSetData
    00109 #define cvGetImageRawData   cvGetRawData
    00110
    00111 #define cvmAlloc            cvCreateData
    00112 #define cvmFree             cvReleaseData
    00113 #define cvmAllocArray       cvCreateData
    00114 #define cvmFreeArray        cvReleaseData
    00115
    00116 #define cvIntegralImage     cvIntegral
    00117 #define cvMatchContours     cvMatchShapes
    00118
    00119 CV_EXPORTS CvMat cvMatArray( int rows, int cols, int type,
    00120                             int count, void* data CV_DEFAULT(0));
    00121
    00122 #define cvUpdateMHIByTime  cvUpdateMotionHistory
    00123
    00124 #define cvAccMask cvAcc
    00125 #define cvSquareAccMask cvSquareAcc
    00126 #define cvMultiplyAccMask cvMultiplyAcc
    00127 #define cvRunningAvgMask(imgY, imgU, mask, alpha) cvRunningAvg(imgY, imgU, alpha, mask)
    00128
    00129 #define cvSetHistThresh  cvSetHistBinRanges
    00130 #define cvCalcHistMask(img, mask, hist, doNotClear) cvCalcHist(img, hist, doNotClear, mask)
    00131
    00132 CV_EXPORTS double cvMean( const CvArr* image, const CvArr* mask CV_DEFAULT(0));
    00133 CV_EXPORTS double cvSumPixels( const CvArr* image );
    00134 CV_EXPORTS void  cvMean_StdDev( const CvArr* image, double* mean, double* sdv,
    00135                                 const CvArr* mask CV_DEFAULT(0));
    00136
    00137 CV_EXPORTS void cvmPerspectiveProject( const CvMat* mat, const CvArr* src, CvArr* dst );
    00138 CV_EXPORTS void cvFillImage( CvArr* mat, double color );
    00139
    00140 #define cvCvtPixToPlane cvSplit
    00141 #define cvCvtPlaneToPix cvMerge
    00142
    00143 typedef struct CvRandState
    00144 {
    00145     CvRNG     state;    /* RNG state (the current seed and carry)*/
    00146     int       disttype; /* distribution type */
    00147     CvScalar  param[2]; /* parameters of RNG */
    00148 } CvRandState;
    00149
    00150 /* Changes RNG range while preserving RNG state */
    00151 CV_EXPORTS void  cvRandSetRange( CvRandState* state, double param1,
    00152                                  double param2, int index CV_DEFAULT(-1));
    00153
    00154 CV_EXPORTS void  cvRandInit( CvRandState* state, double param1,
    00155                              double param2, int seed,
    00156                              int disttype CV_DEFAULT(CV_RAND_UNI));
    00157
    00158 /* Fills array with random numbers */
    00159 CV_EXPORTS void cvRand( CvRandState* state, CvArr* arr );
    00160
    00161 #define cvRandNext( _state ) cvRandInt( &(_state)->state )
    00162
    00163 CV_EXPORTS void cvbRand( CvRandState* state, float* dst, int len );
    00164
    00165 CV_EXPORTS void  cvbCartToPolar( const float* y, const float* x,
    00166                                  float* magnitude, float* angle, int len );
    00167 CV_EXPORTS void  cvbFastArctan( const float* y, const float* x, float* angle, int len );
    00168 CV_EXPORTS void  cvbSqrt( const float* x, float* y, int len );
    00169 CV_EXPORTS void  cvbInvSqrt( const float* x, float* y, int len );
    00170 CV_EXPORTS void  cvbReciprocal( const float* x, float* y, int len );
    00171 CV_EXPORTS void  cvbFastExp( const float* x, double* y, int len );
    00172 CV_EXPORTS void  cvbFastLog( const double* x, float* y, int len );
    00173
    00174 CV_EXPORTS CvRect  cvContourBoundingRect( void* point_set, int update CV_DEFAULT(0));
    00175
    00176 CV_EXPORTS double cvPseudoInverse( const CvArr* src, CvArr* dst );
    00177 #define cvPseudoInv cvPseudoInverse
    00178
    00179 #define cvContourMoments( contour, moments ) cvMoments( contour, moments, 0 )
    00180
    00181 #define cvGetPtrAt              cvPtr2D
    00182 #define cvGetAt                 cvGet2D
    00183 #define cvSetAt(arr,val,y,x)    cvSet2D((arr),(y),(x),(val))
    00184
    00185 #define cvMeanMask  cvMean
    00186 #define cvMean_StdDevMask(img,mask,mean,sdv) cvMean_StdDev(img,mean,sdv,mask)
    00187
    00188 #define cvNormMask(imgA,imgB,mask,normType) cvNorm(imgA,imgB,normType,mask)
    00189
    00190 #define cvMinMaxLocMask(img, mask, min_val, max_val, min_loc, max_loc) \
    00191         cvMinMaxLoc(img, min_val, max_val, min_loc, max_loc, mask)
    00192
    00193 #define cvRemoveMemoryManager  cvSetMemoryManager
    00194
    00195 #define cvmSetZero( mat )               cvSetZero( mat )
    00196 #define cvmSetIdentity( mat )           cvSetIdentity( mat )
    00197 #define cvmAdd( src1, src2, dst )       cvAdd( src1, src2, dst, 0 )
    00198 #define cvmSub( src1, src2, dst )       cvSub( src1, src2, dst, 0 )
    00199 #define cvmCopy( src, dst )             cvCopy( src, dst, 0 )
    00200 #define cvmMul( src1, src2, dst )       cvMatMulAdd( src1, src2, 0, dst )
    00201 #define cvmTranspose( src, dst )        cvT( src, dst )
    00202 #define cvmInvert( src, dst )           cvInv( src, dst )
    00203 #define cvmMahalanobis(vec1, vec2, mat) cvMahalanobis( vec1, vec2, mat )
    00204 #define cvmDotProduct( vec1, vec2 )     cvDotProduct( vec1, vec2 )
    00205 #define cvmCrossProduct(vec1, vec2,dst) cvCrossProduct( vec1, vec2, dst )
    00206 #define cvmTrace( mat )                 (cvTrace( mat )).val[0]
    00207 #define cvmMulTransposed( src, dst, order ) cvMulTransposed( src, dst, order )
    00208 #define cvmEigenVV( mat, evec, eval, eps)   cvEigenVV( mat, evec, eval, eps )
    00209 #define cvmDet( mat )                   cvDet( mat )
    00210 #define cvmScale( src, dst, scale )     cvScale( src, dst, scale )
    00211
    00212 #define cvCopyImage( src, dst )         cvCopy( src, dst, 0 )
    00213 #define cvReleaseMatHeader              cvReleaseMat
    00214
    00215 /* Calculates exact convex hull of 2d point set */
    00216 CV_EXPORTS void cvConvexHull( CvPoint* points, int num_points,
    00217                              CvRect* bound_rect,
    00218                              int orientation, int* hull, int* hullsize );
    00219
    00220
    00221 CV_EXPORTS void cvMinAreaRect( CvPoint* points, int n,
    00222                               int left, int bottom,
    00223                               int right, int top,
    00224                               CvPoint2D32f* anchor,
    00225                               CvPoint2D32f* vect1,
    00226                               CvPoint2D32f* vect2 );
    00227
    00228 typedef int CvDisType;
    00229 typedef int CvChainApproxMethod;
    00230 typedef int CvContourRetrievalMode;
    00231
    00232 CV_EXPORTS  void  cvFitLine3D( CvPoint3D32f* points, int count, int dist,
    00233                     void *param, float reps, float aeps, float* line );
    00234
    00235 /* Fits a line into set of 2d points in a robust way (M-estimator technique) */
    00236 CV_EXPORTS  void  cvFitLine2D( CvPoint2D32f* points, int count, int dist,
    00237                     void *param, float reps, float aeps, float* line );
    00238
    00239 CV_EXPORTS  void  cvFitEllipse( const CvPoint2D32f* points, int count, CvBox2D* box );
    00240
    00241 /* Projects 2d points to one of standard coordinate planes
    00242    (i.e. removes one of coordinates) */
    00243 CV_EXPORTS  void  cvProject3D( CvPoint3D32f* points3D, int count,
    00244                               CvPoint2D32f* points2D,
    00245                               int xIndx CV_DEFAULT(0),
    00246                               int yIndx CV_DEFAULT(1));
    00247
    00248 /* Retrieves value of the particular bin
    00249    of x-dimensional (x=1,2,3,...) histogram */
    00250 #define cvQueryHistValue_1D( hist, idx0 ) \
    00251     ((float)cvGetReal1D( (hist)->bins, (idx0)))
    00252 #define cvQueryHistValue_2D( hist, idx0, idx1 ) \
    00253     ((float)cvGetReal2D( (hist)->bins, (idx0), (idx1)))
    00254 #define cvQueryHistValue_3D( hist, idx0, idx1, idx2 ) \
    00255     ((float)cvGetReal3D( (hist)->bins, (idx0), (idx1), (idx2)))
    00256 #define cvQueryHistValue_nD( hist, idx ) \
    00257     ((float)cvGetRealND( (hist)->bins, (idx)))
    00258
    00259 /* Returns pointer to the particular bin of x-dimesional histogram.
    00260    For sparse histogram the bin is created if it didn't exist before */
    00261 #define cvGetHistValue_1D( hist, idx0 ) \
    00262     ((float*)cvPtr1D( (hist)->bins, (idx0), 0))
    00263 #define cvGetHistValue_2D( hist, idx0, idx1 ) \
    00264     ((float*)cvPtr2D( (hist)->bins, (idx0), (idx1), 0))
    00265 #define cvGetHistValue_3D( hist, idx0, idx1, idx2 ) \
    00266     ((float*)cvPtr3D( (hist)->bins, (idx0), (idx1), (idx2), 0))
    00267 #define cvGetHistValue_nD( hist, idx ) \
    00268     ((float*)cvPtrND( (hist)->bins, (idx), 0))
    00269
    00270
    00271 #define CV_IS_SET_ELEM_EXISTS CV_IS_SET_ELEM
    00272
    00273
    00274 CV_EXPORTS  int  cvHoughLines( CvArr* image, double rho,
    00275                               double theta, int threshold,
    00276                               float* lines, int linesNumber );
    00277
    00278 CV_EXPORTS  int  cvHoughLinesP( CvArr* image, double rho,
    00279                                double theta, int threshold,
    00280                                int lineLength, int lineGap,
    00281                                int* lines, int linesNumber );
    00282
    00283
    00284 CV_EXPORTS  int  cvHoughLinesSDiv( CvArr* image, double rho, int srn,
    00285                                   double theta, int stn, int threshold,
    00286                                   float* lines, int linesNumber );
    00287
    00288 CV_EXPORTS  float  cvCalcEMD( const float* signature1, int size1,
    00289                              const float* signature2, int size2,
    00290                              int dims, int dist_type CV_DEFAULT(CV_DIST_L2),
    00291                              CvDistanceFunction dist_func CV_DEFAULT(0),
    00292                              float* lower_bound CV_DEFAULT(0),
    00293                              void* user_param CV_DEFAULT(0));
    00294
    00295 CV_EXPORTS  void  cvKMeans( int num_clusters, float** samples,
    00296                            int num_samples, int vec_size,
    00297                            CvTermCriteria termcrit, int* cluster_idx );
    00298
    00299 CV_EXPORTS void  cvStartScanGraph( CvGraph* graph, CvGraphScanner* scanner,
    00300                                   CvGraphVtx* vtx CV_DEFAULT(NULL),
    00301                                   int mask CV_DEFAULT(CV_GRAPH_ALL_ITEMS));
    00302
    00303 CV_EXPORTS  void  cvEndScanGraph( CvGraphScanner* scanner );
    00304
    00305
    00306 /* old drawing functions */
    00307 CV_EXPORTS void  cvLineAA( CvArr* img, CvPoint pt1, CvPoint pt2,
    00308                             double color, int scale CV_DEFAULT(0));
    00309
    00310 CV_EXPORTS void  cvCircleAA( CvArr* img, CvPoint center, int radius,
    00311                             double color, int scale CV_DEFAULT(0) );
    00312
    00313 CV_EXPORTS void  cvEllipseAA( CvArr* img, CvPoint center, CvSize axes,
    00314                               double angle, double start_angle,
    00315                               double end_angle, double color,
    00316                               int scale CV_DEFAULT(0) );
    00317
    00318 CV_EXPORTS void  cvPolyLineAA( CvArr* img, CvPoint** pts, int* npts, int contours,
    00319                               int is_closed, double color, int scale CV_DEFAULT(0) );
    00320
    00321 /****************************************************************************************\
    00322 *                                   Pixel Access Macros                                  *
    00323 \****************************************************************************************/
    00324
    00325 typedef struct _CvPixelPosition8u
    00326 {
    00327     uchar*  currline;      /* pointer to the start of the current pixel line   */
    00328     uchar*  topline;       /* pointer to the start of the top pixel line       */
    00329     uchar*  bottomline;    /* pointer to the start of the first line           */
    00330                                     /* which is below the image                         */
    00331     int     x;                      /* current x coordinate ( in pixels )               */
    00332     int     width;                  /* width of the image  ( in pixels )                */
    00333     int     height;                 /* height of the image  ( in pixels )               */
    00334     int     step;                   /* distance between lines ( in elements of single   */
    00335                                     /* plane )                                          */
    00336     int     step_arr[3];            /* array: ( 0, -step, step ). It is used for        */
    00337                                     /* vertical moving                                  */
    00338 } CvPixelPosition8u;
    00339
    00340 /* this structure differs from the above only in data type */
    00341 typedef struct _CvPixelPosition8s
    00342 {
    00343     schar*  currline;
    00344     schar*  topline;
    00345     schar*  bottomline;
    00346     int     x;
    00347     int     width;
    00348     int     height;
    00349     int     step;
    00350     int     step_arr[3];
    00351 } CvPixelPosition8s;
    00352
    00353 /* this structure differs from the CvPixelPosition8u only in data type */
    00354 typedef struct _CvPixelPosition32f
    00355 {
    00356     float*  currline;
    00357     float*  topline;
    00358     float*  bottomline;
    00359     int     x;
    00360     int     width;
    00361     int     height;
    00362     int     step;
    00363     int     step_arr[3];
    00364 } CvPixelPosition32f;
    00365
    00366
    00367 /* Initialize one of the CvPixelPosition structures.   */
    00368 /*  pos    - initialized structure                     */
    00369 /*  origin - pointer to the left-top corner of the ROI */
    00370 /*  step   - width of the whole image in bytes         */
    00371 /*  roi    - width & height of the ROI                 */
    00372 /*  x, y   - initial position                          */
    00373 #define CV_INIT_PIXEL_POS(pos, origin, _step, roi, _x, _y, orientation)    \
    00374     (                                                                        \
    00375     (pos).step = (_step)/sizeof((pos).currline[0]) * (orientation ? -1 : 1), \
    00376     (pos).width = (roi).width,                                               \
    00377     (pos).height = (roi).height,                                             \
    00378     (pos).bottomline = (origin) + (pos).step*(pos).height,                   \
    00379     (pos).topline = (origin) - (pos).step,                                   \
    00380     (pos).step_arr[0] = 0,                                                   \
    00381     (pos).step_arr[1] = -(pos).step,                                         \
    00382     (pos).step_arr[2] = (pos).step,                                          \
    00383     (pos).x = (_x),                                                          \
    00384     (pos).currline = (origin) + (pos).step*(_y) )
    00385
    00386
    00387 /* Move to specified point ( absolute shift ) */
    00388 /*  pos    - position structure               */
    00389 /*  x, y   - coordinates of the new position  */
    00390 /*  cs     - number of the image channels     */
    00391 #define CV_MOVE_TO( pos, _x, _y, cs )                                                   \
    00392 ((pos).currline = (_y) >= 0 && (_y) < (pos).height ? (pos).topline + ((_y)+1)*(pos).step : 0, \
    00393  (pos).x = (_x) >= 0 && (_x) < (pos).width ? (_x) : 0, (pos).currline + (_x) * (cs) )
    00394
    00395 /* Get current coordinates                    */
    00396 /*  pos    - position structure               */
    00397 /*  x, y   - coordinates of the new position  */
    00398 /*  cs     - number of the image channels     */
    00399 #define CV_GET_CURRENT( pos, cs )  ((pos).currline + (pos).x * (cs))
    00400
    00401 /* Move by one pixel relatively to current position */
    00402 /*  pos    - position structure                     */
    00403 /*  cs     - number of the image channels           */
    00404
    00405 /* left */
    00406 #define CV_MOVE_LEFT( pos, cs ) \
    00407  ( --(pos).x >= 0 ? (pos).currline + (pos).x*(cs) : 0 )
    00408
    00409 /* right */
    00410 #define CV_MOVE_RIGHT( pos, cs ) \
    00411  ( ++(pos).x < (pos).width ? (pos).currline + (pos).x*(cs) : 0 )
    00412
    00413 /* up */
    00414 #define CV_MOVE_UP( pos, cs ) \
    00415  (((pos).currline -= (pos).step) != (pos).topline ? (pos).currline + (pos).x*(cs) : 0 )
    00416
    00417 /* down */
    00418 #define CV_MOVE_DOWN( pos, cs ) \
    00419  (((pos).currline += (pos).step) != (pos).bottomline ? (pos).currline + (pos).x*(cs) : 0 )
    00420
    00421 /* left up */
    00422 #define CV_MOVE_LU( pos, cs ) ( CV_MOVE_LEFT(pos, cs), CV_MOVE_UP(pos, cs))
    00423
    00424 /* right up */
    00425 #define CV_MOVE_RU( pos, cs ) ( CV_MOVE_RIGHT(pos, cs), CV_MOVE_UP(pos, cs))
    00426
    00427 /* left down */
    00428 #define CV_MOVE_LD( pos, cs ) ( CV_MOVE_LEFT(pos, cs), CV_MOVE_DOWN(pos, cs))
    00429
    00430 /* right down */
    00431 #define CV_MOVE_RD( pos, cs ) ( CV_MOVE_RIGHT(pos, cs), CV_MOVE_DOWN(pos, cs))
    00432
    00433
    00434
    00435 /* Move by one pixel relatively to current position with wrapping when the position     */
    00436 /* achieves image boundary                                                              */
    00437 /*  pos    - position structure                                                         */
    00438 /*  cs     - number of the image channels                                               */
    00439
    00440 /* left */
    00441 #define CV_MOVE_LEFT_WRAP( pos, cs ) \
    00442  ((pos).currline + ( --(pos).x >= 0 ? (pos).x : ((pos).x = (pos).width-1))*(cs))
    00443
    00444 /* right */
    00445 #define CV_MOVE_RIGHT_WRAP( pos, cs ) \
    00446  ((pos).currline + ( ++(pos).x < (pos).width ? (pos).x : ((pos).x = 0))*(cs) )
    00447
    00448 /* up */
    00449 #define CV_MOVE_UP_WRAP( pos, cs ) \
    00450     ((((pos).currline -= (pos).step) != (pos).topline ? \
    00451     (pos).currline : ((pos).currline = (pos).bottomline - (pos).step)) + (pos).x*(cs) )
    00452
    00453 /* down */
    00454 #define CV_MOVE_DOWN_WRAP( pos, cs ) \
    00455     ((((pos).currline += (pos).step) != (pos).bottomline ? \
    00456     (pos).currline : ((pos).currline = (pos).topline + (pos).step)) + (pos).x*(cs) )
    00457
    00458 /* left up */
    00459 #define CV_MOVE_LU_WRAP( pos, cs ) ( CV_MOVE_LEFT_WRAP(pos, cs), CV_MOVE_UP_WRAP(pos, cs))
    00460 /* right up */
    00461 #define CV_MOVE_RU_WRAP( pos, cs ) ( CV_MOVE_RIGHT_WRAP(pos, cs), CV_MOVE_UP_WRAP(pos, cs))
    00462 /* left down */
    00463 #define CV_MOVE_LD_WRAP( pos, cs ) ( CV_MOVE_LEFT_WRAP(pos, cs), CV_MOVE_DOWN_WRAP(pos, cs))
    00464 /* right down */
    00465 #define CV_MOVE_RD_WRAP( pos, cs ) ( CV_MOVE_RIGHT_WRAP(pos, cs), CV_MOVE_DOWN_WRAP(pos, cs))
    00466
    00467 /* Numeric constants which used for moving in arbitrary direction  */
    00468 enum
    00469 {
    00470     CV_SHIFT_NONE = 2,
    00471     CV_SHIFT_LEFT = 1,
    00472     CV_SHIFT_RIGHT = 3,
    00473     CV_SHIFT_UP = 6,
    00474     CV_SHIFT_DOWN = 10,
    00475     CV_SHIFT_LU = 5,
    00476     CV_SHIFT_RU = 7,
    00477     CV_SHIFT_LD = 9,
    00478     CV_SHIFT_RD = 11
    00479 };
    00480
    00481 /* Move by one pixel in specified direction                                     */
    00482 /*  pos    - position structure                                                 */
    00483 /*  shift  - direction ( it's value must be one of the CV_SHIFT_Ö constants ) */
    00484 /*  cs     - number of the image channels                                       */
    00485 #define CV_MOVE_PARAM( pos, shift, cs )                                             \
    00486     ( (pos).currline += (pos).step_arr[(shift)>>2], (pos).x += ((shift)&3)-2,       \
    00487     ((pos).currline != (pos).topline && (pos).currline != (pos).bottomline &&       \
    00488     (pos).x >= 0 && (pos).x < (pos).width) ? (pos).currline + (pos).x*(cs) : 0 )
    00489
    00490 /* Move by one pixel in specified direction with wrapping when the               */
    00491 /* position achieves image boundary                                              */
    00492 /*  pos    - position structure                                                  */
    00493 /*  shift  - direction ( it's value must be one of the CV_SHIFT_Ö constants )  */
    00494 /*  cs     - number of the image channels                                        */
    00495 #define CV_MOVE_PARAM_WRAP( pos, shift, cs )                                        \
    00496     ( (pos).currline += (pos).step_arr[(shift)>>2],                                 \
    00497     (pos).currline = ((pos).currline == (pos).topline ?                             \
    00498     (pos).bottomline - (pos).step :                                                 \
    00499     (pos).currline == (pos).bottomline ?                                            \
    00500     (pos).topline + (pos).step : (pos).currline),                                   \
    00501                                                                                     \
    00502     (pos).x += ((shift)&3)-2,                                                       \
    00503     (pos).x = ((pos).x < 0 ? (pos).width-1 : (pos).x >= (pos).width ? 0 : (pos).x), \
    00504                                                                                     \
    00505     (pos).currline + (pos).x*(cs) )
    00506
    00507
    00508 typedef float*   CvVect32f;
    00509 typedef float*   CvMatr32f;
    00510 typedef double*  CvVect64d;
    00511 typedef double*  CvMatr64d;
    00512
    00513 CV_EXPORTS void cvUnDistortOnce( const CvArr* src, CvArr* dst,
    00514                                 const float* intrinsic_matrix,
    00515                                 const float* distortion_coeffs,
    00516                                 int interpolate );
    00517
    00518 /* the two functions below have quite hackerish implementations, use with care
    00519    (or, which is better, switch to cvUndistortInitMap and cvRemap instead */
    00520 CV_EXPORTS void cvUnDistortInit( const CvArr* src,
    00521                                 CvArr* undistortion_map,
    00522                                 const float* A, const float* k,
    00523                                 int interpolate );
    00524
    00525 CV_EXPORTS void  cvUnDistort( const CvArr* src, CvArr* dst,
    00526                              const CvArr* undistortion_map,
    00527                              int interpolate );
    00528
    00529 /* Find fundamental matrix */
    00530 CV_EXPORTS void  cvFindFundamentalMatrix( int* points1, int* points2,
    00531     int numpoints, int method, float* matrix );
    00532
    00533
    00534 CV_EXPORTS int cvFindChessBoardCornerGuesses( const void* arr, void* thresharr,
    00535                                CvMemStorage* storage,
    00536                                CvSize pattern_size, CvPoint2D32f * corners,
    00537                                int *corner_count );
    00538
    00539 /* Calibrates camera using multiple views of calibration pattern */
    00540 CV_EXPORTS void cvCalibrateCamera( int image_count, int* _point_counts,
    00541     CvSize image_size, CvPoint2D32f* _image_points, CvPoint3D32f* _object_points,
    00542     float* _distortion_coeffs, float* _camera_matrix, float* _translation_vectors,
    00543     float* _rotation_matrices, int flags );
    00544
    00545
    00546 CV_EXPORTS void cvCalibrateCamera_64d( int image_count, int* _point_counts,
    00547     CvSize image_size, CvPoint2D64f* _image_points, CvPoint3D64f* _object_points,
    00548     double* _distortion_coeffs, double* _camera_matrix, double* _translation_vectors,
    00549     double* _rotation_matrices, int flags );
    00550
    00551
    00552 /* Find 3d position of object given intrinsic camera parameters,
    00553    3d model of the object and projection of the object into view plane */
    00554 CV_EXPORTS void cvFindExtrinsicCameraParams( int point_count,
    00555     CvSize image_size, CvPoint2D32f* _image_points,
    00556     CvPoint3D32f* _object_points, float* focal_length,
    00557     CvPoint2D32f principal_point, float* _distortion_coeffs,
    00558     float* _rotation_vector, float* _translation_vector );
    00559
    00560 /* Variant of the previous function that takes double-precision parameters */
    00561 CV_EXPORTS void cvFindExtrinsicCameraParams_64d( int point_count,
    00562     CvSize image_size, CvPoint2D64f* _image_points,
    00563     CvPoint3D64f* _object_points, double* focal_length,
    00564     CvPoint2D64f principal_point, double* _distortion_coeffs,
    00565     double* _rotation_vector, double* _translation_vector );
    00566
    00567 /* Rodrigues transform */
    00568 enum
    00569 {
    00570     CV_RODRIGUES_M2V = 0,
    00571     CV_RODRIGUES_V2M = 1
    00572 };
    00573
    00574 /* Converts rotation_matrix matrix to rotation_matrix vector or vice versa */
    00575 CV_EXPORTS void  cvRodrigues( CvMat* rotation_matrix, CvMat* rotation_vector,
    00576                               CvMat* jacobian, int conv_type );
    00577
    00578 /* Does reprojection of 3d object points to the view plane */
    00579 CV_EXPORTS void  cvProjectPoints( int point_count, CvPoint3D64f* _object_points,
    00580     double* _rotation_vector, double*  _translation_vector,
    00581     double* focal_length, CvPoint2D64f principal_point,
    00582     double* _distortion, CvPoint2D64f* _image_points,
    00583     double* _deriv_points_rotation_matrix,
    00584     double* _deriv_points_translation_vect,
    00585     double* _deriv_points_focal,
    00586     double* _deriv_points_principal_point,
    00587     double* _deriv_points_distortion_coeffs );
    00588
    00589
    00590 /* Simpler version of the previous function */
    00591 CV_EXPORTS void  cvProjectPointsSimple( int point_count, CvPoint3D64f* _object_points,
    00592     double* _rotation_matrix, double*  _translation_vector,
    00593     double* _camera_matrix, double* _distortion, CvPoint2D64f* _image_points );
    00594
    00595
    00596 #define cvMake2DPoints cvConvertPointsHomogeneous
    00597 #define cvMake3DPoints cvConvertPointsHomogeneous
    00598
    00599 #define cvWarpPerspectiveQMatrix cvGetPerspectiveTransform
    00600
    00601 #define cvConvertPointsHomogenious cvConvertPointsHomogeneous
    00602
    00603
    00604 #ifdef __cplusplus
    00605 }
    00606 #endif
    00607
    00608 #endif

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines