]> rtime.felk.cvut.cz Git - opencv.git/commitdiff
renamed all the _[A-Z] variables to avoid possible name conflicts.
authorvp153 <vp153@73c94f0f-984f-4a5f-82bc-2d8db8d8ee08>
Fri, 26 Mar 2010 00:00:24 +0000 (00:00 +0000)
committervp153 <vp153@73c94f0f-984f-4a5f-82bc-2d8db8d8ee08>
Fri, 26 Mar 2010 00:00:24 +0000 (00:00 +0000)
git-svn-id: https://code.ros.org/svn/opencv/trunk@2916 73c94f0f-984f-4a5f-82bc-2d8db8d8ee08

27 files changed:
opencv/include/opencv/cvaux.hpp
opencv/include/opencv/ml.h
opencv/samples/c/find_obj_calonder.cpp
opencv/samples/c/stereo_calib.cpp
opencv/src/cv/cvcalibration.cpp
opencv/src/cv/cvfundam.cpp
opencv/src/cv/cvgeometry.cpp
opencv/src/cv/cvhistogram.cpp
opencv/src/cv/cvimgwarp.cpp
opencv/src/cv/cvlkpyramid.cpp
opencv/src/cv/cvlsh.cpp
opencv/src/cv/cvoptflowgf.cpp
opencv/src/cv/cvshapedescr.cpp
opencv/src/cv/cvstardetector.cpp
opencv/src/cv/cvstereosgbm.cpp
opencv/src/cv/cvsurf.cpp
opencv/src/cv/cvundistort.cpp
opencv/src/cvaux/cvba.cpp
opencv/src/cvaux/cvplanardetect.cpp
opencv/src/cxcore/cxdxt.cpp
opencv/src/cxcore/cxlapack.cpp
opencv/src/cxcore/cxmatmul.cpp
opencv/tests/cv/src/acameracalibration.cpp
opencv/tests/cv/src/afundam.cpp
opencv/tests/cv/src/aundistort.cpp
opencv/tests/cv/src/bundistort.cpp
opencv/tests/cxcore/src/aarray.cpp

index af202cef975abd4b2b8b3caafb3c7b2dd9eab2ad..77aae3b8f9085270e0da70c16f26646fc27c1516 100644 (file)
@@ -909,7 +909,7 @@ public:
     void operator()(const Mat& image, Point2f pt, Mat& patch, Size patchSize, RNG& rng) const;
     void operator()(const Mat& image, const Mat& transform, Mat& patch,
                     Size patchSize, RNG& rng) const;
-    void warpWholeImage(const Mat& image, Mat& _T, Mat& buf,
+    void warpWholeImage(const Mat& image, Mat& matT, Mat& buf,
                         Mat& warped, int border, RNG& rng) const;
     void generateRandomTransform(Point2f srcCenter, Point2f dstCenter,
                                  Mat& transform, RNG& rng, bool inverse=false) const;
index 1a4140bbe28057e4fddd36e9000f4dd46f1141f2..3dc88afa6883a9ec6eee9a04a5efa7f84d129bc9 100644 (file)
@@ -349,7 +349,7 @@ struct CV_EXPORTS CvSVMParams
     CvSVMParams();
     CvSVMParams( int _svm_type, int _kernel_type,
                  double _degree, double _gamma, double _coef0,
-                 double _C, double _nu, double _p,
+                 double Cvalue, double _nu, double _p,
                  CvMat* _class_weights, CvTermCriteria _term_crit );
 
     int         svm_type;
index 156b404cd8d24a7fa31ff7ee2fe48f513539e958..8fbe06a09550f411f8b4861db5d2a83483f50532 100644 (file)
@@ -7,7 +7,6 @@
 #include <vector>
 using namespace std;
 
-#define M_PI CV_PI 
 // Number of training points (set to -1 to use all points)
 const int n_points = 30;
 
index 14989e42e6431f6d93296c6b1b633c3874aac720..a01b4ae31962eb4ec37560fcc0f769b641fc270e 100644 (file)
@@ -75,12 +75,12 @@ StereoCalib(const char* imageList, int useUncalibrated)
     CvMat _M2 = cvMat(3, 3, CV_64F, M2 );
     CvMat _D1 = cvMat(1, 5, CV_64F, D1 );
     CvMat _D2 = cvMat(1, 5, CV_64F, D2 );
-    CvMat _R = cvMat(3, 3, CV_64F, R );
-    CvMat _T = cvMat(3, 1, CV_64F, T );
-    CvMat _E = cvMat(3, 3, CV_64F, E );
-    CvMat _F = cvMat(3, 3, CV_64F, F );
+    CvMat matR = cvMat(3, 3, CV_64F, R );
+    CvMat matT = cvMat(3, 1, CV_64F, T );
+    CvMat matE = cvMat(3, 3, CV_64F, E );
+    CvMat matF = cvMat(3, 3, CV_64F, F );
     
-    CvMat _Q = cvMat(4, 4, CV_64FC1, Q);
+    CvMat matQ = cvMat(4, 4, CV_64FC1, Q);
 
     char buf[1024];
     
@@ -227,7 +227,7 @@ StereoCalib(const char* imageList, int useUncalibrated)
     cvStereoCalibrate( &_objectPoints, &_imagePoints1,
         &_imagePoints2, &_npoints,
         &_M1, &_D1, &_M2, &_D2,
-        imageSize, &_R, &_T, &_E, &_F,
+        imageSize, &matR, &matT, &matE, &matF,
         cvTermCriteria(CV_TERMCRIT_ITER+
         CV_TERMCRIT_EPS, 100, 1e-5),
         CV_CALIB_FIX_ASPECT_RATIO +
@@ -255,8 +255,8 @@ StereoCalib(const char* imageList, int useUncalibrated)
         &_M1, &_D1, 0, &_M1 );
     cvUndistortPoints( &_imagePoints2, &_imagePoints2,
         &_M2, &_D2, 0, &_M2 );
-    cvComputeCorrespondEpilines( &_imagePoints1, 1, &_F, &_L1 );
-    cvComputeCorrespondEpilines( &_imagePoints2, 2, &_F, &_L2 );
+    cvComputeCorrespondEpilines( &_imagePoints1, 1, &matF, &_L1 );
+    cvComputeCorrespondEpilines( &_imagePoints2, 2, &matF, &_L2 );
     double avgErr = 0;
     for( i = 0; i < N; i++ )
     {
@@ -303,19 +303,19 @@ StereoCalib(const char* imageList, int useUncalibrated)
             CvMat _P2 = cvMat(3, 4, CV_64F, P2);
 
             cvStereoRectify( &_M1, &_M2, &_D1, &_D2, imageSize,
-                &_R, &_T,
-                &_R1, &_R2, &_P1, &_P2, &_Q,
+                &matR, &matT,
+                &_R1, &_R2, &_P1, &_P2, &matQ,
                 CV_CALIB_ZERO_DISPARITY,
                 1, imageSize, &roi1, &roi2);
             
             CvFileStorage* file = cvOpenFileStorage("extrinsics.yml", NULL, CV_STORAGE_WRITE);
-            cvWrite(file, "R", &_R);
-            cvWrite(file, "T", &_T);    
+            cvWrite(file, "R", &matR);
+            cvWrite(file, "T", &matT);    
             cvWrite(file, "R1", &_R1);
             cvWrite(file, "R2", &_R2);
             cvWrite(file, "P1", &_P1);    
             cvWrite(file, "P2", &_P2);    
-            cvWrite(file, "Q", &_Q);
+            cvWrite(file, "Q", &matQ);
             cvReleaseFileStorage(&file);
                         
             isVerticalStereo = fabs(P2[1][3]) > fabs(P2[0][3]);
@@ -340,9 +340,9 @@ StereoCalib(const char* imageList, int useUncalibrated)
     //Just to show you could have independently used F
             if( useUncalibrated == 2 )
                 cvFindFundamentalMat( &_imagePoints1,
-                &_imagePoints2, &_F);
+                &_imagePoints2, &matF);
             cvStereoRectifyUncalibrated( &_imagePoints1,
-                &_imagePoints2, &_F,
+                &_imagePoints2, &matF,
                 imageSize,
                 &_H1, &_H2, 3);
             cvInvert(&_M1, &_iM);
index a00a594ff9a395924b9f9d93dd33957eb86d63e7..39622d686bd799a4674933c38b0c1fc2a2e5946a 100644 (file)
@@ -121,11 +121,11 @@ void CvLevMarq::init( int nparams, int nerrs, CvTermCriteria criteria0, bool _co
     completeSymmFlag = _completeSymmFlag;
 }
 
-bool CvLevMarq::update( const CvMat*& _param, CvMat*& _J, CvMat*& _err )
+bool CvLevMarq::update( const CvMat*& _param, CvMat*& matJ, CvMat*& _err )
 {
     double change;
 
-    _J = _err = 0;
+    matJ = _err = 0;
 
     assert( !err.empty() );
     if( state == DONE )
@@ -139,7 +139,7 @@ bool CvLevMarq::update( const CvMat*& _param, CvMat*& _J, CvMat*& _err )
         _param = param;
         cvZero( J );
         cvZero( err );
-        _J = J;
+        matJ = J;
         _err = err;
         state = CALC_J;
         return true;
@@ -185,7 +185,7 @@ bool CvLevMarq::update( const CvMat*& _param, CvMat*& _J, CvMat*& _err )
     prevErrNorm = errNorm;
     _param = param;
     cvZero(J);
-    _J = J;
+    matJ = J;
     _err = err;
     state = CALC_J;
     return true;
@@ -486,7 +486,7 @@ CV_IMPL int cvRodrigues2( const CvMat* src, CvMat* dst, CvMat* jacobian )
     int depth, elem_size;
     int i, k;
     double J[27];
-    CvMat _J = cvMat( 3, 9, CV_64F, J );
+    CvMat matJ = cvMat( 3, 9, CV_64F, J );
 
     if( !CV_IS_MAT(src) )
         CV_Error( !src ? CV_StsNullPtr : CV_StsBadArg, "Input argument is not a valid matrix" );
@@ -567,14 +567,14 @@ CV_IMPL int cvRodrigues2( const CvMat* src, CvMat* dst, CvMat* jacobian )
             double rrt[] = { rx*rx, rx*ry, rx*rz, rx*ry, ry*ry, ry*rz, rx*rz, ry*rz, rz*rz };
             double _r_x_[] = { 0, -rz, ry, rz, 0, -rx, -ry, rx, 0 };
             double R[9];
-            CvMat _R = cvMat( 3, 3, CV_64F, R );
+            CvMat matR = cvMat( 3, 3, CV_64F, R );
 
             // R = cos(theta)*I + (1 - cos(theta))*r*rT + sin(theta)*[r_x]
             // where [r_x] is [0 -rz ry; rz 0 -rx; -ry rx 0]
             for( k = 0; k < 9; k++ )
                 R[k] = c*I[k] + c1*rrt[k] + s*_r_x_[k];
 
-            cvConvert( &_R, dst );
+            cvConvert( &matR, dst );
 
             if( jacobian )
             {
@@ -599,10 +599,10 @@ CV_IMPL int cvRodrigues2( const CvMat* src, CvMat* dst, CvMat* jacobian )
     else if( src->cols == 3 && src->rows == 3 )
     {
         double R[9], U[9], V[9], W[3], rx, ry, rz;
-        CvMat _R = cvMat( 3, 3, CV_64F, R );
-        CvMat _U = cvMat( 3, 3, CV_64F, U );
-        CvMat _V = cvMat( 3, 3, CV_64F, V );
-        CvMat _W = cvMat( 3, 1, CV_64F, W );
+        CvMat matR = cvMat( 3, 3, CV_64F, R );
+        CvMat matU = cvMat( 3, 3, CV_64F, U );
+        CvMat matV = cvMat( 3, 3, CV_64F, V );
+        CvMat matW = cvMat( 3, 1, CV_64F, W );
         double theta, s, c;
         int step = dst->rows > 1 ? dst->step / elem_size : 1;
 
@@ -610,8 +610,8 @@ CV_IMPL int cvRodrigues2( const CvMat* src, CvMat* dst, CvMat* jacobian )
             (dst->rows != 3 || dst->cols != 1 || CV_MAT_CN(dst->type) != 1))
             CV_Error( CV_StsBadSize, "Output matrix must be 1x3 or 3x1" );
 
-        cvConvert( src, &_R );
-        if( !cvCheckArr( &_R, CV_CHECK_RANGE+CV_CHECK_QUIET, -100, 100 ) )
+        cvConvert( src, &matR );
+        if( !cvCheckArr( &matR, CV_CHECK_RANGE+CV_CHECK_QUIET, -100, 100 ) )
         {
             cvZero(dst);
             if( jacobian )
@@ -619,8 +619,8 @@ CV_IMPL int cvRodrigues2( const CvMat* src, CvMat* dst, CvMat* jacobian )
             return 0;
         }
 
-        cvSVD( &_R, &_W, &_U, &_V, CV_SVD_MODIFY_A + CV_SVD_U_T + CV_SVD_V_T );
-        cvGEMM( &_U, &_V, 1, 0, 0, &_R, CV_GEMM_A_T );
+        cvSVD( &matR, &matW, &matU, &matV, CV_SVD_MODIFY_A + CV_SVD_U_T + CV_SVD_V_T );
+        cvGEMM( &matU, &matV, 1, 0, 0, &matR, CV_GEMM_A_T );
 
         rx = R[7] - R[5];
         ry = R[2] - R[6];
@@ -706,9 +706,9 @@ CV_IMPL int cvRodrigues2( const CvMat* src, CvMat* dst, CvMat* jacobian )
                 CvMat _t0 = cvMat( 3, 5, CV_64FC1, t0 );
 
                 cvMatMul( &_domegadvar2, &_dvar2dvar, &_t0 );
-                cvMatMul( &_t0, &_dvardR, &_J );
+                cvMatMul( &_t0, &_dvardR, &matJ );
 
-                // transpose every row of _J (treat the rows as 3x3 matrices)
+                // transpose every row of matJ (treat the rows as 3x3 matrices)
                 CV_SWAP(J[1], J[3], t); CV_SWAP(J[2], J[6], t); CV_SWAP(J[5], J[7], t);
                 CV_SWAP(J[10], J[12], t); CV_SWAP(J[11], J[15], t); CV_SWAP(J[14], J[16], t);
                 CV_SWAP(J[19], J[21], t); CV_SWAP(J[20], J[24], t); CV_SWAP(J[23], J[25], t);
@@ -736,20 +736,20 @@ CV_IMPL int cvRodrigues2( const CvMat* src, CvMat* dst, CvMat* jacobian )
     {
         if( depth == CV_32F )
         {
-            if( jacobian->rows == _J.rows )
-                cvConvert( &_J, jacobian );
+            if( jacobian->rows == matJ.rows )
+                cvConvert( &matJ, jacobian );
             else
             {
                 float Jf[3*9];
-                CvMat _Jf = cvMat( _J.rows, _J.cols, CV_32FC1, Jf );
-                cvConvert( &_J, &_Jf );
+                CvMat _Jf = cvMat( matJ.rows, matJ.cols, CV_32FC1, Jf );
+                cvConvert( &matJ, &_Jf );
                 cvTranspose( &_Jf, jacobian );
             }
         }
-        else if( jacobian->rows == _J.rows )
-            cvCopy( &_J, jacobian );
+        else if( jacobian->rows == matJ.rows )
+            cvCopy( &matJ, jacobian );
         else
-            cvTranspose( &_J, jacobian );
+            cvTranspose( &matJ, jacobian );
     }
 
     return 1;
@@ -766,7 +766,7 @@ CV_IMPL void cvProjectPoints2( const CvMat* objectPoints,
                   CvMat* dpdc, CvMat* dpdk,
                   double aspectRatio )
 {
-    Ptr<CvMat> _M, _m;
+    Ptr<CvMat> matM, _m;
     Ptr<CvMat> _dpdr, _dpdt, _dpdc, _dpdf, _dpdk;
 
     int i, j, count;
@@ -775,7 +775,7 @@ CV_IMPL void cvProjectPoints2( const CvMat* objectPoints,
     CvPoint2D64f* m;
     double r[3], R[9], dRdr[27], t[3], a[9], k[5] = {0,0,0,0,0}, fx, fy, cx, cy;
     CvMat _r, _t, _a = cvMat( 3, 3, CV_64F, a ), _k;
-    CvMat _R = cvMat( 3, 3, CV_64F, R ), _dRdr = cvMat( 3, 9, CV_64F, dRdr );
+    CvMat matR = cvMat( 3, 3, CV_64F, R ), _dRdr = cvMat( 3, 9, CV_64F, dRdr );
     double *dpdr_p = 0, *dpdt_p = 0, *dpdk_p = 0, *dpdf_p = 0, *dpdc_p = 0;
     int dpdr_step = 0, dpdt_step = 0, dpdk_step = 0, dpdf_step = 0, dpdc_step = 0;
     bool fixedAspectRatio = aspectRatio > FLT_EPSILON;
@@ -791,12 +791,12 @@ CV_IMPL void cvProjectPoints2( const CvMat* objectPoints,
         ((objectPoints->rows == 1 && CV_MAT_CN(objectPoints->type) == 3) ||
         (objectPoints->rows == count && CV_MAT_CN(objectPoints->type)*objectPoints->cols == 3)))
     {
-        _M = cvCloneMat(objectPoints);
+        matM = cvCloneMat(objectPoints);
     }
     else
     {
-        _M = cvCreateMat( 1, count, CV_64FC3 );
-        cvConvertPointsHomogeneous( objectPoints, _M );
+        matM = cvCreateMat( 1, count, CV_64FC3 );
+        cvConvertPointsHomogeneous( objectPoints, matM );
     }
 
     if( CV_IS_CONT_MAT(imagePoints->type) && CV_MAT_DEPTH(imagePoints->type) == CV_64F &&
@@ -808,7 +808,7 @@ CV_IMPL void cvProjectPoints2( const CvMat* objectPoints,
     else
         _m = cvCreateMat( 1, count, CV_64FC2 );
 
-    M = (CvPoint3D64f*)_M->data.db;
+    M = (CvPoint3D64f*)matM->data.db;
     m = (CvPoint2D64f*)_m->data.db;
 
     if( (CV_MAT_DEPTH(r_vec->type) != CV_64F && CV_MAT_DEPTH(r_vec->type) != CV_32F) ||
@@ -822,14 +822,14 @@ CV_IMPL void cvProjectPoints2( const CvMat* objectPoints,
     {
         _r = cvMat( 3, 1, CV_64FC1, r );
         cvRodrigues2( r_vec, &_r );
-        cvRodrigues2( &_r, &_R, &_dRdr );
-        cvCopy( r_vec, &_R );
+        cvRodrigues2( &_r, &matR, &_dRdr );
+        cvCopy( r_vec, &matR );
     }
     else
     {
         _r = cvMat( r_vec->rows, r_vec->cols, CV_MAKETYPE(CV_64F,CV_MAT_CN(r_vec->type)), r );
         cvConvert( r_vec, &_r );
-        cvRodrigues2( &_r, &_R, &_dRdr );
+        cvRodrigues2( &_r, &matR, &_dRdr );
     }
 
     if( (CV_MAT_DEPTH(t_vec->type) != CV_64F && CV_MAT_DEPTH(t_vec->type) != CV_32F) ||
@@ -1115,23 +1115,23 @@ CV_IMPL void cvFindExtrinsicCameraParams2( const CvMat* objectPoints,
                   int useExtrinsicGuess )
 {
     const int max_iter = 20;
-    Ptr<CvMat> _M, _Mxy, _m, _mn, _L, _J;
+    Ptr<CvMat> matM, _Mxy, _m, _mn, matL, matJ;
 
     int i, count;
     double a[9], ar[9]={1,0,0,0,1,0,0,0,1}, R[9];
     double MM[9], U[9], V[9], W[3];
     CvScalar Mc;
     double param[6];
-    CvMat _A = cvMat( 3, 3, CV_64F, a );
+    CvMat matA = cvMat( 3, 3, CV_64F, a );
     CvMat _Ar = cvMat( 3, 3, CV_64F, ar );
-    CvMat _R = cvMat( 3, 3, CV_64F, R );
+    CvMat matR = cvMat( 3, 3, CV_64F, R );
     CvMat _r = cvMat( 3, 1, CV_64F, param );
     CvMat _t = cvMat( 3, 1, CV_64F, param + 3 );
     CvMat _Mc = cvMat( 1, 3, CV_64F, Mc.val );
     CvMat _MM = cvMat( 3, 3, CV_64F, MM );
-    CvMat _U = cvMat( 3, 3, CV_64F, U );
-    CvMat _V = cvMat( 3, 3, CV_64F, V );
-    CvMat _W = cvMat( 3, 1, CV_64F, W );
+    CvMat matU = cvMat( 3, 3, CV_64F, U );
+    CvMat matV = cvMat( 3, 3, CV_64F, V );
+    CvMat matW = cvMat( 3, 1, CV_64F, W );
     CvMat _param = cvMat( 6, 1, CV_64F, param );
     CvMat _dpdr, _dpdt;
 
@@ -1139,12 +1139,12 @@ CV_IMPL void cvFindExtrinsicCameraParams2( const CvMat* objectPoints,
         CV_IS_MAT(A) && CV_IS_MAT(rvec) && CV_IS_MAT(tvec) );
 
     count = MAX(objectPoints->cols, objectPoints->rows);
-    _M = cvCreateMat( 1, count, CV_64FC3 );
+    matM = cvCreateMat( 1, count, CV_64FC3 );
     _m = cvCreateMat( 1, count, CV_64FC2 );
 
-    cvConvertPointsHomogeneous( objectPoints, _M );
+    cvConvertPointsHomogeneous( objectPoints, matM );
     cvConvertPointsHomogeneous( imagePoints, _m );
-    cvConvert( A, &_A );
+    cvConvert( A, &matA );
 
     CV_Assert( (CV_MAT_DEPTH(rvec->type) == CV_64F || CV_MAT_DEPTH(rvec->type) == CV_32F) &&
         (rvec->rows == 1 || rvec->cols == 1) && rvec->rows*rvec->cols*CV_MAT_CN(rvec->type) == 3 );
@@ -1157,7 +1157,7 @@ CV_IMPL void cvFindExtrinsicCameraParams2( const CvMat* objectPoints,
 
     // normalize image points
     // (unapply the intrinsic matrix transformation and distortion)
-    cvUndistortPoints( _m, _mn, &_A, distCoeffs, 0, &_Ar );
+    cvUndistortPoints( _m, _mn, &matA, distCoeffs, 0, &_Ar );
 
     if( useExtrinsicGuess )
     {
@@ -1170,19 +1170,19 @@ CV_IMPL void cvFindExtrinsicCameraParams2( const CvMat* objectPoints,
     }
     else
     {
-        Mc = cvAvg(_M);
-        cvReshape( _M, _M, 1, count );
-        cvMulTransposed( _M, &_MM, 1, &_Mc );
-        cvSVD( &_MM, &_W, 0, &_V, CV_SVD_MODIFY_A + CV_SVD_V_T );
+        Mc = cvAvg(matM);
+        cvReshape( matM, matM, 1, count );
+        cvMulTransposed( matM, &_MM, 1, &_Mc );
+        cvSVD( &_MM, &matW, 0, &matV, CV_SVD_MODIFY_A + CV_SVD_V_T );
 
         // initialize extrinsic parameters
         if( W[2]/W[1] < 1e-3 || count < 4 )
         {
             // a planar structure case (all M's lie in the same plane)
             double tt[3], h[9], h1_norm, h2_norm;
-            CvMat* R_transform = &_V;
+            CvMat* R_transform = &matV;
             CvMat T_transform = cvMat( 3, 1, CV_64F, tt );
-            CvMat _H = cvMat( 3, 3, CV_64F, h );
+            CvMat matH = cvMat( 3, 3, CV_64F, h );
             CvMat _h1, _h2, _h3;
 
             if( V[2]*V[2] + V[5]*V[5] < 1e-10 )
@@ -1197,16 +1197,16 @@ CV_IMPL void cvFindExtrinsicCameraParams2( const CvMat* objectPoints,
             {
                 const double* Rp = R_transform->data.db;
                 const double* Tp = T_transform.data.db;
-                const double* src = _M->data.db + i*3;
+                const double* src = matM->data.db + i*3;
                 double* dst = _Mxy->data.db + i*2;
 
                 dst[0] = Rp[0]*src[0] + Rp[1]*src[1] + Rp[2]*src[2] + Tp[0];
                 dst[1] = Rp[3]*src[0] + Rp[4]*src[1] + Rp[5]*src[2] + Tp[1];
             }
 
-            cvFindHomography( _Mxy, _mn, &_H );
+            cvFindHomography( _Mxy, _mn, &matH );
 
-            cvGetCol( &_H, &_h1, 0 );
+            cvGetCol( &matH, &_h1, 0 );
             _h2 = _h1; _h2.data.db++;
             _h3 = _h2; _h3.data.db++;
             h1_norm = sqrt(h[0]*h[0] + h[3]*h[3] + h[6]*h[6]);
@@ -1217,11 +1217,11 @@ CV_IMPL void cvFindExtrinsicCameraParams2( const CvMat* objectPoints,
             cvScale( &_h3, &_t, 2./(h1_norm + h2_norm));
             cvCrossProduct( &_h1, &_h2, &_h3 );
 
-            cvRodrigues2( &_H, &_r );
-            cvRodrigues2( &_r, &_H );
-            cvMatMulAdd( &_H, &T_transform, &_t, &_t );
-            cvMatMul( &_H, R_transform, &_R );
-            cvRodrigues2( &_R, &_r );
+            cvRodrigues2( &matH, &_r );
+            cvRodrigues2( &_r, &matH );
+            cvMatMulAdd( &matH, &T_transform, &_t, &_t );
+            cvMatMul( &matH, R_transform, &matR );
+            cvRodrigues2( &matR, &_r );
         }
         else
         {
@@ -1232,11 +1232,11 @@ CV_IMPL void cvFindExtrinsicCameraParams2( const CvMat* objectPoints,
             CvMat _LW = cvMat( 12, 1, CV_64F, LW );
             CvMat _LV = cvMat( 12, 12, CV_64F, LV );
             CvMat _RRt, _RR, _tt;
-            CvPoint3D64f* M = (CvPoint3D64f*)_M->data.db;
+            CvPoint3D64f* M = (CvPoint3D64f*)matM->data.db;
             CvPoint2D64f* mn = (CvPoint2D64f*)_mn->data.db;
 
-            _L = cvCreateMat( 2*count, 12, CV_64F );
-            L = _L->data.db;
+            matL = cvCreateMat( 2*count, 12, CV_64F );
+            L = matL->data.db;
 
             for( i = 0; i < count; i++, L += 24 )
             {
@@ -1257,7 +1257,7 @@ CV_IMPL void cvFindExtrinsicCameraParams2( const CvMat* objectPoints,
                 L[23] = y;
             }
 
-            cvMulTransposed( _L, &_LL, 1 );
+            cvMulTransposed( matL, &_LL, 1 );
             cvSVD( &_LL, &_LW, 0, &_LV, CV_SVD_MODIFY_A + CV_SVD_V_T );
             _RRt = cvMat( 3, 4, CV_64F, LV + 11*12 );
             cvGetCols( &_RRt, &_RR, 0, 3 );
@@ -1265,14 +1265,14 @@ CV_IMPL void cvFindExtrinsicCameraParams2( const CvMat* objectPoints,
             if( cvDet(&_RR) < 0 )
                 cvScale( &_RRt, &_RRt, -1 );
             sc = cvNorm(&_RR);
-            cvSVD( &_RR, &_W, &_U, &_V, CV_SVD_MODIFY_A + CV_SVD_U_T + CV_SVD_V_T );
-            cvGEMM( &_U, &_V, 1, 0, 0, &_R, CV_GEMM_A_T );
-            cvScale( &_tt, &_t, cvNorm(&_R)/sc );
-            cvRodrigues2( &_R, &_r );
+            cvSVD( &_RR, &matW, &matU, &matV, CV_SVD_MODIFY_A + CV_SVD_U_T + CV_SVD_V_T );
+            cvGEMM( &matU, &matV, 1, 0, 0, &matR, CV_GEMM_A_T );
+            cvScale( &_tt, &_t, cvNorm(&matR)/sc );
+            cvRodrigues2( &matR, &_r );
         }
     }
 
-    cvReshape( _M, _M, 3, 1 );
+    cvReshape( matM, matM, 3, 1 );
     cvReshape( _mn, _mn, 2, 1 );
 
     // refine extrinsic parameters using iterative algorithm
@@ -1281,23 +1281,23 @@ CV_IMPL void cvFindExtrinsicCameraParams2( const CvMat* objectPoints,
 
     for(;;)
     {
-        CvMat *_J = 0, *_err = 0;
+        CvMat *matJ = 0, *_err = 0;
         const CvMat *__param = 0;
-        bool proceed = solver.update( __param, _J, _err );
+        bool proceed = solver.update( __param, matJ, _err );
         cvCopy( __param, &_param );
         if( !proceed || !_err )
             break;
         cvReshape( _err, _err, 2, 1 );
-        if( _J )
+        if( matJ )
         {
-            cvGetCols( _J, &_dpdr, 0, 3 );
-            cvGetCols( _J, &_dpdt, 3, 6 );
-            cvProjectPoints2( _M, &_r, &_t, &_A, distCoeffs,
+            cvGetCols( matJ, &_dpdr, 0, 3 );
+            cvGetCols( matJ, &_dpdt, 3, 6 );
+            cvProjectPoints2( matM, &_r, &_t, &matA, distCoeffs,
                               _err, &_dpdr, &_dpdt, 0, 0, 0 );
         }
         else
         {
-            cvProjectPoints2( _M, &_r, &_t, &_A, distCoeffs,
+            cvProjectPoints2( matM, &_r, &_t, &matA, distCoeffs,
                               _err, 0, 0, 0, 0, 0 );
         }
         cvSub(_err, _m, _err);
@@ -1320,13 +1320,13 @@ CV_IMPL void cvInitIntrinsicParams2D( const CvMat* objectPoints,
                          CvSize imageSize, CvMat* cameraMatrix,
                          double aspectRatio )
 {
-    Ptr<CvMat> _A, _b, _allH, _allK;
+    Ptr<CvMat> matA, _b, _allH, _allK;
 
     int i, j, pos, nimages, total, ni = 0;
     double a[9] = { 0, 0, 0, 0, 0, 0, 0, 0, 1 };
     double H[9], f[2];
     CvMat _a = cvMat( 3, 3, CV_64F, a );
-    CvMat _H = cvMat( 3, 3, CV_64F, H );
+    CvMat matH = cvMat( 3, 3, CV_64F, H );
     CvMat _f = cvMat( 2, 1, CV_64F, f );
 
     assert( CV_MAT_TYPE(npoints->type) == CV_32SC1 &&
@@ -1342,7 +1342,7 @@ CV_IMPL void cvInitIntrinsicParams2D( const CvMat* objectPoints,
     if( objectPoints->rows != 1 || imagePoints->rows != 1 )
         CV_Error( CV_StsBadSize, "object points and image points must be a single-row matrices" );
 
-    _A = cvCreateMat( 2*nimages, 2, CV_64F );
+    matA = cvCreateMat( 2*nimages, 2, CV_64F );
     _b = cvCreateMat( 2*nimages, 1, CV_64F );
     a[2] = (imageSize.width - 1)*0.5;
     a[5] = (imageSize.height - 1)*0.5;
@@ -1353,16 +1353,16 @@ CV_IMPL void cvInitIntrinsicParams2D( const CvMat* objectPoints,
     // extract vanishing points in order to obtain initial value for the focal length
     for( i = 0, pos = 0; i < nimages; i++, pos += ni )
     {
-        double* Ap = _A->data.db + i*4;
+        double* Ap = matA->data.db + i*4;
         double* bp = _b->data.db + i*2;
         ni = npoints->data.i[i];
         double h[3], v[3], d1[3], d2[3];
         double n[4] = {0,0,0,0};
-        CvMat _m, _M;
-        cvGetCols( objectPoints, &_M, pos, pos + ni );
+        CvMat _m, matM;
+        cvGetCols( objectPoints, &matM, pos, pos + ni );
         cvGetCols( imagePoints, &_m, pos, pos + ni );
 
-        cvFindHomography( &_M, &_m, &_H );
+        cvFindHomography( &matM, &_m, &matH );
         memcpy( _allH->data.db + i*9, H, sizeof(H) );
 
         H[0] -= H[6]*a[2]; H[1] -= H[7]*a[2]; H[2] -= H[8]*a[2];
@@ -1392,7 +1392,7 @@ CV_IMPL void cvInitIntrinsicParams2D( const CvMat* objectPoints,
         bp[0] = -h[2]*v[2]; bp[1] = -d1[2]*d2[2];
     }
 
-    cvSolve( _A, _b, &_f, CV_NORMAL + CV_SVD );
+    cvSolve( matA, _b, &_f, CV_NORMAL + CV_SVD );
     a[0] = sqrt(fabs(1./f[0]));
     a[4] = sqrt(fabs(1./f[1]));
     if( aspectRatio != 0 )
@@ -1414,12 +1414,12 @@ CV_IMPL double cvCalibrateCamera2( const CvMat* objectPoints,
                     CvMat* rvecs, CvMat* tvecs, int flags )
 {
     const int NINTRINSIC = 9;
-    Ptr<CvMat> _M, _m, _Ji, _Je, _err;
+    Ptr<CvMat> matM, _m, _Ji, _Je, _err;
     CvLevMarq solver;
     double reprojErr = 0;
 
     double A[9], k[5] = {0,0,0,0,0};
-    CvMat _A = cvMat(3, 3, CV_64F, A), _k;
+    CvMat matA = cvMat(3, 3, CV_64F, A), _k;
     int i, nimages, maxPoints = 0, ni = 0, pos, total = 0, nparams, npstep, cn;
     double aspectRatio = 0.;
 
@@ -1488,10 +1488,10 @@ CV_IMPL double cvCalibrateCamera2( const CvMat* objectPoints,
         total += ni;
     }
 
-    _M = cvCreateMat( 1, total, CV_64FC3 );
+    matM = cvCreateMat( 1, total, CV_64FC3 );
     _m = cvCreateMat( 1, total, CV_64FC2 );
 
-    cvConvertPointsHomogeneous( objectPoints, _M );
+    cvConvertPointsHomogeneous( objectPoints, matM );
     cvConvertPointsHomogeneous( imagePoints, _m );
 
     nparams = NINTRINSIC + nimages*6;
@@ -1507,7 +1507,7 @@ CV_IMPL double cvCalibrateCamera2( const CvMat* objectPoints,
     // 1. initialize intrinsic parameters & LM solver
     if( flags & CV_CALIB_USE_INTRINSIC_GUESS )
     {
-        cvConvert( cameraMatrix, &_A );
+        cvConvert( cameraMatrix, &matA );
         if( A[0] <= 0 || A[4] <= 0 )
             CV_Error( CV_StsOutOfRange, "Focal length (fx and fy) must be positive" );
         if( A[2] < 0 || A[2] >= imageSize.width ||
@@ -1529,12 +1529,12 @@ CV_IMPL double cvCalibrateCamera2( const CvMat* objectPoints,
     else
     {
         CvScalar mean, sdv;
-        cvAvgSdv( _M, &mean, &sdv );
+        cvAvgSdv( matM, &mean, &sdv );
         if( fabs(mean.val[2]) > 1e-5 || fabs(sdv.val[2]) > 1e-5 )
             CV_Error( CV_StsBadArg,
             "For non-planar calibration rigs the initial intrinsic matrix must be specified" );
         for( i = 0; i < total; i++ )
-            ((CvPoint3D64f*)_M->data.db)[i].z = 0.;
+            ((CvPoint3D64f*)matM->data.db)[i].z = 0.;
 
         if( flags & CV_CALIB_FIX_ASPECT_RATIO )
         {
@@ -1544,7 +1544,7 @@ CV_IMPL double cvCalibrateCamera2( const CvMat* objectPoints,
                 CV_Error( CV_StsOutOfRange,
                     "The specified aspect ratio (=A[0][0]/A[1][1]) is incorrect" );
         }
-        cvInitIntrinsicParams2D( _M, _m, npoints, imageSize, &_A, aspectRatio );
+        cvInitIntrinsicParams2D( matM, _m, npoints, imageSize, &matA, aspectRatio );
     }
 
     solver.init( nparams, 0, cvTermCriteria(CV_TERMCRIT_ITER+CV_TERMCRIT_EPS,30,DBL_EPSILON) );
@@ -1583,10 +1583,10 @@ CV_IMPL double cvCalibrateCamera2( const CvMat* objectPoints,
         cvGetRows( solver.param, &_ri, NINTRINSIC + i*6, NINTRINSIC + i*6 + 3 );
         cvGetRows( solver.param, &_ti, NINTRINSIC + i*6 + 3, NINTRINSIC + i*6 + 6 );
 
-        cvGetCols( _M, &_Mi, pos, pos + ni );
+        cvGetCols( matM, &_Mi, pos, pos + ni );
         cvGetCols( _m, &_mi, pos, pos + ni );
 
-        cvFindExtrinsicCameraParams2( &_Mi, &_mi, &_A, &_k, &_ri, &_ti );
+        cvFindExtrinsicCameraParams2( &_Mi, &_mi, &matA, &_k, &_ri, &_ti );
     }
 
     // 3. run the optimization
@@ -1623,7 +1623,7 @@ CV_IMPL double cvCalibrateCamera2( const CvMat* objectPoints,
             cvGetRows( solver.param, &_ri, NINTRINSIC + i*6, NINTRINSIC + i*6 + 3 );
             cvGetRows( solver.param, &_ti, NINTRINSIC + i*6 + 3, NINTRINSIC + i*6 + 6 );
 
-            cvGetCols( _M, &_Mi, pos, pos + ni );
+            cvGetCols( matM, &_Mi, pos, pos + ni );
             cvGetCols( _m, &_mi, pos, pos + ni );
 
             _Je->rows = _Ji->rows = _err->rows = ni*2;
@@ -1636,13 +1636,13 @@ CV_IMPL double cvCalibrateCamera2( const CvMat* objectPoints,
 
             if( _JtJ || _JtErr )
             {
-                cvProjectPoints2( &_Mi, &_ri, &_ti, &_A, &_k, &_mp, &_dpdr, &_dpdt,
+                cvProjectPoints2( &_Mi, &_ri, &_ti, &matA, &_k, &_mp, &_dpdr, &_dpdt,
                                   (flags & CV_CALIB_FIX_FOCAL_LENGTH) ? 0 : &_dpdf,
                                   (flags & CV_CALIB_FIX_PRINCIPAL_POINT) ? 0 : &_dpdc, &_dpdk,
                                   (flags & CV_CALIB_FIX_ASPECT_RATIO) ? aspectRatio : 0);
             }
             else
-                cvProjectPoints2( &_Mi, &_ri, &_ti, &_A, &_k, &_mp );
+                cvProjectPoints2( &_Mi, &_ri, &_ti, &matA, &_k, &_mp );
 
             cvSub( &_mp, &_mi, &_mp );
 
@@ -1672,7 +1672,7 @@ CV_IMPL double cvCalibrateCamera2( const CvMat* objectPoints,
     }
 
     // 4. store the results
-    cvConvert( &_A, cameraMatrix );
+    cvConvert( &matA, cameraMatrix );
     cvConvert( &_k, distCoeffs );
 
     for( i = 0; i < nimages; i++ )
@@ -1685,8 +1685,8 @@ CV_IMPL double cvCalibrateCamera2( const CvMat* objectPoints,
             {
                 dst = cvMat( 3, 3, CV_MAT_DEPTH(rvecs->type),
                     rvecs->data.ptr + rvecs->step*i );
-                cvRodrigues2( &src, &_A );
-                cvConvert( &_A, &dst );
+                cvRodrigues2( &src, &matA );
+                cvConvert( &matA, &dst );
             }
             else
             {
@@ -1781,8 +1781,8 @@ double cvStereoCalibrate( const CvMat* _objectPoints, const CvMat* _imagePoints1
                         const CvMat* _imagePoints2, const CvMat* _npoints,
                         CvMat* _cameraMatrix1, CvMat* _distCoeffs1,
                         CvMat* _cameraMatrix2, CvMat* _distCoeffs2,
-                        CvSize imageSize, CvMat* _R, CvMat* _T,
-                        CvMat* _E, CvMat* _F,
+                        CvSize imageSize, CvMat* matR, CvMat* matT,
+                        CvMat* matE, CvMat* matF,
                         CvTermCriteria termCrit,
                         int flags )
 {
@@ -1801,7 +1801,7 @@ double cvStereoCalibrate( const CvMat* _objectPoints, const CvMat* _imagePoints1
 
     CV_Assert( CV_IS_MAT(_imagePoints1) && CV_IS_MAT(_imagePoints2) &&
                CV_IS_MAT(_objectPoints) && CV_IS_MAT(_npoints) &&
-               CV_IS_MAT(_R) && CV_IS_MAT(_T) );
+               CV_IS_MAT(matR) && CV_IS_MAT(matT) );
 
     CV_Assert( CV_ARE_TYPES_EQ(_imagePoints1, _imagePoints2) &&
                CV_ARE_DEPTHS_EQ(_imagePoints1, _objectPoints) );
@@ -2158,11 +2158,11 @@ double cvStereoCalibrate( const CvMat* _objectPoints, const CvMat* _imagePoints1
     }
 
     cvRodrigues2( &om_LR, &R_LR );
-    if( _R->rows == 1 || _R->cols == 1 )
-        cvConvert( &om_LR, _R );
+    if( matR->rows == 1 || matR->cols == 1 )
+        cvConvert( &om_LR, matR );
     else
-        cvConvert( &R_LR, _R );
-    cvConvert( &T_LR, _T );
+        cvConvert( &R_LR, matR );
+    cvConvert( &T_LR, matT );
 
     if( recomputeIntrinsics )
     {
@@ -2178,7 +2178,7 @@ double cvStereoCalibrate( const CvMat* _objectPoints, const CvMat* _imagePoints1
         }
     }
 
-    if( _E || _F )
+    if( matE || matF )
     {
         double* t = T_LR.data.db;
         double tx[] =
@@ -2192,9 +2192,9 @@ double cvStereoCalibrate( const CvMat* _objectPoints, const CvMat* _imagePoints1
         CvMat E = cvMat(3, 3, CV_64F, e);
         CvMat F = cvMat(3, 3, CV_64F, f);
         cvMatMul( &Tx, &R_LR, &E );
-        if( _E )
-            cvConvert( &E, _E );
-        if( _F )
+        if( matE )
+            cvConvert( &E, matE );
+        if( matF )
         {
             double ik[9];
             CvMat iK = cvMat(3, 3, CV_64F, ik);
@@ -2202,7 +2202,7 @@ double cvStereoCalibrate( const CvMat* _objectPoints, const CvMat* _imagePoints1
             cvGEMM( &iK, &E, 1, 0, 0, &E, CV_GEMM_A_T );
             cvInvert(&K[0], &iK);
             cvMatMul(&E, &iK, &F);
-            cvConvertScale( &F, _F, fabs(f[8]) > 0 ? 1./f[8] : 1 );
+            cvConvertScale( &F, matF, fabs(f[8]) > 0 ? 1./f[8] : 1 );
         }
     }
     
@@ -2256,9 +2256,9 @@ icvGetRectangles( const CvMat* cameraMatrix, const CvMat* distCoeffs,
 
 void cvStereoRectify( const CvMat* _cameraMatrix1, const CvMat* _cameraMatrix2,
                       const CvMat* _distCoeffs1, const CvMat* _distCoeffs2,
-                      CvSize imageSize, const CvMat* _R, const CvMat* _T,
+                      CvSize imageSize, const CvMat* matR, const CvMat* matT,
                       CvMat* _R1, CvMat* _R2, CvMat* _P1, CvMat* _P2,
-                      CvMat* _Q, int flags, double alpha, CvSize newImgSize,
+                      CvMat* matQ, int flags, double alpha, CvSize newImgSize,
                       CvRect* roi1, CvRect* roi2 )
 {
     double _om[3], _t[3], _uu[3]={0,0,0}, _r_r[3][3], _pp[3][4];
@@ -2277,13 +2277,13 @@ void cvStereoRectify( const CvMat* _cameraMatrix1, const CvMat* _cameraMatrix2,
     double nx = imageSize.width, ny = imageSize.height;
     int i, k;
 
-    if( _R->rows == 3 && _R->cols == 3 )
-        cvRodrigues2(_R, &om);          // get vector rotation
+    if( matR->rows == 3 && matR->cols == 3 )
+        cvRodrigues2(matR, &om);          // get vector rotation
     else
-        cvConvert(_R, &om); // it's already a rotation vector
+        cvConvert(matR, &om); // it's already a rotation vector
     cvConvertScale(&om, &om, -0.5); // get average rotation
     cvRodrigues2(&om, &r_r);        // rotate cameras to same orientation by averaging
-    cvMatMul(&r_r, _T, &t);
+    cvMatMul(&r_r, matT, &t);
 
     int idx = fabs(_t[0]) > fabs(_t[1]) ? 0 : 1;
     double c = _t[idx], nt = cvNorm(&t, 0, CV_L2);
@@ -2300,7 +2300,7 @@ void cvStereoRectify( const CvMat* _cameraMatrix1, const CvMat* _cameraMatrix2,
     cvConvert( &Ri, _R1 );
     cvGEMM(&wR, &r_r, 1, 0, 0, &Ri, 0);
     cvConvert( &Ri, _R2 );
-    cvMatMul(&r_r, _T, &t);
+    cvMatMul(&r_r, matT, &t);
 
     // calculate projection/camera matrices
     // these contain the relevant rectified image internal params (fx, fy=fx, cx, cy)
@@ -2447,7 +2447,7 @@ void cvStereoRectify( const CvMat* _cameraMatrix1, const CvMat* _cameraMatrix2,
     }
     }
 
-    if( _Q )
+    if( matQ )
     {
         double q[] =
         {
@@ -2458,7 +2458,7 @@ void cvStereoRectify( const CvMat* _cameraMatrix1, const CvMat* _cameraMatrix2,
             (idx == 0 ? cc_new[0].x - cc_new[1].x : cc_new[0].y - cc_new[1].y)/_t[idx]
         };
         CvMat Q = cvMat(4, 4, CV_64F, q);
-        cvConvert( &Q, _Q );
+        cvConvert( &Q, matQ );
     }
 }
                         
@@ -2474,8 +2474,8 @@ void cvGetOptimalNewCameraMatrix( const CvMat* cameraMatrix, const CvMat* distCo
     newImgSize = newImgSize.width*newImgSize.height != 0 ? newImgSize : imgSize;
     
     double M[3][3];
-    CvMat _M = cvMat(3, 3, CV_64F, M);
-    cvConvert(cameraMatrix, &_M);
+    CvMat matM = cvMat(3, 3, CV_64F, M);
+    cvConvert(cameraMatrix, &matM);
     
     double cx0 = M[0][2];
     double cy0 = M[1][2];
@@ -2494,7 +2494,7 @@ void cvGetOptimalNewCameraMatrix( const CvMat* cameraMatrix, const CvMat* distCo
     M[1][1] *= s;
     M[0][2] = cx;
     M[1][2] = cy;
-    cvConvert(&_M, newCameraMatrix);
+    cvConvert(&matM, newCameraMatrix);
     
     if( validPixROI )
     {
@@ -2707,7 +2707,7 @@ CV_IMPL int cvStereoRectifyUncalibrated(
 
 CV_IMPL void cvReprojectImageTo3D(
     const CvArr* disparityImage,
-    CvArr* _3dImage, const CvMat* _Q,
+    CvArr* _3dImage, const CvMat* matQ,
     int handleMissingValues )
 {
     const double bigZ = 10000.;
@@ -2727,7 +2727,7 @@ CV_IMPL void cvReprojectImageTo3D(
         (CV_MAT_TYPE(dtype) == CV_16SC3 || CV_MAT_TYPE(dtype) == CV_32SC3 ||
         CV_MAT_TYPE(dtype) == CV_32FC3) );
 
-    cvConvert( _Q, &Q );
+    cvConvert( matQ, &Q );
 
     // NOTE: here we quietly assume that at least one pixel in the disparity map is not defined.
     // and we set the corresponding Z's to some fixed big value.
@@ -2896,8 +2896,8 @@ void cv::matMulDeriv( const Mat& A, const Mat& B, Mat& dABdA, Mat& dABdB )
 {
     dABdA.create(A.rows*B.cols, A.rows*A.cols, A.type());
     dABdB.create(A.rows*B.cols, B.rows*B.cols, A.type());
-    CvMat _A = A, _B = B, _dABdA = dABdA, _dABdB = dABdB;
-    cvCalcMatMulDeriv(&_A, &_B, &_dABdA, &_dABdB);
+    CvMat matA = A, matB = B, _dABdA = dABdA, _dABdB = dABdB;
+    cvCalcMatMulDeriv(&matA, &matB, &_dABdA, &_dABdB);
 }
 
 void cv::composeRT( const Mat& rvec1, const Mat& tvec1,
@@ -3086,11 +3086,11 @@ double cv::stereoCalibrate( const vector<vector<Point3f> >& objectPoints,
     CvMat _objPt = objPt, _imgPt = imgPt, _imgPt2 = imgPt2, _npoints = npoints;
     CvMat _cameraMatrix1 = cameraMatrix1, _distCoeffs1 = distCoeffs1;
     CvMat _cameraMatrix2 = cameraMatrix2, _distCoeffs2 = distCoeffs2;
-    CvMat _R = R, _T = T, _E = E, _F = F;
+    CvMat matR = R, matT = T, matE = E, matF = F;
 
     return cvStereoCalibrate(&_objPt, &_imgPt, &_imgPt2, &_npoints, &_cameraMatrix1,
         &_distCoeffs1, &_cameraMatrix2, &_distCoeffs2, imageSize,
-        &_R, &_T, &_E, &_F, criteria, flags );
+        &matR, &matT, &matE, &matF, criteria, flags );
 }
 
 void cv::stereoRectify( const Mat& cameraMatrix1, const Mat& distCoeffs1,
@@ -3107,9 +3107,9 @@ void cv::stereoRectify( const Mat& cameraMatrix1, const Mat& distCoeffs1,
     Q.create(4, 4, rtype);
     CvMat _cameraMatrix1 = cameraMatrix1, _distCoeffs1 = distCoeffs1;
     CvMat _cameraMatrix2 = cameraMatrix2, _distCoeffs2 = distCoeffs2;
-    CvMat _R = R, _T = T, _R1 = R1, _R2 = R2, _P1 = P1, _P2 = P2, _Q = Q;
+    CvMat matR = R, matT = T, _R1 = R1, _R2 = R2, _P1 = P1, _P2 = P2, matQ = Q;
     cvStereoRectify( &_cameraMatrix1, &_cameraMatrix2, &_distCoeffs1, &_distCoeffs2,
-        imageSize, &_R, &_T, &_R1, &_R2, &_P1, &_P2, &_Q, flags );
+        imageSize, &matR, &matT, &_R1, &_R2, &_P1, &_P2, &matQ, flags );
 }
 
 void cv::stereoRectify( const Mat& cameraMatrix1, const Mat& distCoeffs1,
@@ -3128,9 +3128,9 @@ void cv::stereoRectify( const Mat& cameraMatrix1, const Mat& distCoeffs1,
     Q.create(4, 4, rtype);
     CvMat _cameraMatrix1 = cameraMatrix1, _distCoeffs1 = distCoeffs1;
     CvMat _cameraMatrix2 = cameraMatrix2, _distCoeffs2 = distCoeffs2;
-    CvMat _R = R, _T = T, _R1 = R1, _R2 = R2, _P1 = P1, _P2 = P2, _Q = Q;
+    CvMat matR = R, matT = T, _R1 = R1, _R2 = R2, _P1 = P1, _P2 = P2, matQ = Q;
     cvStereoRectify( &_cameraMatrix1, &_cameraMatrix2, &_distCoeffs1, &_distCoeffs2,
-                    imageSize, &_R, &_T, &_R1, &_R2, &_P1, &_P2, &_Q, flags,
+                    imageSize, &matR, &matT, &_R1, &_R2, &_P1, &_P2, &matQ, flags,
                     alpha, newImageSize, (CvRect*)validPixROI1, (CvRect*)validPixROI2);
 }
 
@@ -3141,9 +3141,9 @@ bool cv::stereoRectifyUncalibrated( const Mat& points1, const Mat& points2,
     int rtype = CV_64F;
     H1.create(3, 3, rtype);
     H2.create(3, 3, rtype);
-    CvMat _pt1 = points1, _pt2 = points2, _F, *pF=0, _H1 = H1, _H2 = H2;
+    CvMat _pt1 = points1, _pt2 = points2, matF, *pF=0, _H1 = H1, _H2 = H2;
     if( F.size() == Size(3, 3) )
-        pF = &(_F = F);
+        pF = &(matF = F);
     return cvStereoRectifyUncalibrated(&_pt1, &_pt2, pF, imgSize, &_H1, &_H2, threshold) > 0;
 }
 
@@ -3152,8 +3152,8 @@ void cv::reprojectImageTo3D( const Mat& disparity,
                              bool handleMissingValues )
 {
     _3dImage.create(disparity.size(), CV_32FC3);
-    CvMat _disparity = disparity, __3dImage = _3dImage, _Q = Q;
-    cvReprojectImageTo3D( &_disparity, &__3dImage, &_Q, handleMissingValues );
+    CvMat _disparity = disparity, __3dImage = _3dImage, matQ = Q;
+    cvReprojectImageTo3D( &_disparity, &__3dImage, &matQ, handleMissingValues );
 }
 
 
index 5d3f6b67b86161f020ac0c8c105895856a09e321..a34426cdc0ab48a1a3d2be0fca92183570e24e64 100644 (file)
@@ -86,8 +86,8 @@ int CvHomographyEstimator::runKernel( const CvMat* m1, const CvMat* m2, CvMat* H
 
     double LtL[9][9], W[9][9], V[9][9];
     CvMat _LtL = cvMat( 9, 9, CV_64F, LtL );
-    CvMat _W = cvMat( 9, 9, CV_64F, W );
-    CvMat _V = cvMat( 9, 9, CV_64F, V );
+    CvMat matW = cvMat( 9, 9, CV_64F, W );
+    CvMat matV = cvMat( 9, 9, CV_64F, V );
     CvMat _H0 = cvMat( 3, 3, CV_64F, V[8] );
     CvMat _Htemp = cvMat( 3, 3, CV_64F, V[7] );
     CvPoint2D64f cM={0,0}, cm={0,0}, sM={0,0}, sm={0,0};
@@ -134,8 +134,8 @@ int CvHomographyEstimator::runKernel( const CvMat* m1, const CvMat* m2, CvMat* H
     }
     cvCompleteSymm( &_LtL );
 
-    //cvSVD( &_LtL, &_W, 0, &_V, CV_SVD_MODIFY_A + CV_SVD_V_T );
-    cvEigenVV( &_LtL, &_V, &_W );
+    //cvSVD( &_LtL, &matW, 0, &matV, CV_SVD_MODIFY_A + CV_SVD_V_T );
+    cvEigenVV( &_LtL, &matV, &matW );
     cvMatMul( &_invHnorm, &_H0, &_Htemp );
     cvMatMul( &_Htemp, &_Hnorm2, &_H0 );
     cvConvertScale( &_H0, H, 1./_H0.data.db[8] );
@@ -224,7 +224,7 @@ cvFindHomography( const CvMat* objectPoints, const CvMat* imagePoints,
     Ptr<CvMat> m, M, tempMask;
 
     double H[9];
-    CvMat _H = cvMat( 3, 3, CV_64FC1, H );
+    CvMat matH = cvMat( 3, 3, CV_64FC1, H );
     int count;
 
     CV_Assert( CV_IS_MAT(imagePoints) && CV_IS_MAT(objectPoints) );
@@ -254,22 +254,22 @@ cvFindHomography( const CvMat* objectPoints, const CvMat* imagePoints,
     if( count == 4 )
         method = 0;
     if( method == CV_LMEDS )
-        result = estimator.runLMeDS( M, m, &_H, tempMask, confidence, maxIters );
+        result = estimator.runLMeDS( M, m, &matH, tempMask, confidence, maxIters );
     else if( method == CV_RANSAC )
-        result = estimator.runRANSAC( M, m, &_H, tempMask, ransacReprojThreshold, confidence, maxIters);
+        result = estimator.runRANSAC( M, m, &matH, tempMask, ransacReprojThreshold, confidence, maxIters);
     else
-        result = estimator.runKernel( M, m, &_H ) > 0;
+        result = estimator.runKernel( M, m, &matH ) > 0;
 
     if( result && count > 4 )
     {
         icvCompressPoints( (CvPoint2D64f*)M->data.ptr, tempMask->data.ptr, 1, count );
         count = icvCompressPoints( (CvPoint2D64f*)m->data.ptr, tempMask->data.ptr, 1, count );
         M->cols = m->cols = count;
-        estimator.refine( M, m, &_H, 10 );
+        estimator.refine( M, m, &matH, 10 );
     }
 
     if( result )
-        cvConvert( &_H, __H );
+        cvConvert( &matH, __H );
 
     return (int)result;
 }
@@ -1049,13 +1049,13 @@ static Mat _findHomography( const Mat& points1, const Mat& points2,
     
     Mat H(3, 3, CV_64F);
     CvMat _pt1 = Mat(points1), _pt2 = Mat(points2);
-    CvMat _H = H, _mask, *pmask = 0;
+    CvMat matH = H, _mask, *pmask = 0;
     if( mask )
     {
         mask->resize(points1.cols*points1.rows*points1.channels()/2);
         pmask = &(_mask = cvMat(1, (int)mask->size(), CV_8U, (void*)&(*mask)[0]));
     }
-    bool ok = cvFindHomography( &_pt1, &_pt2, &_H, method, ransacReprojThreshold, pmask ) > 0;
+    bool ok = cvFindHomography( &_pt1, &_pt2, &matH, method, ransacReprojThreshold, pmask ) > 0;
     if( !ok )
         H = Scalar(0);
     return H;
@@ -1074,13 +1074,13 @@ static Mat _findFundamentalMat( const Mat& points1, const Mat& points2,
     
     Mat F(3, 3, CV_64F);
     CvMat _pt1 = Mat(points1), _pt2 = Mat(points2);
-    CvMat _F = F, _mask, *pmask = 0;
+    CvMat matF = F, _mask, *pmask = 0;
     if( mask )
     {
         mask->resize(points1.cols*points1.rows*points1.channels()/2);
         pmask = &(_mask = cvMat(1, (int)mask->size(), CV_8U, (void*)&(*mask)[0]));
     }
-    int n = cvFindFundamentalMat( &_pt1, &_pt2, &_F, method, param1, param2, pmask );
+    int n = cvFindFundamentalMat( &_pt1, &_pt2, &matF, method, param1, param2, pmask );
     if( n <= 0 )
         F = Scalar(0);
     return F;
@@ -1124,8 +1124,8 @@ void cv::computeCorrespondEpilines( const Mat& points, int whichImage,
                points.cols*points.channels() == 2));
     
     lines.resize(points.cols*points.rows*points.channels()/2);
-    CvMat _points = points, _lines = Mat(lines), _F = F;
-    cvComputeCorrespondEpilines(&_points, whichImage, &_F, &_lines);
+    CvMat _points = points, _lines = Mat(lines), matF = F;
+    cvComputeCorrespondEpilines(&_points, whichImage, &matF, &_lines);
 }
 
 void cv::convertPointsHomogeneous( const Mat& src, vector<Point3f>& dst )
index cb57f507df7ed64d6ef72486496a24de7f58b654..7c31c59149816b346f3f728c68db23905fc0c732 100644 (file)
@@ -345,10 +345,10 @@ cvRQDecomp3x3( const CvMat *matrixM, CvMat *matrixR, CvMat *matrixQ,
                CvMat *matrixQx, CvMat *matrixQy, CvMat *matrixQz,
                CvPoint3D64f *eulerAngles)
 {
-    double _M[3][3], _R[3][3], _Q[3][3];
-    CvMat M = cvMat(3, 3, CV_64F, _M);
-    CvMat R = cvMat(3, 3, CV_64F, _R);
-    CvMat Q = cvMat(3, 3, CV_64F, _Q);
+    double matM[3][3], matR[3][3], matQ[3][3];
+    CvMat M = cvMat(3, 3, CV_64F, matM);
+    CvMat R = cvMat(3, 3, CV_64F, matR);
+    CvMat Q = cvMat(3, 3, CV_64F, matQ);
     double z, c, s;
 
     /* Validate parameters. */
@@ -364,8 +364,8 @@ cvRQDecomp3x3( const CvMat *matrixM, CvMat *matrixR, CvMat *matrixQ,
     Qx = ( 0  c  s ), c = m33/sqrt(m32^2 + m33^2), s = m32/sqrt(m32^2 + m33^2)
          ( 0 -s  c )
     */
-    s = _M[2][1];
-    c = _M[2][2];
+    s = matM[2][1];
+    c = matM[2][2];
     z = 1./sqrt(c * c + s * s + DBL_EPSILON);
     c *= z;
     s *= z;
@@ -374,8 +374,8 @@ cvRQDecomp3x3( const CvMat *matrixM, CvMat *matrixR, CvMat *matrixQ,
     CvMat Qx = cvMat(3, 3, CV_64F, _Qx);
 
     cvMatMul(&M, &Qx, &R);
-    assert(fabs(_R[2][1]) < FLT_EPSILON);
-    _R[2][1] = 0;
+    assert(fabs(matR[2][1]) < FLT_EPSILON);
+    matR[2][1] = 0;
 
     /* Find Givens rotation for y axis. */
     /*
@@ -383,8 +383,8 @@ cvRQDecomp3x3( const CvMat *matrixM, CvMat *matrixR, CvMat *matrixQ,
     Qy = ( 0  1  0 ), c = m33/sqrt(m31^2 + m33^2), s = m31/sqrt(m31^2 + m33^2)
          (-s  0  c )
     */
-    s = _R[2][0];
-    c = _R[2][2];
+    s = matR[2][0];
+    c = matR[2][2];
     z = 1./sqrt(c * c + s * s + DBL_EPSILON);
     c *= z;
     s *= z;
@@ -393,8 +393,8 @@ cvRQDecomp3x3( const CvMat *matrixM, CvMat *matrixR, CvMat *matrixQ,
     CvMat Qy = cvMat(3, 3, CV_64F, _Qy);
     cvMatMul(&R, &Qy, &M);
 
-    assert(fabs(_M[2][0]) < FLT_EPSILON);
-    _M[2][0] = 0;
+    assert(fabs(matM[2][0]) < FLT_EPSILON);
+    matM[2][0] = 0;
 
     /* Find Givens rotation for z axis. */
     /*
@@ -403,8 +403,8 @@ cvRQDecomp3x3( const CvMat *matrixM, CvMat *matrixR, CvMat *matrixQ,
          ( 0  0  1 )
     */
 
-    s = _M[1][0];
-    c = _M[1][1];
+    s = matM[1][0];
+    c = matM[1][1];
     z = 1./sqrt(c * c + s * s + DBL_EPSILON);
     c *= z;
     s *= z;
@@ -413,23 +413,23 @@ cvRQDecomp3x3( const CvMat *matrixM, CvMat *matrixR, CvMat *matrixQ,
     CvMat Qz = cvMat(3, 3, CV_64F, _Qz);
 
     cvMatMul(&M, &Qz, &R);
-    assert(fabs(_R[1][0]) < FLT_EPSILON);
-    _R[1][0] = 0;
+    assert(fabs(matR[1][0]) < FLT_EPSILON);
+    matR[1][0] = 0;
 
     // Solve the decomposition ambiguity.
     // Diagonal entries of R, except the last one, shall be positive.
     // Further rotate R by 180 degree if necessary
-    if( _R[0][0] < 0 )
+    if( matR[0][0] < 0 )
     {
-        if( _R[1][1] < 0 )
+        if( matR[1][1] < 0 )
         {
             // rotate around z for 180 degree, i.e. a rotation matrix of
             // [-1,  0,  0],
             // [ 0, -1,  0],
             // [ 0,  0,  1]
-            _R[0][0] *= -1;
-            _R[0][1] *= -1;
-            _R[1][1] *= -1;
+            matR[0][0] *= -1;
+            matR[0][1] *= -1;
+            matR[1][1] *= -1;
 
             _Qz[0][0] *= -1;
             _Qz[0][1] *= -1;
@@ -442,10 +442,10 @@ cvRQDecomp3x3( const CvMat *matrixM, CvMat *matrixR, CvMat *matrixQ,
             // [-1,  0,  0],
             // [ 0,  1,  0],
             // [ 0,  0, -1]
-            _R[0][0] *= -1;
-            _R[0][2] *= -1;
-            _R[1][2] *= -1;
-            _R[2][2] *= -1;
+            matR[0][0] *= -1;
+            matR[0][2] *= -1;
+            matR[1][2] *= -1;
+            matR[2][2] *= -1;
 
             cvTranspose( &Qz, &Qz );
 
@@ -455,7 +455,7 @@ cvRQDecomp3x3( const CvMat *matrixM, CvMat *matrixR, CvMat *matrixQ,
             _Qy[2][2] *= -1;
         }
     }
-    else if( _R[1][1] < 0 )
+    else if( matR[1][1] < 0 )
     {
         // ??? for some reason, we never get here ???
 
@@ -463,11 +463,11 @@ cvRQDecomp3x3( const CvMat *matrixM, CvMat *matrixR, CvMat *matrixQ,
         // [ 1,  0,  0],
         // [ 0, -1,  0],
         // [ 0,  0, -1]
-        _R[0][1] *= -1;
-        _R[0][2] *= -1;
-        _R[1][1] *= -1;
-        _R[1][2] *= -1;
-        _R[2][2] *= -1;
+        matR[0][1] *= -1;
+        matR[0][2] *= -1;
+        matR[1][1] *= -1;
+        matR[1][2] *= -1;
+        matR[2][2] *= -1;
 
         cvTranspose( &Qz, &Qz );
         cvTranspose( &Qy, &Qy );
@@ -563,8 +563,8 @@ void RQDecomp3x3( const Mat& M, Mat& R, Mat& Q )
     R.create(3, 3, M.type());
     Q.create(3, 3, M.type());
 
-    CvMat _M = M, _R = R, _Q = Q;
-    cvRQDecomp3x3(&_M, &_R, &_Q, 0, 0, 0, 0);
+    CvMat matM = M, matR = R, matQ = Q;
+    cvRQDecomp3x3(&matM, &matR, &matQ, 0, 0, 0, 0);
 }
 
 Vec3d RQDecomp3x3( const Mat& M, Mat& R, Mat& Q,
@@ -574,8 +574,8 @@ Vec3d RQDecomp3x3( const Mat& M, Mat& R, Mat& Q,
     Q.create(3, 3, M.type());
     Vec3d eulerAngles;
 
-    CvMat _M = M, _R = R, _Q = Q, _Qx = Qx, _Qy = Qy, _Qz = Qz;
-    cvRQDecomp3x3(&_M, &_R, &_Q, &_Qx, &_Qy, &_Qz, (CvPoint3D64f*)&eulerAngles[0]);
+    CvMat matM = M, matR = R, matQ = Q, _Qx = Qx, _Qy = Qy, _Qz = Qz;
+    cvRQDecomp3x3(&matM, &matR, &matQ, &_Qx, &_Qy, &_Qz, (CvPoint3D64f*)&eulerAngles[0]);
     return eulerAngles;
 }
 
index aa12fdb6db3af925e51634cf3dd5a8fe4f724c62..ac1ef5763a9f7a88338b99400d6f665caa241432 100644 (file)
@@ -440,7 +440,7 @@ calcHist_8u( vector<uchar*>& _ptrs, const vector<int>& _deltas,
     if( dims == 1 )
     {
         int d0 = deltas[0], step0 = deltas[1];
-        int _H[256] = {0};
+        int matH[256] = {0};
         const uchar* p0 = (const uchar*)ptrs[0];
         
         for( ; imsize.height--; p0 += step0, mask += mstep )
@@ -452,9 +452,9 @@ calcHist_8u( vector<uchar*>& _ptrs, const vector<int>& _deltas,
                     for( x = 0; x <= imsize.width - 4; x += 4 )
                     {
                         int t0 = p0[x], t1 = p0[x+1];
-                        _H[t0]++; _H[t1]++;
+                        matH[t0]++; matH[t1]++;
                         t0 = p0[x+2]; t1 = p0[x+3];
-                        _H[t0]++; _H[t1]++;
+                        matH[t0]++; matH[t1]++;
                     }
                     p0 += x;
                 }
@@ -462,27 +462,27 @@ calcHist_8u( vector<uchar*>& _ptrs, const vector<int>& _deltas,
                     for( x = 0; x <= imsize.width - 4; x += 4 )
                     {
                         int t0 = p0[0], t1 = p0[d0];
-                        _H[t0]++; _H[t1]++;
+                        matH[t0]++; matH[t1]++;
                         p0 += d0*2;
                         t0 = p0[0]; t1 = p0[d0];
-                        _H[t0]++; _H[t1]++;
+                        matH[t0]++; matH[t1]++;
                         p0 += d0*2;
                     }
                 
                 for( ; x < imsize.width; x++, p0 += d0 )
-                    _H[*p0]++;
+                    matH[*p0]++;
             }
             else
                 for( x = 0; x < imsize.width; x++, p0 += d0 )
                     if( mask[x] )
-                        _H[*p0]++;
+                        matH[*p0]++;
         }
         
         for( i = 0; i < 256; i++ )
         {
             size_t hidx = tab[i];
             if( hidx < OUT_OF_RANGE )
-                *(int*)(H + hidx) += _H[i];
+                *(int*)(H + hidx) += matH[i];
         }
     }
     else if( dims == 2 )
@@ -988,14 +988,14 @@ calcBackProj_8u( vector<uchar*>& _ptrs, const vector<int>& _deltas,
     if( dims == 1 )
     {
         int d0 = deltas[0], step0 = deltas[1];
-        uchar _H[256] = {0};
+        uchar matH[256] = {0};
         const uchar* p0 = (const uchar*)ptrs[0];
         
         for( i = 0; i < 256; i++ )
         {
             size_t hidx = tab[i];
             if( hidx < OUT_OF_RANGE )
-                _H[i] = saturate_cast<uchar>(*(float*)(H + hidx)*scale);
+                matH[i] = saturate_cast<uchar>(*(float*)(H + hidx)*scale);
         }
         
         for( ; imsize.height--; p0 += step0, bproj += bpstep )
@@ -1004,9 +1004,9 @@ calcBackProj_8u( vector<uchar*>& _ptrs, const vector<int>& _deltas,
             {
                 for( x = 0; x <= imsize.width - 4; x += 4 )
                 {
-                    uchar t0 = _H[p0[x]], t1 = _H[p0[x+1]];
+                    uchar t0 = matH[p0[x]], t1 = matH[p0[x+1]];
                     bproj[x] = t0; bproj[x+1] = t1;
-                    t0 = _H[p0[x+2]]; t1 = _H[p0[x+3]];
+                    t0 = matH[p0[x+2]]; t1 = matH[p0[x+3]];
                     bproj[x+2] = t0; bproj[x+3] = t1;
                 }
                 p0 += x;
@@ -1014,16 +1014,16 @@ calcBackProj_8u( vector<uchar*>& _ptrs, const vector<int>& _deltas,
             else   
                 for( x = 0; x <= imsize.width - 4; x += 4 )
                 {
-                    uchar t0 = _H[p0[0]], t1 = _H[p0[d0]];
+                    uchar t0 = matH[p0[0]], t1 = matH[p0[d0]];
                     bproj[x] = t0; bproj[x+1] = t1;
                     p0 += d0*2;
-                    t0 = _H[p0[0]]; t1 = _H[p0[d0]];
+                    t0 = matH[p0[0]]; t1 = matH[p0[d0]];
                     bproj[x+2] = t0; bproj[x+3] = t1;
                     p0 += d0*2;
                 }
             
             for( ; x < imsize.width; x++, p0 += d0 )
-                bproj[x] = _H[*p0];
+                bproj[x] = matH[*p0];
         }
     }
     else if( dims == 2 )
index 0f5ac39fab18f8788bc5e979574d85c602042114..c80498091ce869d60c255456ad5c1c2fba220cb1 100644 (file)
@@ -2714,13 +2714,13 @@ void warpAffine( const Mat& src, Mat& dst, const Mat& M0, Size dsize,
     const int BLOCK_SZ = 64;
     short XY[BLOCK_SZ*BLOCK_SZ*2], A[BLOCK_SZ*BLOCK_SZ];
     double M[6];
-    Mat _M(2, 3, CV_64F, M);
+    Mat matM(2, 3, CV_64F, M);
     int interpolation = flags & INTER_MAX;
     if( interpolation == INTER_AREA )
         interpolation = INTER_LINEAR;
 
     CV_Assert( (M0.type() == CV_32F || M0.type() == CV_64F) && M0.rows == 2 && M0.cols == 3 );
-    M0.convertTo(_M, _M.type());
+    M0.convertTo(matM, matM.type());
 
     if( !(flags & WARP_INVERSE_MAP) )
     {
@@ -2761,7 +2761,7 @@ void warpAffine( const Mat& src, Mat& dst, const Mat& M0, Size dsize,
             int bw = std::min( bw0, width - x);
             int bh = std::min( bh0, height - y);
 
-            Mat _XY(bh, bw, CV_16SC2, XY), _A;
+            Mat _XY(bh, bw, CV_16SC2, XY), matA;
             Mat dpart(dst, Rect(x, y, bw, bh));
 
             for( y1 = 0; y1 < bh; y1++ )
@@ -2832,8 +2832,8 @@ void warpAffine( const Mat& src, Mat& dst, const Mat& M0, Size dsize,
                 remap( src, dpart, _XY, Mat(), interpolation, borderType, borderValue );
             else
             {
-                Mat _A(bh, bw, CV_16U, A);
-                remap( src, dpart, _XY, _A, interpolation, borderType, borderValue );
+                Mat matA(bh, bw, CV_16U, A);
+                remap( src, dpart, _XY, matA, interpolation, borderType, borderValue );
             }
         }
     }
@@ -2849,16 +2849,16 @@ void warpPerspective( const Mat& src, Mat& dst, const Mat& M0, Size dsize,
     const int BLOCK_SZ = 32;
     short XY[BLOCK_SZ*BLOCK_SZ*2], A[BLOCK_SZ*BLOCK_SZ];
     double M[9];
-    Mat _M(3, 3, CV_64F, M);
+    Mat matM(3, 3, CV_64F, M);
     int interpolation = flags & INTER_MAX;
     if( interpolation == INTER_AREA )
         interpolation = INTER_LINEAR;
 
     CV_Assert( (M0.type() == CV_32F || M0.type() == CV_64F) && M0.rows == 3 && M0.cols == 3 );
-    M0.convertTo(_M, _M.type());
+    M0.convertTo(matM, matM.type());
 
     if( !(flags & WARP_INVERSE_MAP) )
-         invert(_M, _M);
+         invert(matM, matM);
 
     int x, y, x1, y1, width = dst.cols, height = dst.rows;
 
@@ -2873,7 +2873,7 @@ void warpPerspective( const Mat& src, Mat& dst, const Mat& M0, Size dsize,
             int bw = std::min( bw0, width - x);
             int bh = std::min( bh0, height - y);
 
-            Mat _XY(bh, bw, CV_16SC2, XY), _A;
+            Mat _XY(bh, bw, CV_16SC2, XY), matA;
             Mat dpart(dst, Rect(x, y, bw, bh));
 
             for( y1 = 0; y1 < bh; y1++ )
@@ -2914,8 +2914,8 @@ void warpPerspective( const Mat& src, Mat& dst, const Mat& M0, Size dsize,
                 remap( src, dpart, _XY, Mat(), interpolation, borderType, borderValue );
             else
             {
-                Mat _A(bh, bw, CV_16U, A);
-                remap( src, dpart, _XY, _A, interpolation, borderType, borderValue );
+                Mat matA(bh, bw, CV_16U, A);
+                remap( src, dpart, _XY, matA, interpolation, borderType, borderValue );
             }
         }
     }
@@ -3033,15 +3033,15 @@ Mat getAffineTransform( const Point2f src[], const Point2f dst[] )
     return M;
 }
     
-void invertAffineTransform(const Mat& _M, Mat& _iM)
+void invertAffineTransform(const Mat& matM, Mat& _iM)
 {
-    CV_Assert(_M.rows == 2 && _M.cols == 3);
-    _iM.create(2, 3, _M.type());
-    if( _M.type() == CV_32F )
+    CV_Assert(matM.rows == 2 && matM.cols == 3);
+    _iM.create(2, 3, matM.type());
+    if( matM.type() == CV_32F )
     {
-        const float* M = (const float*)_M.data;
+        const float* M = (const float*)matM.data;
         float* iM = (float*)_iM.data;
-        int step = _M.step/sizeof(M[0]), istep = _iM.step/sizeof(iM[0]);
+        int step = matM.step/sizeof(M[0]), istep = _iM.step/sizeof(iM[0]);
         
         double D = M[0]*M[step+1] - M[1]*M[step];
         D = D != 0 ? 1./D : 0;
@@ -3052,11 +3052,11 @@ void invertAffineTransform(const Mat& _M, Mat& _iM)
         iM[0] = (float)A11; iM[1] = (float)A12; iM[2] = (float)b1;
         iM[istep] = (float)A21; iM[istep+1] = (float)A22; iM[istep+2] = (float)b2;
     }
-    else if( _M.type() == CV_64F )
+    else if( matM.type() == CV_64F )
     {
-        const double* M = (const double*)_M.data;
+        const double* M = (const double*)matM.data;
         double* iM = (double*)_iM.data;
-        int step = _M.step/sizeof(M[0]), istep = _iM.step/sizeof(iM[0]);
+        int step = matM.step/sizeof(M[0]), istep = _iM.step/sizeof(iM[0]);
         
         double D = M[0]*M[step+1] - M[1]*M[step];
         D = D != 0 ? 1./D : 0;
index ffda27ae3ec3189cde5a732eef3dda6406837a5b..8b3bb932a5b8ce93462390c447c864428b8705fd 100644 (file)
@@ -1378,7 +1378,7 @@ icvGetRTMatrix( const CvPoint2D32f* a, const CvPoint2D32f* b,
 
 
 CV_IMPL int
-cvEstimateRigidTransform( const CvArr* _A, const CvArr* _B, CvMat* _M, int full_affine )
+cvEstimateRigidTransform( const CvArr* matA, const CvArr* matB, CvMat* matM, int full_affine )
 {
     const int COUNT = 15;
     const int WIDTH = 160, HEIGHT = 120;
@@ -1392,8 +1392,8 @@ cvEstimateRigidTransform( const CvArr* _A, const CvArr* _B, CvMat* _M, int full_
     cv::AutoBuffer<char> status;
     cv::Ptr<CvMat> gray;
 
-    CvMat stubA, *A = cvGetMat( _A, &stubA );
-    CvMat stubB, *B = cvGetMat( _B, &stubB );
+    CvMat stubA, *A = cvGetMat( matA, &stubA );
+    CvMat stubB, *B = cvGetMat( matB, &stubB );
     CvSize sz0, sz1;
     int cn, equal_sizes;
     int i, j, k, k1;
@@ -1405,8 +1405,8 @@ cvEstimateRigidTransform( const CvArr* _A, const CvArr* _B, CvMat* _M, int full_
     int good_count = 0;
     CvRect brect;
 
-    if( !CV_IS_MAT(_M) )
-        CV_Error( _M ? CV_StsBadArg : CV_StsNullPtr, "Output parameter M is not a valid matrix" );
+    if( !CV_IS_MAT(matM) )
+        CV_Error( matM ? CV_StsBadArg : CV_StsNullPtr, "Output parameter M is not a valid matrix" );
 
     if( !CV_ARE_SIZES_EQ( A, B ) )
         CV_Error( CV_StsUnmatchedSizes, "Both input images must have the same size" );
@@ -1601,7 +1601,7 @@ cvEstimateRigidTransform( const CvArr* _A, const CvArr* _B, CvMat* _M, int full_
     icvGetRTMatrix( pA, pB, good_count, &M, full_affine );
     m[2] /= scale;
     m[5] /= scale;
-    cvConvert( &M, _M );
+    cvConvert( &M, matM );
     
     return 1;
 }
@@ -1614,8 +1614,8 @@ Mat estimateRigidTransform( const Mat& A,
                             bool fullAffine )
 {
     Mat M(2, 3, CV_64F);
-    CvMat _A = A, _B = B, _M = M;
-    cvEstimateRigidTransform(&_A, &_B, &_M, fullAffine);
+    CvMat matA = A, matB = B, matM = M;
+    cvEstimateRigidTransform(&matA, &matB, &matM, fullAffine);
     return M;
 }
 }
index 1eb9eb35496f45ceadf46c6921e55d067edcf82e..53a18fa5186074cc7fab9af2e7accbfd0efcc27a 100644 (file)
@@ -235,8 +235,8 @@ private:
   lsh_table(const lsh_table& x);
   lsh_table& operator= (const lsh_table& rhs);
 public:
-  lsh_table(CvLSHOperations* _ops, int _d, int _L, int _k, double _r, CvRNG& rng)
-    : ops(_ops), d(_d), L(_L), k(_k), r(_r) {
+  lsh_table(CvLSHOperations* _ops, int _d, int Lval, int _k, double _r, CvRNG& rng)
+    : ops(_ops), d(_d), L(Lval), k(_k), r(_r) {
     g.resize(L);
     for (int j = 0; j < L; ++j)
       g[j] = new H(d, k, r, rng);
index cb22142f75e1ed3298f9839626eea6c6a731e106..9596d593db895ee299a7299afce5753cab777b67 100644 (file)
@@ -194,7 +194,7 @@ FarnebackPolyExpPyr( const Mat& src0, Vector<Mat>& pyr, int maxlevel, int n, dou
 
 
 static void
-FarnebackUpdateMatrices( const Mat& _R0, const Mat& _R1, const Mat& _flow, Mat& _M, int _y0, int _y1 )
+FarnebackUpdateMatrices( const Mat& _R0, const Mat& _R1, const Mat& _flow, Mat& matM, int _y0, int _y1 )
 {
     const int BORDER = 5;
     static const float border[BORDER] = {0.14f, 0.14f, 0.4472f, 0.4472f, 0.4472f};
@@ -203,13 +203,13 @@ FarnebackUpdateMatrices( const Mat& _R0, const Mat& _R1, const Mat& _flow, Mat&
     const float* R1 = (float*)_R1.data;
     size_t step1 = _R1.step/sizeof(R1[0]);
     
-    _M.create(height, width, CV_32FC(5));
+    matM.create(height, width, CV_32FC(5));
 
     for( y = _y0; y < _y1; y++ )
     {
         const float* flow = (float*)(_flow.data + y*_flow.step);
         const float* R0 = (float*)(_R0.data + y*_R0.step);
-        float* M = (float*)(_M.data + y*_M.step);
+        float* M = (float*)(matM.data + y*matM.step);
         
         for( x = 0; x < width; x++ )
         {
@@ -292,7 +292,7 @@ FarnebackUpdateMatrices( const Mat& _R0, const Mat& _R1, const Mat& _flow, Mat&
 
 static void
 FarnebackUpdateFlow_Blur( const Mat& _R0, const Mat& _R1,
-                          Mat& _flow, Mat& _M, int block_size,
+                          Mat& _flow, Mat& matM, int block_size,
                           bool update_matrices )
 {
     int x, y, width = _flow.cols, height = _flow.rows;
@@ -305,13 +305,13 @@ FarnebackUpdateFlow_Blur( const Mat& _R0, const Mat& _R1,
     double* vsum = _vsum + (m+1)*5;
 
     // init vsum
-    const float* srow0 = (const float*)_M.data;
+    const float* srow0 = (const float*)matM.data;
     for( x = 0; x < width*5; x++ )
         vsum[x] = srow0[x]*(m+2);
 
     for( y = 1; y < m; y++ )
     {
-        srow0 = (float*)(_M.data + _M.step*std::min(y,height-1));
+        srow0 = (float*)(matM.data + matM.step*std::min(y,height-1));
         for( x = 0; x < width*5; x++ )
             vsum[x] += srow0[x];
     }
@@ -322,8 +322,8 @@ FarnebackUpdateFlow_Blur( const Mat& _R0, const Mat& _R1,
         double g11, g12, g22, h1, h2;
         float* flow = (float*)(_flow.data + _flow.step*y);
 
-        srow0 = (const float*)(_M.data + _M.step*std::max(y-m-1,0));
-        const float* srow1 = (const float*)(_M.data + _M.step*std::min(y+m,height-1));
+        srow0 = (const float*)(matM.data + matM.step*std::max(y-m-1,0));
+        const float* srow1 = (const float*)(matM.data + matM.step*std::min(y+m,height-1));
         
         // vertical blur
         for( x = 0; x < width*5; x++ )
@@ -376,7 +376,7 @@ FarnebackUpdateFlow_Blur( const Mat& _R0, const Mat& _R1,
         y1 = y == height - 1 ? height : y - block_size;
         if( update_matrices && (y1 == height || y1 >= y0 + min_update_stripe) )
         {
-            FarnebackUpdateMatrices( _R0, _R1, _flow, _M, y0, y1 );
+            FarnebackUpdateMatrices( _R0, _R1, _flow, matM, y0, y1 );
             y0 = y1;
         }
     }
@@ -385,7 +385,7 @@ FarnebackUpdateFlow_Blur( const Mat& _R0, const Mat& _R1,
 
 static void
 FarnebackUpdateFlow_GaussianBlur( const Mat& _R0, const Mat& _R1,
-                                  Mat& _flow, Mat& _M, int block_size,
+                                  Mat& _flow, Mat& matM, int block_size,
                                   bool update_matrices )
 {
     int x, y, i, width = _flow.cols, height = _flow.rows;
@@ -432,8 +432,8 @@ FarnebackUpdateFlow_GaussianBlur( const Mat& _R0, const Mat& _R1,
         // vertical blur
         for( i = 0; i <= m; i++ )
         {
-            srow[m-i] = (const float*)(_M.data + _M.step*std::max(y-i,0));
-            srow[m+i] = (const float*)(_M.data + _M.step*std::min(y+i,height-1));
+            srow[m-i] = (const float*)(matM.data + matM.step*std::max(y-i,0));
+            srow[m+i] = (const float*)(matM.data + matM.step*std::min(y+i,height-1));
         }
 
         x = 0;
@@ -555,7 +555,7 @@ FarnebackUpdateFlow_GaussianBlur( const Mat& _R0, const Mat& _R1,
         y1 = y == height - 1 ? height : y - block_size;
         if( update_matrices && (y1 == height || y1 >= y0 + min_update_stripe) )
         {
-            FarnebackUpdateMatrices( _R0, _R1, _flow, _M, y0, y1 );
+            FarnebackUpdateMatrices( _R0, _R1, _flow, matM, y0, y1 );
             y0 = y1;
         }
     }
index 6731b31cc7aade0da592d38bd750a84c0e70a18a..fffa73320c836faafb1c0341b1a27fd8a8ffca51 100644 (file)
@@ -769,7 +769,7 @@ icvFitEllipse_F( CvSeq* points, CvBox2D* box )
     CvSeqReader reader;
     int is_float = CV_SEQ_ELTYPE(points) == CV_32FC2;
 
-    CvMat _S = cvMat(6,6,CV_64F,S), _C = cvMat(6,6,CV_64F,C), _T = cvMat(6,6,CV_64F,T);
+    CvMat matS = cvMat(6,6,CV_64F,S), matC = cvMat(6,6,CV_64F,C), matT = cvMat(6,6,CV_64F,T);
     CvMat _EIGVECS = cvMat(6,6,CV_64F,eigenvectors), _EIGVALS = cvMat(6,1,CV_64F,eigenvalues);
 
     /* create matrix D of  input points */
@@ -823,8 +823,8 @@ icvFitEllipse_F( CvSeq* points, CvBox2D* box )
     }
 
     // S = D^t*D
-    cvMulTransposed( D, &_S, 1 );
-    cvSVD( &_S, &_EIGVALS, &_EIGVECS, 0, CV_SVD_MODIFY_A + CV_SVD_U_T );
+    cvMulTransposed( D, &matS, 1 );
+    cvSVD( &matS, &_EIGVALS, &_EIGVECS, 0, CV_SVD_MODIFY_A + CV_SVD_U_T );
 
     for( i = 0; i < 6; i++ )
     {
@@ -835,20 +835,20 @@ icvFitEllipse_F( CvSeq* points, CvBox2D* box )
     }
 
     // C = Q^-1 = transp(INVEIGV) * INVEIGV
-    cvMulTransposed( &_EIGVECS, &_C, 1 );
+    cvMulTransposed( &_EIGVECS, &matC, 1 );
     
-    cvZero( &_S );
+    cvZero( &matS );
     S[2] = 2.;
     S[7] = -1.;
     S[12] = 2.;
 
     // S = Q^-1*S*Q^-1
-    cvMatMul( &_C, &_S, &_T );
-    cvMatMul( &_T, &_C, &_S );
+    cvMatMul( &matC, &matS, &matT );
+    cvMatMul( &matT, &matC, &matS );
 
     // and find its eigenvalues and vectors too
-    //cvSVD( &_S, &_EIGVALS, &_EIGVECS, 0, CV_SVD_MODIFY_A + CV_SVD_U_T );
-    cvEigenVV( &_S, &_EIGVECS, &_EIGVALS, 0 );
+    //cvSVD( &matS, &_EIGVALS, &_EIGVECS, 0, CV_SVD_MODIFY_A + CV_SVD_U_T );
+    cvEigenVV( &matS, &_EIGVECS, &_EIGVALS, 0 );
 
     for( i = 0; i < 3; i++ )
         if( eigenvalues[i] > 0 )
@@ -864,9 +864,9 @@ icvFitEllipse_F( CvSeq* points, CvBox2D* box )
 
     // now find truthful eigenvector
     _EIGVECS = cvMat( 6, 1, CV_64F, eigenvectors + 6*i );
-    _T = cvMat( 6, 1, CV_64F, T );
+    matT = cvMat( 6, 1, CV_64F, T );
     // Q^-1*eigenvecs[0]
-    cvMatMul( &_C, &_EIGVECS, &_T );
+    cvMatMul( &matC, &_EIGVECS, &matT );
     
     // extract vector components
     a = T[0]; b = T[1]; c = T[2]; d = T[3]; e = T[4]; f = T[5];
@@ -930,10 +930,10 @@ icvFitEllipse_F( CvSeq* points, CvBox2D* box )
     S[1] = S[2] = b * 0.5;
     S[3] = c;
 
-    _S = cvMat( 2, 2, CV_64F, S );
+    matS = cvMat( 2, 2, CV_64F, S );
     _EIGVECS = cvMat( 2, 2, CV_64F, eigenvectors );
     _EIGVALS = cvMat( 1, 2, CV_64F, eigenvalues );
-    cvSVD( &_S, &_EIGVALS, &_EIGVECS, 0, CV_SVD_MODIFY_A + CV_SVD_U_T );
+    cvSVD( &matS, &_EIGVALS, &_EIGVECS, 0, CV_SVD_MODIFY_A + CV_SVD_U_T );
 
     // exteract axis length from eigenvectors
     box->size.width = (float)(2./sqrt(eigenvalues[0]));
index e216af84dcb30106c319d1f219d7968472e1a283..e8bbe140ea25c1f8ac003ab595001390435433b9 100644 (file)
 #include "_cv.h"
 
 static void
-icvComputeIntegralImages( const CvMat* _I, CvMat* _S, CvMat* _T, CvMat* _FT )
+icvComputeIntegralImages( const CvMat* matI, CvMat* matS, CvMat* matT, CvMat* _FT )
 {
-    int x, y, rows = _I->rows, cols = _I->cols;
-    const uchar* I = _I->data.ptr;
-    int *S = _S->data.i, *T = _T->data.i, *FT = _FT->data.i;
-    int istep = _I->step, step = _S->step/sizeof(S[0]);
+    int x, y, rows = matI->rows, cols = matI->cols;
+    const uchar* I = matI->data.ptr;
+    int *S = matS->data.i, *T = matT->data.i, *FT = _FT->data.i;
+    int istep = matI->step, step = matS->step/sizeof(S[0]);
     
-    assert( CV_MAT_TYPE(_I->type) == CV_8UC1 &&
-        CV_MAT_TYPE(_S->type) == CV_32SC1 &&
-        CV_ARE_TYPES_EQ(_S, _T) && CV_ARE_TYPES_EQ(_S, _FT) &&
-        CV_ARE_SIZES_EQ(_S, _T) && CV_ARE_SIZES_EQ(_S, _FT) &&
-        _S->step == _T->step && _S->step == _FT->step &&
-        _I->rows+1 == _S->rows && _I->cols+1 == _S->cols );
+    assert( CV_MAT_TYPE(matI->type) == CV_8UC1 &&
+        CV_MAT_TYPE(matS->type) == CV_32SC1 &&
+        CV_ARE_TYPES_EQ(matS, matT) && CV_ARE_TYPES_EQ(matS, _FT) &&
+        CV_ARE_SIZES_EQ(matS, matT) && CV_ARE_SIZES_EQ(matS, _FT) &&
+        matS->step == matT->step && matS->step == _FT->step &&
+        matI->rows+1 == matS->rows && matI->cols+1 == matS->cols );
 
     for( x = 0; x <= cols; x++ )
         S[x] = T[x] = FT[x] = 0;
index 3e49693a10c407d71a624cb840e8bb3ac06429d0..bbd6ea83cabf9023b856e00e3cbb3350986e61db 100644 (file)
@@ -719,16 +719,16 @@ static void computeDisparitySGBM( const Mat& img1, const Mat& img2,
                             _minL0 = _mm_min_epi16(_minL0, _mm_srli_si128(_minL0, 4));
                             _minL0 = _mm_min_epi16(_minL0, _mm_srli_si128(_minL0, 2));
                             
-                            __m128i _S = _mm_min_epi16(_minS, _mm_srli_si128(_minS, 8));
-                            _S = _mm_min_epi16(_S, _mm_srli_si128(_S, 4));
-                            _S = _mm_min_epi16(_S, _mm_srli_si128(_S, 2));
+                            __m128i qS = _mm_min_epi16(_minS, _mm_srli_si128(_minS, 8));
+                            qS = _mm_min_epi16(qS, _mm_srli_si128(qS, 4));
+                            qS = _mm_min_epi16(qS, _mm_srli_si128(qS, 2));
                             
                             minLr[0][xm] = (CostType)_mm_cvtsi128_si32(_minL0);
-                            minS = (CostType)_mm_cvtsi128_si32(_S);
+                            minS = (CostType)_mm_cvtsi128_si32(qS);
                             
-                            _S = _mm_shuffle_epi32(_mm_unpacklo_epi16(_S, _S), 0);
-                            _S = _mm_cmpeq_epi16(_minS, _S);
-                            int idx = _mm_movemask_epi8(_mm_packs_epi16(_S, _S)) & 255;
+                            qS = _mm_shuffle_epi32(_mm_unpacklo_epi16(qS, qS), 0);
+                            qS = _mm_cmpeq_epi16(_minS, qS);
+                            int idx = _mm_movemask_epi8(_mm_packs_epi16(qS, qS)) & 255;
                             
                             bestDisp = bestDispBuf[LSBTab[idx]];
                         }
index db12bba6b89e90af0b22d9b18056f349353c97a5..49682c33c2a204aa8fa0fd3a73f5968ebff9d5c7 100644 (file)
@@ -176,7 +176,7 @@ icvInterpolateKeypoint( float N9[3][9], int dx, int dy, int ds, CvSURFPoint *poi
 {
     int solve_ok;
     float A[9], x[3], b[3];
-    CvMat _A = cvMat(3, 3, CV_32F, A);
+    CvMat matA = cvMat(3, 3, CV_32F, A);
     CvMat _x = cvMat(3, 1, CV_32F, x);                
     CvMat _b = cvMat(3, 1, CV_32F, b);
 
@@ -194,7 +194,7 @@ icvInterpolateKeypoint( float N9[3][9], int dx, int dy, int ds, CvSURFPoint *poi
     A[7] = A[5];                                    /* 2nd deriv s, y */
     A[8] = N9[0][4]-2*N9[1][4]+N9[2][4];            /* 2nd deriv s, s */
 
-    solve_ok = cvSolve( &_A, &_b, &_x );
+    solve_ok = cvSolve( &matA, &_b, &_x );
     if( solve_ok )
     {
         point->pt.x += x[0]*dx;
@@ -425,8 +425,8 @@ struct SURFInvoker
         uchar PATCH[PATCH_SZ+1][PATCH_SZ+1];
         float DX[PATCH_SZ][PATCH_SZ], DY[PATCH_SZ][PATCH_SZ];
         
-        CvMat _X = cvMat(1, max_ori_samples, CV_32F, X);
-        CvMat _Y = cvMat(1, max_ori_samples, CV_32F, Y);
+        CvMat matX = cvMat(1, max_ori_samples, CV_32F, X);
+        CvMat matY = cvMat(1, max_ori_samples, CV_32F, Y);
         CvMat _angle = cvMat(1, max_ori_samples, CV_32F, angle);
         CvMat _patch = cvMat(PATCH_SZ+1, PATCH_SZ+1, CV_8U, PATCH);
         
@@ -495,8 +495,8 @@ struct SURFInvoker
                 kp->size = -1;
                 continue;
             }
-            _X.cols = _Y.cols = _angle.cols = nangle;
-            cvCartToPolar( &_X, &_Y, 0, &_angle, 1 );
+            matX.cols = matY.cols = _angle.cols = nangle;
+            cvCartToPolar( &matX, &matY, 0, &_angle, 1 );
             
             float bestx = 0, besty = 0, descriptor_mod = 0;
             for( i = 0; i < 360; i += ORI_SEARCH_INC )
@@ -732,8 +732,8 @@ cvExtractSURF( const CvArr* _img, const CvArr* _mask,
     }
 
     /* Coordinates and weights of samples used to calculate orientation */
-    cv::Mat _G = cv::getGaussianKernel( 2*ORI_RADIUS+1, ORI_SIGMA, CV_32F );
-    const float* G = (const float*)_G.data;
+    cv::Mat matG = cv::getGaussianKernel( 2*ORI_RADIUS+1, ORI_SIGMA, CV_32F );
+    const float* G = (const float*)matG.data;
     
     for( i = -ORI_RADIUS; i <= ORI_RADIUS; i++ )
     {
index 0a5cf6a54001f386b9efe19889df7ed9feb66ece..ff866b3617c28b3e0652a22473b1668e1d1a7cf6 100644 (file)
@@ -62,7 +62,7 @@ Mat getDefaultNewCameraMatrix( const Mat& cameraMatrix, Size imgsize,
 }
 
 void initUndistortRectifyMap( const Mat& _cameraMatrix, const Mat& _distCoeffs,
-                              const Mat& _R, const Mat& _newCameraMatrix,
+                              const Mat& matR, const Mat& _newCameraMatrix,
                               Size size, int m1type, Mat& map1, Mat& map2 )
 {
     if( m1type <= 0 )
@@ -82,8 +82,8 @@ void initUndistortRectifyMap( const Mat& _cameraMatrix, const Mat& _distCoeffs,
     else
         Ar = getDefaultNewCameraMatrix( A, size, true );
 
-    if( _R.data )
-        R = Mat_<double>(_R);
+    if( matR.data )
+        R = Mat_<double>(matR);
 
     if( _distCoeffs.data )
         distCoeffs = Mat_<double>(_distCoeffs);
@@ -246,10 +246,10 @@ cvInitUndistortRectifyMap( const CvMat* Aarr, const CvMat* dist_coeffs,
 
 void cvUndistortPoints( const CvMat* _src, CvMat* _dst, const CvMat* _cameraMatrix,
                    const CvMat* _distCoeffs,
-                   const CvMat* _R, const CvMat* _P )
+                   const CvMat* matR, const CvMat* matP )
 {
     double A[3][3], RR[3][3], k[5]={0,0,0,0,0}, fx, fy, ifx, ify, cx, cy;
-    CvMat _A=cvMat(3, 3, CV_64F, A), _Dk;
+    CvMat matA=cvMat(3, 3, CV_64F, A), _Dk;
     CvMat _RR=cvMat(3, 3, CV_64F, RR);
     const CvPoint2D32f* srcf;
     const CvPoint2D64f* srcd;
@@ -269,7 +269,7 @@ void cvUndistortPoints( const CvMat* _src, CvMat* _dst, const CvMat* _cameraMatr
     CV_Assert( CV_IS_MAT(_cameraMatrix) &&
         _cameraMatrix->rows == 3 && _cameraMatrix->cols == 3 );
 
-    cvConvert( _cameraMatrix, &_A );
+    cvConvert( _cameraMatrix, &matA );
 
     if( _distCoeffs )
     {
@@ -285,20 +285,20 @@ void cvUndistortPoints( const CvMat* _src, CvMat* _dst, const CvMat* _cameraMatr
         iters = 5;
     }
 
-    if( _R )
+    if( matR )
     {
-        CV_Assert( CV_IS_MAT(_R) && _R->rows == 3 && _R->cols == 3 );
-        cvConvert( _R, &_RR );
+        CV_Assert( CV_IS_MAT(matR) && matR->rows == 3 && matR->cols == 3 );
+        cvConvert( matR, &_RR );
     }
     else
         cvSetIdentity(&_RR);
 
-    if( _P )
+    if( matP )
     {
         double PP[3][3];
         CvMat _P3x3, _PP=cvMat(3, 3, CV_64F, PP);
-        CV_Assert( CV_IS_MAT(_P) && _P->rows == 3 && (_P->cols == 3 || _P->cols == 4));
-        cvConvert( cvGetCols(_P, &_P3x3, 0, 3), &_PP );
+        CV_Assert( CV_IS_MAT(matP) && matP->rows == 3 && (matP->cols == 3 || matP->cols == 4));
+        cvConvert( cvGetCols(matP, &_P3x3, 0, 3), &_PP );
         cvMatMul( &_PP, &_RR, &_RR );
     }
 
@@ -377,11 +377,11 @@ void cv::undistortPoints( const Mat& src, Mat& dst,
     
     dst.create(src.size(), src.type());
     CvMat _src = src, _dst = dst, _cameraMatrix = cameraMatrix;
-    CvMat _R, _P, _distCoeffs, *pR=0, *pP=0, *pD=0;
+    CvMat matR, matP, _distCoeffs, *pR=0, *pP=0, *pD=0;
     if( R.data )
-        pR = &(_R = R);
+        pR = &(matR = R);
     if( P.data )
-        pP = &(_P = P);
+        pP = &(matP = P);
     if( distCoeffs.data )
         pD = &(_distCoeffs = distCoeffs);
     cvUndistortPoints(&_src, &_dst, &_cameraMatrix, pD, pR, pP);
@@ -397,11 +397,11 @@ void cv::undistortPoints( const Mat& src, std::vector<Point2f>& dst,
     
     dst.resize(sz);
     CvMat _src = src, _dst = Mat(dst), _cameraMatrix = cameraMatrix;
-    CvMat _R, _P, _distCoeffs, *pR=0, *pP=0, *pD=0;
+    CvMat matR, matP, _distCoeffs, *pR=0, *pP=0, *pD=0;
     if( R.data )
-        pR = &(_R = R);
+        pR = &(matR = R);
     if( P.data )
-        pP = &(_P = P);
+        pP = &(matP = P);
     if( distCoeffs.data )
         pD = &(_distCoeffs = distCoeffs);
     cvUndistortPoints(&_src, &_dst, &_cameraMatrix, pD, pR, pP);
index a1dbb52712bdf5e2152c55d13193e552dc0248b9..d2cd4fca6c96bd1586d493f7a142c93aec135b7b 100755 (executable)
@@ -735,7 +735,7 @@ void fjac(int /*i*/, int /*j*/, CvMat *point_params, CvMat* cam_params, CvMat* A
     intr_data[2] = cam_params->data.db[8];
     intr_data[5] = cam_params->data.db[9];
 
-    CvMat _A = cvMat(3,3, CV_64F, intr_data ); 
+    CvMat matA = cvMat(3,3, CV_64F, intr_data ); 
 
     CvMat _dpdr, _dpdt, _dpdf, _dpdc, _dpdk;
     
@@ -751,7 +751,7 @@ void fjac(int /*i*/, int /*j*/, CvMat *point_params, CvMat* cam_params, CvMat* A
         cvGetRows( cam_params, &_k, 10, cam_params->height );
         cvGetCols( A, &_dpdk, 10, A->width );
     }
-    cvProjectPoints2( &_Mi, &_ri, &_ti, &_A, have_dk ? &_k : NULL, _mp, &_dpdr, &_dpdt,
+    cvProjectPoints2( &_Mi, &_ri, &_ti, &matA, have_dk ? &_k : NULL, _mp, &_dpdr, &_dpdt,
         &_dpdf, &_dpdc, have_dk ? &_dpdk : NULL, 0);   
 
     cvReleaseMat( &_mp );                                 
@@ -802,8 +802,8 @@ void fjac(int /*i*/, int /*j*/, CvMat *point_params, CvMat* cam_params, CvMat* A
 
     //get rotation matrix
     double R[9], t[3], fx = intr_data[0], fy = intr_data[4];
-    CvMat _R = cvMat( 3, 3, CV_64F, R );
-    cvRodrigues2(&_ri, &_R);
+    CvMat matR = cvMat( 3, 3, CV_64F, R );
+    cvRodrigues2(&_ri, &matR);
 
     double X,Y,Z;
     X = point_params->data.db[0];
@@ -833,7 +833,7 @@ void fjac(int /*i*/, int /*j*/, CvMat *point_params, CvMat* cam_params, CvMat* A
     CvMat coeffmat = cvMat( 2, 3, CV_64F, coeff );
 
     CvMat* dstrike_dbig = cvCreateMat(2,3,CV_64F);
-    cvMatMul(&coeffmat, &_R, dstrike_dbig);
+    cvMatMul(&coeffmat, &matR, dstrike_dbig);
     cvScale(dstrike_dbig, dstrike_dbig, 1/(z*z) );      
     
     if( have_dk )
@@ -945,7 +945,7 @@ void func(int /*i*/, int /*j*/, CvMat *point_params, CvMat* cam_params, CvMat* e
     intr_data[2] = cam_params->data.db[8];
     intr_data[5] = cam_params->data.db[9];
 
-    CvMat _A = cvMat(3,3, CV_64F, intr_data ); 
+    CvMat matA = cvMat(3,3, CV_64F, intr_data ); 
 
     //int cn = CV_MAT_CN(_Mi.type);
 
@@ -955,7 +955,7 @@ void func(int /*i*/, int /*j*/, CvMat *point_params, CvMat* cam_params, CvMat* e
     {
         cvGetRows( cam_params, &_k, 10, cam_params->height );        
     }  
-    cvProjectPoints2( &_Mi, &_ri, &_ti, &_A, have_dk ? &_k : NULL, _mp, NULL, NULL,
+    cvProjectPoints2( &_Mi, &_ri, &_ti, &matA, have_dk ? &_k : NULL, _mp, NULL, NULL,
                                                               NULL, NULL, NULL, 0);   
     cvTranspose( _mp, estim );
     cvReleaseMat( &_mp );
@@ -963,8 +963,8 @@ void func(int /*i*/, int /*j*/, CvMat *point_params, CvMat* cam_params, CvMat* e
 
 void fjac_new(int i, int j, Mat& point_params, Mat& cam_params, Mat& A, Mat& B, void* data)
 {
-    CvMat _point_params = point_params, _cam_params = cam_params, _A = A, _B = B;
-    fjac(i,j, &_point_params, &_cam_params, &_A, &_B, data);
+    CvMat _point_params = point_params, _cam_params = cam_params, matA = A, matB = B;
+    fjac(i,j, &_point_params, &_cam_params, &matA, &matB, data);
 };
 
 void func_new(int i, int j, Mat& point_params, Mat& cam_params, Mat& estim, void* data) 
index 6fd09123e96c42838c07cc429a82d90e0864b6d3..64d43f347317894bef64e5bc8be973925b8a1cbc 100644 (file)
@@ -186,10 +186,10 @@ void PatchGenerator::operator ()(const Mat& image, const Mat& T,
     }
 }
 
-void PatchGenerator::warpWholeImage(const Mat& image, Mat& _T, Mat& buf,
+void PatchGenerator::warpWholeImage(const Mat& image, Mat& matT, Mat& buf,
                                     Mat& warped, int border, RNG& rng) const
 {
-    Mat_<double> T = _T;
+    Mat_<double> T = matT;
     Rect roi(INT_MAX, INT_MAX, INT_MIN, INT_MIN);
     
     for( int k = 0; k < 4; k++ )
@@ -221,8 +221,8 @@ void PatchGenerator::warpWholeImage(const Mat& image, Mat& _T, Mat& buf,
     T(1,2) += dy;
     (*this)(image, T, warped, warped.size(), rng);
     
-    if( T.data != _T.data )
-        T.convertTo(_T, _T.type());        
+    if( T.data != matT.data )
+        T.convertTo(matT, matT.type());        
 }
 
 
@@ -304,8 +304,8 @@ void LDetector::getMostStable2D(const Mat& image, vector<KeyPoint>& keypoints,
     patchGenerator.backgroundMin = patchGenerator.backgroundMax = 128;
     
     Mat warpbuf, warped;
-    Mat _M(2, 3, CV_64F), _iM(2, 3, CV_64F);
-    double *M = (double*)_M.data, *iM = (double*)_iM.data;
+    Mat matM(2, 3, CV_64F), _iM(2, 3, CV_64F);
+    double *M = (double*)matM.data, *iM = (double*)_iM.data;
     RNG& rng = theRNG();
     int i, k;
     vector<KeyPoint> tempKeypoints;
@@ -327,7 +327,7 @@ void LDetector::getMostStable2D(const Mat& image, vector<KeyPoint>& keypoints,
             putchar('.');
         
         if( i > 0 )
-            patchGenerator.generateRandomTransform(Point2f(), Point2f(), _M, rng);
+            patchGenerator.generateRandomTransform(Point2f(), Point2f(), matM, rng);
         else
         {
             // identity transformation
@@ -335,9 +335,9 @@ void LDetector::getMostStable2D(const Mat& image, vector<KeyPoint>& keypoints,
             M[1] = M[3] = M[2] = M[5] = 0;
         }
         
-        patchGenerator.warpWholeImage(image, _M, warpbuf, warped, cvCeil(baseFeatureSize*0.5+radius), rng);
+        patchGenerator.warpWholeImage(image, matM, warpbuf, warped, cvCeil(baseFeatureSize*0.5+radius), rng);
         (*this)(warped, tempKeypoints, maxPoints*3);
-        invertAffineTransform(_M, _iM);
+        invertAffineTransform(matM, _iM);
         
         int j, sz0 = (int)tempKeypoints.size(), sz1;
         for( j = 0; j < sz0; j++ )
@@ -882,17 +882,17 @@ void FernClassifier::trainFromSingleView(const Mat& image,
     vector<Mat> pyrbuf(maxOctave+1), pyr(maxOctave+1);
     Point2f center0((image.cols-1)*0.5f, (image.rows-1)*0.5f),
     center1((canvas.cols - 1)*0.5f, (canvas.rows - 1)*0.5f);
-    Mat _M(2, 3, CV_64F);
-    double *M = (double*)_M.data;
+    Mat matM(2, 3, CV_64F);
+    double *M = (double*)matM.data;
     RNG& rng = theRNG();
     
     Mat patch(patchSize, CV_8U);
     
     for( i = 0; i < _nviews; i++ )
     {
-        patchGenerator.generateRandomTransform(center0, center1, _M, rng);
+        patchGenerator.generateRandomTransform(center0, center1, matM, rng);
         
-        CV_Assert(_M.type() == CV_64F);
+        CV_Assert(matM.type() == CV_64F);
         Rect roi(INT_MAX, INT_MAX, INT_MIN, INT_MIN);
         
         for( k = 0; k < 4; k++ )
@@ -918,7 +918,7 @@ void FernClassifier::trainFromSingleView(const Mat& image,
         
         Size size = canvas_roi.size();
         rng.fill(canvas_roi, RNG::UNIFORM, Scalar::all(0), Scalar::all(256));
-        warpAffine( image, canvas_roi, _M, size, INTER_LINEAR, BORDER_TRANSPARENT);
+        warpAffine( image, canvas_roi, matM, size, INTER_LINEAR, BORDER_TRANSPARENT);
         
         pyr[0] = canvas_roi;                
         for( j = 1; j <= maxOctave; j++ )
@@ -1286,7 +1286,7 @@ bool PlanarObjectDetector::operator()(const Mat& image, Mat& H, vector<Point2f>&
 }
 
 bool PlanarObjectDetector::operator()(const vector<Mat>& pyr, const vector<KeyPoint>& keypoints,
-                                      Mat& _H, vector<Point2f>& corners, vector<int>* pairs) const
+                                      Mat& matH, vector<Point2f>& corners, vector<int>* pairs) const
 {
     int i, j, m = (int)modelPoints.size(), n = (int)keypoints.size();
     vector<int> bestMatches(m, -1);
@@ -1322,10 +1322,10 @@ bool PlanarObjectDetector::operator()(const vector<Mat>& pyr, const vector<KeyPo
         return false;
     
     vector<uchar> mask;
-    _H = findHomography(Mat(fromPt), Mat(toPt), mask, RANSAC, 10);
-    if( _H.data )
+    matH = findHomography(Mat(fromPt), Mat(toPt), mask, RANSAC, 10);
+    if( matH.data )
     {
-        const Mat_<double>& H = _H;
+        const Mat_<double>& H = matH;
         corners.resize(4);
         for( i = 0; i < 4; i++ )
         {
@@ -1347,7 +1347,7 @@ bool PlanarObjectDetector::operator()(const vector<Mat>& pyr, const vector<KeyPo
             }
     }
     
-    return _H.data != 0;
+    return matH.data != 0;
 }
 
 
index 34912bd1c60f2a6e1af746b2d165606ddd9b1a09..8a0986a316b9ea87f930edf7d5c6ef1844d0ddd7 100644 (file)
@@ -55,21 +55,6 @@ namespace cv
 \r
 #define CV_MAX_LOCAL_DFT_SIZE  (1 << 15)\r
 \r
-static const uchar log2tab[] = { 0, 0, 1, 0, 2, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0 };\r
-static int log2( int n )\r
-{\r
-    int m = 0;\r
-    int f = (n >= (1 << 16))*16;\r
-    n >>= f;\r
-    m += f;\r
-    f = (n >= (1 << 8))*8;\r
-    n >>= f;\r
-    m += f;\r
-    f = (n >= (1 << 4))*4;\r
-    n >>= f;\r
-    return m + f + log2tab[n];\r
-}\r
-\r
 static unsigned char bitrevTab[] =\r
 {\r
   0x00,0x80,0x40,0xc0,0x20,0xa0,0x60,0xe0,0x10,0x90,0x50,0xd0,0x30,0xb0,0x70,0xf0,\r
@@ -230,8 +215,8 @@ DFTInit( int n0, int nf, int* factors, int* itab, int elem_size, void* _wave, in
         if( (n & 1) == 0 )\r
         {\r
             int a = radix[1], na2 = n*a>>1, na4 = na2 >> 1;\r
-            m = log2(n);\r
-        \r
+            for( m = 0; (unsigned)(1 << m) < (unsigned)n; m++ )\r
+                ;\r
             if( n <= 2  )\r
             {\r
                 itab[0] = 0;\r
@@ -2138,7 +2123,9 @@ DCTInit( int n, int elem_size, void* _wave, int inv )
 \r
     if( (n & (n - 1)) == 0 )\r
     {\r
-        int m = log2(n);\r
+        int m;\r
+        for( m = 0; (unsigned)(1 << m) < (unsigned)n; m++ )\r
+            ;\r
         scale = (!inv ? 2 : 1)*DctScale[m];\r
         w1.re = DFTTab[m+2][0];\r
         w1.im = -DFTTab[m+2][1];\r
index 4ff01a09e5d6a569acbe38004665dc170c89cb68..1c45b1d3cac956a6224ce73a17cebebdc598b590 100644 (file)
@@ -738,12 +738,12 @@ template<typename Real> static inline Real hypot(Real a, Real b)
 }
 
     
-template<typename Real> bool jacobi(const Mat& _S0, Mat& _e, Mat& _E, bool computeEvects, Real eps)
+template<typename Real> bool jacobi(const Mat& _S0, Mat& _e, Mat& matE, bool computeEvects, Real eps)
 {
     int n = _S0.cols, i, j, k, m;
     
     if( computeEvects )
-        _E = Mat::eye(n, n, _S0.type());
+        matE = Mat::eye(n, n, _S0.type());
     
     int iters, maxIters = n*n*30;
     
@@ -754,15 +754,15 @@ template<typename Real> bool jacobi(const Mat& _S0, Mat& _e, Mat& _E, bool compu
     int* indR = (int*)(maxSC + n);
     int* indC = indR + n;
     
-    Mat _S(_S0.size(), _S0.type(), S);
-    _S0.copyTo(_S);
+    Mat matS(_S0.size(), _S0.type(), S);
+    _S0.copyTo(matS);
     
     Real mv;
-    Real* E = (Real*)_E.data;
+    Real* E = (Real*)matE.data;
     Real* e = (Real*)_e.data;
-    int Sstep = _S.step/sizeof(Real);
+    int Sstep = matS.step/sizeof(Real);
     int estep = _e.rows == 1 ? 1 : _e.step/sizeof(Real);
-    int Estep = _E.step/sizeof(Real);
+    int Estep = matE.step/sizeof(Real);
     
     for( k = 0; k < n; k++ )
     {
index 2d92577f3a488a2df3ec8941cac14ca2df03c43a..a39ca98af64256c5e21b71e6d4dafb0f10daf17f 100644 (file)
@@ -670,8 +670,8 @@ static void GEMMStore_64fc( const Complexd* c_data, size_t c_step,
 }
 
 
-void gemm( const Mat& _A, const Mat& _B, double alpha,
-           const Mat& _C, double beta, Mat& D, int flags )
+void gemm( const Mat& matA, const Mat& matB, double alpha,
+           const Mat& matC, double beta, Mat& D, int flags )
 {
     const int block_lin_size = 128;
     const int block_size = block_lin_size * block_lin_size;
@@ -679,8 +679,8 @@ void gemm( const Mat& _A, const Mat& _B, double alpha,
     static double zero[] = {0,0,0,0};
     static float zerof[] = {0,0,0,0};
 
-    Mat A = _A, B = _B;
-    const Mat* C = _C.data && beta != 0 ? &_C : 0;
+    Mat A = matA, B = matB;
+    const Mat* C = matC.data && beta != 0 ? &matC : 0;
     Size a_size = A.size(), d_size;
     int i, len = 0, type = A.type();
 
@@ -987,7 +987,7 @@ void gemm( const Mat& _A, const Mat& _B, double alpha,
     GEMMSingleMulFunc singleMulFunc;
     GEMMBlockMulFunc blockMulFunc;
     GEMMStoreFunc storeFunc;
-    Mat *_D = &D, tmat;
+    Mat *matD = &D, tmat;
     const uchar* Cdata = C ? C->data : 0;
     size_t Cstep = C ? C->step : 0;
     AutoBuffer<uchar> buf;
@@ -1022,7 +1022,7 @@ void gemm( const Mat& _A, const Mat& _B, double alpha,
     {
         buf.allocate(d_size.width*d_size.height*CV_ELEM_SIZE(type));
         tmat = Mat(d_size.height, d_size.width, type, (uchar*)buf );
-        _D = &tmat;
+        matD = &tmat;
     }
 
     if( (d_size.width == 1 || len == 1) && !(flags & GEMM_2_T) && B.isContinuous() )
@@ -1099,7 +1099,7 @@ void gemm( const Mat& _A, const Mat& _B, double alpha,
         d_size.height <= block_lin_size && len <= block_lin_size) )
     {
         singleMulFunc( A.data, A.step, B.data, b_step, Cdata, Cstep,
-                       _D->data, _D->step, a_size, d_size, alpha, beta, flags );
+                       matD->data, matD->step, a_size, d_size, alpha, beta, flags );
     }
     else
     {
@@ -1172,9 +1172,9 @@ void gemm( const Mat& _A, const Mat& _B, double alpha,
 
             for( j = 0; j < d_size.width; j += dj )
             {
-                uchar* _d = _D->data + i*_D->step + j*elem_size;
+                uchar* _d = matD->data + i*matD->step + j*elem_size;
                 const uchar* _c = Cdata + i*c_step0 + j*c_step1;
-                size_t _d_step = _D->step;
+                size_t _d_step = matD->step;
                 dj = dn0;
 
                 if( j + dj >= d_size.width || 8*(j + dj) + dj > 8*d_size.width )
@@ -1236,14 +1236,14 @@ void gemm( const Mat& _A, const Mat& _B, double alpha,
 
                 if( dk0 < len )
                     storeFunc( _c, Cstep, _d, _d_step,
-                               _D->data + i*_D->step + j*elem_size,
-                               _D->step, Size(dj,di), alpha, beta, flags );
+                               matD->data + i*matD->step + j*elem_size,
+                               matD->step, Size(dj,di), alpha, beta, flags );
             }
         }
     }
 
-    if( _D != &D )
-        _D->copyTo(D);
+    if( matD != &D )
+        matD->copyTo(D);
     }
 }
 
index 25f4366b9a3afc27a553f8dc4c63f612a76d9508..35dea06a6f95c499107149f3e7ab8389471da662 100644 (file)
@@ -955,31 +955,31 @@ void CV_CalibrationMatrixValuesTest_CPP::calibMatrixValues( const Mat& cameraMat
 CV_CalibrationMatrixValuesTest_CPP calibMatrixValues_test_cpp;\r
 \r
 //----------------------------------------- CV_ProjectPointsTest --------------------------------\r
-void calcdfdx( const vector<vector<Point2f> >& leftF, const vector<vector<Point2f> >& rightF, double eps, Mat& dfdx )
-{
-    const int fdim = 2;
-       CV_Assert( !leftF.empty() && !rightF.empty() && !leftF[0].empty() && !rightF[0].empty() );
-       CV_Assert( leftF[0].size() ==  rightF[0].size() );
-       CV_Assert( fabs(eps) > std::numeric_limits<double>::epsilon() );
-       int fcount = leftF[0].size(), xdim = leftF.size();
-
-       dfdx.create( fcount*fdim, xdim, CV_64FC1 );
-
-       vector<vector<Point2f> >::const_iterator arrLeftIt = leftF.begin();
-       vector<vector<Point2f> >::const_iterator arrRightIt = rightF.begin();
-       for( int xi = 0; xi < xdim; xi++, ++arrLeftIt, ++arrRightIt )
-       {
-        CV_Assert( (int)arrLeftIt->size() ==  fcount );
-        CV_Assert( (int)arrRightIt->size() ==  fcount );
-        vector<Point2f>::const_iterator lIt = arrLeftIt->begin();
-        vector<Point2f>::const_iterator rIt = arrRightIt->begin();
-        for( int fi = 0; fi < dfdx.rows; fi+=fdim, ++lIt, ++rIt )
-        {
-            dfdx.at<double>(fi, xi )   = 0.5 * ((double)(rIt->x - lIt->x)) / eps;
-                       dfdx.at<double>(fi+1, xi ) = 0.5 * ((double)(rIt->y - lIt->y)) / eps;
-               }
-       }
-}
+void calcdfdx( const vector<vector<Point2f> >& leftF, const vector<vector<Point2f> >& rightF, double eps, Mat& dfdx )\r
+{\r
+    const int fdim = 2;\r
+       CV_Assert( !leftF.empty() && !rightF.empty() && !leftF[0].empty() && !rightF[0].empty() );\r
+       CV_Assert( leftF[0].size() ==  rightF[0].size() );\r
+       CV_Assert( fabs(eps) > std::numeric_limits<double>::epsilon() );\r
+       int fcount = leftF[0].size(), xdim = leftF.size();\r
+\r
+       dfdx.create( fcount*fdim, xdim, CV_64FC1 );\r
+\r
+       vector<vector<Point2f> >::const_iterator arrLeftIt = leftF.begin();\r
+       vector<vector<Point2f> >::const_iterator arrRightIt = rightF.begin();\r
+       for( int xi = 0; xi < xdim; xi++, ++arrLeftIt, ++arrRightIt )\r
+       {\r
+        CV_Assert( (int)arrLeftIt->size() ==  fcount );\r
+        CV_Assert( (int)arrRightIt->size() ==  fcount );\r
+        vector<Point2f>::const_iterator lIt = arrLeftIt->begin();\r
+        vector<Point2f>::const_iterator rIt = arrRightIt->begin();\r
+        for( int fi = 0; fi < dfdx.rows; fi+=fdim, ++lIt, ++rIt )\r
+        {\r
+            dfdx.at<double>(fi, xi )   = 0.5 * ((double)(rIt->x - lIt->x)) / eps;\r
+                       dfdx.at<double>(fi+1, xi ) = 0.5 * ((double)(rIt->y - lIt->y)) / eps;\r
+               }\r
+       }\r
+}\r
 \r
 class CV_ProjectPointsTest : public CvTest\r
 {\r
@@ -1003,47 +1003,47 @@ void CV_ProjectPointsTest::run(int)
     //typedef float matType;\r
 \r
        int code = CvTS::OK;\r
-       const int pointCount = 100;
+       const int pointCount = 100;\r
 \r
-       const float zMinVal = 10.0f, zMaxVal = 100.0f,
+       const float zMinVal = 10.0f, zMaxVal = 100.0f,\r
                 rMinVal = -0.3f, rMaxVal = 0.3f,\r
-                               tMinVal = -2.0f, tMaxVal = 2.0f;
-
-    const float imgPointErr = 1e-3f,
-                dEps = 1e-3f;
-
+                               tMinVal = -2.0f, tMaxVal = 2.0f;\r
+\r
+    const float imgPointErr = 1e-3f,\r
+                dEps = 1e-3f;\r
+\r
     Size imgSize( 600, 800 );\r
-    Mat_<float> objPoints( pointCount, 3), rvec( 1, 3), rmat, tvec( 1, 3 ), cameraMatrix( 3, 3 ), distCoeffs( 1, 4 ),
+    Mat_<float> objPoints( pointCount, 3), rvec( 1, 3), rmat, tvec( 1, 3 ), cameraMatrix( 3, 3 ), distCoeffs( 1, 4 ),\r
       leftRvec, rightRvec, leftTvec, rightTvec, leftCameraMatrix, rightCameraMatrix, leftDistCoeffs, rightDistCoeffs;\r
 \r
        RNG rng = *ts->get_rng();\r
 \r
        // generate data\r
-       cameraMatrix << 300.f,  0.f,    imgSize.width/2.f,
-                    0.f,    300.f,  imgSize.height/2.f,
-                    0.f,    0.f,    1.f;
-       distCoeffs << 0.1, 0.01, 0.001, 0.001;
-
-       rvec(0,0) = rng.uniform( rMinVal, rMaxVal );
-       rvec(0,1) = rng.uniform( rMinVal, rMaxVal );
-       rvec(0,2) = rng.uniform( rMinVal, rMaxVal );
-       Rodrigues( rvec, rmat );
-
-       tvec(0,0) = rng.uniform( tMinVal, tMaxVal );
-       tvec(0,1) = rng.uniform( tMinVal, tMaxVal );
-       tvec(0,2) = rng.uniform( tMinVal, tMaxVal );
-
-    for( int y = 0; y < objPoints.rows; y++ )
-       {
-           Mat point(1, 3, CV_32FC1, objPoints.ptr(y) );
-           float z = rng.uniform( zMinVal, zMaxVal );
-           point.at<float>(0,2) = z;
-        point.at<float>(0,0) = (rng.uniform(2.f,(float)(imgSize.width-2)) - cameraMatrix(0,2)) / cameraMatrix(0,0) * z;
-        point.at<float>(0,1) = (rng.uniform(2.f,(float)(imgSize.height-2)) - cameraMatrix(1,2)) / cameraMatrix(1,1) * z;
-        point = (point - tvec) * rmat;
-       }
-\r
-       vector<Point2f> imgPoints;
+       cameraMatrix << 300.f,  0.f,    imgSize.width/2.f,\r
+                    0.f,    300.f,  imgSize.height/2.f,\r
+                    0.f,    0.f,    1.f;\r
+       distCoeffs << 0.1, 0.01, 0.001, 0.001;\r
+\r
+       rvec(0,0) = rng.uniform( rMinVal, rMaxVal );\r
+       rvec(0,1) = rng.uniform( rMinVal, rMaxVal );\r
+       rvec(0,2) = rng.uniform( rMinVal, rMaxVal );\r
+       Rodrigues( rvec, rmat );\r
+\r
+       tvec(0,0) = rng.uniform( tMinVal, tMaxVal );\r
+       tvec(0,1) = rng.uniform( tMinVal, tMaxVal );\r
+       tvec(0,2) = rng.uniform( tMinVal, tMaxVal );\r
+\r
+    for( int y = 0; y < objPoints.rows; y++ )\r
+       {\r
+           Mat point(1, 3, CV_32FC1, objPoints.ptr(y) );\r
+           float z = rng.uniform( zMinVal, zMaxVal );\r
+           point.at<float>(0,2) = z;\r
+        point.at<float>(0,0) = (rng.uniform(2.f,(float)(imgSize.width-2)) - cameraMatrix(0,2)) / cameraMatrix(0,0) * z;\r
+        point.at<float>(0,1) = (rng.uniform(2.f,(float)(imgSize.height-2)) - cameraMatrix(1,2)) / cameraMatrix(1,1) * z;\r
+        point = (point - tvec) * rmat;\r
+       }\r
+\r
+       vector<Point2f> imgPoints;\r
        vector<vector<Point2f> > leftImgPoints;\r
        vector<vector<Point2f> > rightImgPoints;\r
        Mat dpdrot, dpdt, dpdf, dpdc, dpddist,\r
@@ -1056,11 +1056,11 @@ void CV_ProjectPointsTest::run(int)
     assert( (int)imgPoints.size() == pointCount );\r
        vector<Point2f>::const_iterator it = imgPoints.begin();\r
        for( int i = 0; i < pointCount; i++, ++it )\r
-       {
-           Point3d p( objPoints(i,0), objPoints(i,1), objPoints(i,2) );
-           double z = p.x*rmat(2,0) + p.y*rmat(2,1) + p.z*rmat(2,2) + tvec(0,2),
-               x = (p.x*rmat(0,0) + p.y*rmat(0,1) + p.z*rmat(0,2) + tvec(0,0)) / z,
-               y = (p.x*rmat(1,0) + p.y*rmat(1,1) + p.z*rmat(1,2) + tvec(0,1)) / z,
+       {\r
+           Point3d p( objPoints(i,0), objPoints(i,1), objPoints(i,2) );\r
+           double z = p.x*rmat(2,0) + p.y*rmat(2,1) + p.z*rmat(2,2) + tvec(0,2),\r
+               x = (p.x*rmat(0,0) + p.y*rmat(0,1) + p.z*rmat(0,2) + tvec(0,0)) / z,\r
+               y = (p.x*rmat(1,0) + p.y*rmat(1,1) + p.z*rmat(1,2) + tvec(0,1)) / z,\r
                r2 = x*x + y*y,\r
                           r4 = r2*r2;\r
                Point2f validImgPoint;\r
@@ -1068,11 +1068,11 @@ void CV_ProjectPointsTest::run(int)
                a2 = r2 + 2*x*x,\r
                a3 = r2 + 2*y*y,\r
                cdist = 1+distCoeffs(0,0)*r2+distCoeffs(0,1)*r4;\r
-               validImgPoint.x = static_cast<float>((double)cameraMatrix(0,0)*(x*cdist + (double)distCoeffs(0,2)*a1 + (double)distCoeffs(0,3)*a2)
+               validImgPoint.x = static_cast<float>((double)cameraMatrix(0,0)*(x*cdist + (double)distCoeffs(0,2)*a1 + (double)distCoeffs(0,3)*a2)\r
             + (double)cameraMatrix(0,2));\r
-               validImgPoint.y = static_cast<float>((double)cameraMatrix(1,1)*(y*cdist + (double)distCoeffs(0,2)*a3 + distCoeffs(0,3)*a1)
+               validImgPoint.y = static_cast<float>((double)cameraMatrix(1,1)*(y*cdist + (double)distCoeffs(0,2)*a3 + distCoeffs(0,3)*a1)\r
             + (double)cameraMatrix(1,2));\r
-
+\r
         Point2f ssdfp = *it;\r
         if( fabs(it->x - validImgPoint.x) > imgPointErr ||\r
             fabs(it->y - validImgPoint.y) > imgPointErr )\r
@@ -1083,15 +1083,15 @@ void CV_ProjectPointsTest::run(int)
                }\r
        }\r
 \r
-       // check derivatives
-       // 1. rotation
+       // check derivatives\r
+       // 1. rotation\r
        leftImgPoints.resize(3);\r
     rightImgPoints.resize(3);\r
        for( int i = 0; i < 3; i++ )\r
        {\r
-        rvec.copyTo( leftRvec ); leftRvec(0,i) -= dEps;
-        project( objPoints, leftRvec, tvec, cameraMatrix, distCoeffs,
-            leftImgPoints[i], valDpdrot, valDpdt, valDpdf, valDpdc, valDpddist, 0 );
+        rvec.copyTo( leftRvec ); leftRvec(0,i) -= dEps;\r
+        project( objPoints, leftRvec, tvec, cameraMatrix, distCoeffs,\r
+            leftImgPoints[i], valDpdrot, valDpdt, valDpdf, valDpdc, valDpddist, 0 );\r
         rvec.copyTo( rightRvec ); rightRvec(0,i) += dEps;\r
         project( objPoints, rightRvec, tvec, cameraMatrix, distCoeffs,\r
             rightImgPoints[i], valDpdrot, valDpdt, valDpdf, valDpdc, valDpddist, 0 );\r
@@ -1102,81 +1102,81 @@ void CV_ProjectPointsTest::run(int)
                ts->printf( CvTS::LOG, "bad dpdrot\n" );\r
                code = CvTS::FAIL_BAD_ACCURACY;\r
        }\r
-
-    // 2. translation
+\r
+    // 2. translation\r
     for( int i = 0; i < 3; i++ )\r
        {\r
         tvec.copyTo( leftTvec ); leftTvec(0,i) -= dEps;\r
         project( objPoints, rvec, leftTvec, cameraMatrix, distCoeffs,\r
-            leftImgPoints[i], valDpdrot, valDpdt, valDpdf, valDpdc, valDpddist, 0 );
-        tvec.copyTo( rightTvec ); rightTvec(0,i) += dEps;
-        project( objPoints, rvec, rightTvec, cameraMatrix, distCoeffs,
+            leftImgPoints[i], valDpdrot, valDpdt, valDpdf, valDpdc, valDpddist, 0 );\r
+        tvec.copyTo( rightTvec ); rightTvec(0,i) += dEps;\r
+        project( objPoints, rvec, rightTvec, cameraMatrix, distCoeffs,\r
             rightImgPoints[i], valDpdrot, valDpdt, valDpdf, valDpdc, valDpddist, 0 );\r
        }\r
-    calcdfdx( leftImgPoints, rightImgPoints, dEps, valDpdt );
+    calcdfdx( leftImgPoints, rightImgPoints, dEps, valDpdt );\r
     if( norm( dpdt, valDpdt, NORM_INF ) > 0.2 )\r
        {\r
                ts->printf( CvTS::LOG, "bad dpdtvec\n" );\r
                code = CvTS::FAIL_BAD_ACCURACY;\r
        }\r
-
-    // 3. camera matrix
-    // 3.1. focus
+\r
+    // 3. camera matrix\r
+    // 3.1. focus\r
     leftImgPoints.resize(2);\r
-    rightImgPoints.resize(2);
-    cameraMatrix.copyTo( leftCameraMatrix ); leftCameraMatrix(0,0) -= dEps;
-    project( objPoints, rvec, tvec, leftCameraMatrix, distCoeffs,
-        leftImgPoints[0], valDpdrot, valDpdt, valDpdf, valDpdc, valDpddist, 0 );
-    cameraMatrix.copyTo( leftCameraMatrix ); leftCameraMatrix(1,1) -= dEps;
-    project( objPoints, rvec, tvec, leftCameraMatrix, distCoeffs,
-        leftImgPoints[1], valDpdrot, valDpdt, valDpdf, valDpdc, valDpddist, 0 );
-    cameraMatrix.copyTo( rightCameraMatrix ); rightCameraMatrix(0,0) += dEps;
-    project( objPoints, rvec, tvec, rightCameraMatrix, distCoeffs,
-        rightImgPoints[0], valDpdrot, valDpdt, valDpdf, valDpdc, valDpddist, 0 );
-    cameraMatrix.copyTo( rightCameraMatrix ); rightCameraMatrix(1,1) += dEps;
-    project( objPoints, rvec, tvec, rightCameraMatrix, distCoeffs,
-        rightImgPoints[1], valDpdrot, valDpdt, valDpdf, valDpdc, valDpddist, 0 );
-    calcdfdx( leftImgPoints, rightImgPoints, dEps, valDpdf );
-    if ( norm( dpdf, valDpdf ) > 0.2 )
-    {
-        ts->printf( CvTS::LOG, "bad dpdf\n" );
-        code = CvTS::FAIL_BAD_ACCURACY;
-    }
-    // 3.2. principal point
-    leftImgPoints.resize(2);
-    rightImgPoints.resize(2);
-    cameraMatrix.copyTo( leftCameraMatrix ); leftCameraMatrix(0,2) -= dEps;
-    project( objPoints, rvec, tvec, leftCameraMatrix, distCoeffs,
-        leftImgPoints[0], valDpdrot, valDpdt, valDpdf, valDpdc, valDpddist, 0 );
-    cameraMatrix.copyTo( leftCameraMatrix ); leftCameraMatrix(1,2) -= dEps;
-    project( objPoints, rvec, tvec, leftCameraMatrix, distCoeffs,
-        leftImgPoints[1], valDpdrot, valDpdt, valDpdf, valDpdc, valDpddist, 0 );
-    cameraMatrix.copyTo( rightCameraMatrix ); rightCameraMatrix(0,2) += dEps;
-    project( objPoints, rvec, tvec, rightCameraMatrix, distCoeffs,
-        rightImgPoints[0], valDpdrot, valDpdt, valDpdf, valDpdc, valDpddist, 0 );
-    cameraMatrix.copyTo( rightCameraMatrix ); rightCameraMatrix(1,2) += dEps;
-    project( objPoints, rvec, tvec, rightCameraMatrix, distCoeffs,
-        rightImgPoints[1], valDpdrot, valDpdt, valDpdf, valDpdc, valDpddist, 0 );
-    calcdfdx( leftImgPoints, rightImgPoints, dEps, valDpdc );
-    if ( norm( dpdc, valDpdc ) > 0.2 )
-    {
-        ts->printf( CvTS::LOG, "bad dpdc\n" );
-        code = CvTS::FAIL_BAD_ACCURACY;
+    rightImgPoints.resize(2);\r
+    cameraMatrix.copyTo( leftCameraMatrix ); leftCameraMatrix(0,0) -= dEps;\r
+    project( objPoints, rvec, tvec, leftCameraMatrix, distCoeffs,\r
+        leftImgPoints[0], valDpdrot, valDpdt, valDpdf, valDpdc, valDpddist, 0 );\r
+    cameraMatrix.copyTo( leftCameraMatrix ); leftCameraMatrix(1,1) -= dEps;\r
+    project( objPoints, rvec, tvec, leftCameraMatrix, distCoeffs,\r
+        leftImgPoints[1], valDpdrot, valDpdt, valDpdf, valDpdc, valDpddist, 0 );\r
+    cameraMatrix.copyTo( rightCameraMatrix ); rightCameraMatrix(0,0) += dEps;\r
+    project( objPoints, rvec, tvec, rightCameraMatrix, distCoeffs,\r
+        rightImgPoints[0], valDpdrot, valDpdt, valDpdf, valDpdc, valDpddist, 0 );\r
+    cameraMatrix.copyTo( rightCameraMatrix ); rightCameraMatrix(1,1) += dEps;\r
+    project( objPoints, rvec, tvec, rightCameraMatrix, distCoeffs,\r
+        rightImgPoints[1], valDpdrot, valDpdt, valDpdf, valDpdc, valDpddist, 0 );\r
+    calcdfdx( leftImgPoints, rightImgPoints, dEps, valDpdf );\r
+    if ( norm( dpdf, valDpdf ) > 0.2 )\r
+    {\r
+        ts->printf( CvTS::LOG, "bad dpdf\n" );\r
+        code = CvTS::FAIL_BAD_ACCURACY;\r
     }\r
-
+    // 3.2. principal point\r
+    leftImgPoints.resize(2);\r
+    rightImgPoints.resize(2);\r
+    cameraMatrix.copyTo( leftCameraMatrix ); leftCameraMatrix(0,2) -= dEps;\r
+    project( objPoints, rvec, tvec, leftCameraMatrix, distCoeffs,\r
+        leftImgPoints[0], valDpdrot, valDpdt, valDpdf, valDpdc, valDpddist, 0 );\r
+    cameraMatrix.copyTo( leftCameraMatrix ); leftCameraMatrix(1,2) -= dEps;\r
+    project( objPoints, rvec, tvec, leftCameraMatrix, distCoeffs,\r
+        leftImgPoints[1], valDpdrot, valDpdt, valDpdf, valDpdc, valDpddist, 0 );\r
+    cameraMatrix.copyTo( rightCameraMatrix ); rightCameraMatrix(0,2) += dEps;\r
+    project( objPoints, rvec, tvec, rightCameraMatrix, distCoeffs,\r
+        rightImgPoints[0], valDpdrot, valDpdt, valDpdf, valDpdc, valDpddist, 0 );\r
+    cameraMatrix.copyTo( rightCameraMatrix ); rightCameraMatrix(1,2) += dEps;\r
+    project( objPoints, rvec, tvec, rightCameraMatrix, distCoeffs,\r
+        rightImgPoints[1], valDpdrot, valDpdt, valDpdf, valDpdc, valDpddist, 0 );\r
+    calcdfdx( leftImgPoints, rightImgPoints, dEps, valDpdc );\r
+    if ( norm( dpdc, valDpdc ) > 0.2 )\r
+    {\r
+        ts->printf( CvTS::LOG, "bad dpdc\n" );\r
+        code = CvTS::FAIL_BAD_ACCURACY;\r
+    }\r
+\r
     // 4. distortion\r
-    leftImgPoints.resize(distCoeffs.cols);
+    leftImgPoints.resize(distCoeffs.cols);\r
     rightImgPoints.resize(distCoeffs.cols);\r
        for( int i = 0; i < distCoeffs.cols; i++ )\r
        {\r
         distCoeffs.copyTo( leftDistCoeffs ); leftDistCoeffs(0,i) -= dEps;\r
         project( objPoints, rvec, tvec, cameraMatrix, leftDistCoeffs,\r
-            leftImgPoints[i], valDpdrot, valDpdt, valDpdf, valDpdc, valDpddist, 0 );
-        distCoeffs.copyTo( rightDistCoeffs ); rightDistCoeffs(0,i) += dEps;
-        project( objPoints, rvec, tvec, cameraMatrix, rightDistCoeffs,
+            leftImgPoints[i], valDpdrot, valDpdt, valDpdf, valDpdc, valDpddist, 0 );\r
+        distCoeffs.copyTo( rightDistCoeffs ); rightDistCoeffs(0,i) += dEps;\r
+        project( objPoints, rvec, tvec, cameraMatrix, rightDistCoeffs,\r
             rightImgPoints[i], valDpdrot, valDpdt, valDpdf, valDpdc, valDpddist, 0 );\r
        }\r
-    calcdfdx( leftImgPoints, rightImgPoints, dEps, valDpddist );
+    calcdfdx( leftImgPoints, rightImgPoints, dEps, valDpddist );\r
     if( norm( dpddist, valDpddist ) > 0.3 )\r
        {\r
                ts->printf( CvTS::LOG, "bad dpddist\n" );\r
@@ -1188,44 +1188,44 @@ _exit_:
        *_rng = rng.state;\r
        ts->set_failed_test_info( code );\r
 }\r
-
-//----------------------------------------- CV_ProjectPointsTest_C --------------------------------
-class CV_ProjectPointsTest_C : public CV_ProjectPointsTest
-{
-public:
-       CV_ProjectPointsTest_C() :
-        CV_ProjectPointsTest( "projectPoints-c", "cvProjectPoints" ) {}
-protected:
-       virtual void project( const Mat& objectPoints,
-               const Mat& rvec, const Mat& tvec,
-               const Mat& cameraMatrix,
-               const Mat& distCoeffs,
-               vector<Point2f>& imagePoints,
-               Mat& dpdrot, Mat& dpdt, Mat& dpdf,
-               Mat& dpdc, Mat& dpddist,
-               double aspectRatio=0 );
-};
-
-void CV_ProjectPointsTest_C::project( const Mat& opoints, const Mat& rvec, const Mat& tvec,
-                                                                          const Mat& cameraMatrix, const Mat& distCoeffs, vector<Point2f>& ipoints,
-                                                                          Mat& dpdrot, Mat& dpdt, Mat& dpdf, Mat& dpdc, Mat& dpddist, double aspectRatio)
-{
-    int npoints = opoints.cols*opoints.rows*opoints.channels()/3;
-    ipoints.resize(npoints);
-    dpdrot.create(npoints*2, 3, CV_64F);
-    dpdt.create(npoints*2, 3, CV_64F);
-    dpdf.create(npoints*2, 2, CV_64F);
-    dpdc.create(npoints*2, 2, CV_64F);
-    dpddist.create(npoints*2, distCoeffs.rows + distCoeffs.cols - 1, CV_64F);
-    CvMat _objectPoints = opoints, _imagePoints = Mat(ipoints);
-    CvMat _rvec = rvec, _tvec = tvec, _cameraMatrix = cameraMatrix, _distCoeffs = distCoeffs;
-    CvMat _dpdrot = dpdrot, _dpdt = dpdt, _dpdf = dpdf, _dpdc = dpdc, _dpddist = dpddist;
-
-       cvProjectPoints2( &_objectPoints, &_rvec, &_tvec, &_cameraMatrix, &_distCoeffs,
-                      &_imagePoints, &_dpdrot, &_dpdt, &_dpdf, &_dpdc, &_dpddist, aspectRatio );
-}
-
-CV_ProjectPointsTest_C projectPointsTest_c;
+\r
+//----------------------------------------- CV_ProjectPointsTest_C --------------------------------\r
+class CV_ProjectPointsTest_C : public CV_ProjectPointsTest\r
+{\r
+public:\r
+       CV_ProjectPointsTest_C() :\r
+        CV_ProjectPointsTest( "projectPoints-c", "cvProjectPoints" ) {}\r
+protected:\r
+       virtual void project( const Mat& objectPoints,\r
+               const Mat& rvec, const Mat& tvec,\r
+               const Mat& cameraMatrix,\r
+               const Mat& distCoeffs,\r
+               vector<Point2f>& imagePoints,\r
+               Mat& dpdrot, Mat& dpdt, Mat& dpdf,\r
+               Mat& dpdc, Mat& dpddist,\r
+               double aspectRatio=0 );\r
+};\r
+\r
+void CV_ProjectPointsTest_C::project( const Mat& opoints, const Mat& rvec, const Mat& tvec,\r
+                                                                          const Mat& cameraMatrix, const Mat& distCoeffs, vector<Point2f>& ipoints,\r
+                                                                          Mat& dpdrot, Mat& dpdt, Mat& dpdf, Mat& dpdc, Mat& dpddist, double aspectRatio)\r
+{\r
+    int npoints = opoints.cols*opoints.rows*opoints.channels()/3;\r
+    ipoints.resize(npoints);\r
+    dpdrot.create(npoints*2, 3, CV_64F);\r
+    dpdt.create(npoints*2, 3, CV_64F);\r
+    dpdf.create(npoints*2, 2, CV_64F);\r
+    dpdc.create(npoints*2, 2, CV_64F);\r
+    dpddist.create(npoints*2, distCoeffs.rows + distCoeffs.cols - 1, CV_64F);\r
+    CvMat _objectPoints = opoints, _imagePoints = Mat(ipoints);\r
+    CvMat _rvec = rvec, _tvec = tvec, _cameraMatrix = cameraMatrix, _distCoeffs = distCoeffs;\r
+    CvMat _dpdrot = dpdrot, _dpdt = dpdt, _dpdf = dpdf, _dpdc = dpdc, _dpddist = dpddist;\r
+\r
+       cvProjectPoints2( &_objectPoints, &_rvec, &_tvec, &_cameraMatrix, &_distCoeffs,\r
+                      &_imagePoints, &_dpdrot, &_dpdt, &_dpdf, &_dpdc, &_dpddist, aspectRatio );\r
+}\r
+\r
+CV_ProjectPointsTest_C projectPointsTest_c;\r
 \r
 //----------------------------------------- CV_ProjectPointsTest_CPP --------------------------------\r
 class CV_ProjectPointsTest_CPP : public CV_ProjectPointsTest\r
@@ -1251,7 +1251,7 @@ void CV_ProjectPointsTest_CPP::project( const Mat& objectPoints, const Mat& rvec
        projectPoints( objectPoints, rvec, tvec, cameraMatrix, distCoeffs, imagePoints,\r
                dpdrot, dpdt, dpdf, dpdc, dpddist, aspectRatio );\r
 }\r
-
+\r
 CV_ProjectPointsTest_CPP projectPointsTest_cpp;\r
 \r
 ///////////////////////////////// Stereo Calibration /////////////////////////////////////\r
@@ -1504,9 +1504,9 @@ void CV_StereoCalibrationTest::run( int )
                undistortPoints( _imgpt1, _imgpt1, _M1, _D1, Mat(), _M1 );\r
                undistortPoints( _imgpt2, _imgpt2, _M2, _D2, Mat(), _M2 );\r
 \r
-               Mat _F, _H1, _H2;\r
-               _F = findFundamentalMat( _imgpt1, _imgpt2 );\r
-               rectifyUncalibrated( _imgpt1, _imgpt2, _F, imgsize, _H1, _H2 );\r
+               Mat matF, _H1, _H2;\r
+               matF = findFundamentalMat( _imgpt1, _imgpt2 );\r
+               rectifyUncalibrated( _imgpt1, _imgpt2, matF, imgsize, _H1, _H2 );\r
 \r
                Mat rectifPoints1, rectifPoints2;\r
                perspectiveTransform( _imgpt1, rectifPoints1, _H1 );\r
@@ -1617,11 +1617,11 @@ double CV_StereoCalibrationTest_C::calibrateStereoCamera( const vector<vector<Po
        CvMat _objPt = objPt, _imgPt = imgPt, _imgPt2 = imgPt2, _npoints = npoints;\r
        CvMat _cameraMatrix1 = cameraMatrix1, _distCoeffs1 = distCoeffs1;\r
        CvMat _cameraMatrix2 = cameraMatrix2, _distCoeffs2 = distCoeffs2;\r
-       CvMat _R = R, _T = T, _E = E, _F = F;\r
+       CvMat matR = R, matT = T, matE = E, matF = F;\r
 \r
        return cvStereoCalibrate(&_objPt, &_imgPt, &_imgPt2, &_npoints, &_cameraMatrix1,\r
                &_distCoeffs1, &_cameraMatrix2, &_distCoeffs2, imageSize,\r
-               &_R, &_T, &_E, &_F, criteria, flags );\r
+               &matR, &matT, &matE, &matF, criteria, flags );\r
 }\r
 \r
 void CV_StereoCalibrationTest_C::rectify( const Mat& cameraMatrix1, const Mat& distCoeffs1,\r
@@ -1639,9 +1639,9 @@ void CV_StereoCalibrationTest_C::rectify( const Mat& cameraMatrix1, const Mat& d
        Q.create(4, 4, rtype);\r
        CvMat _cameraMatrix1 = cameraMatrix1, _distCoeffs1 = distCoeffs1;\r
        CvMat _cameraMatrix2 = cameraMatrix2, _distCoeffs2 = distCoeffs2;\r
-       CvMat _R = R, _T = T, _R1 = R1, _R2 = R2, _P1 = P1, _P2 = P2, _Q = Q;\r
+       CvMat matR = R, matT = T, _R1 = R1, _R2 = R2, _P1 = P1, _P2 = P2, matQ = Q;\r
        cvStereoRectify( &_cameraMatrix1, &_cameraMatrix2, &_distCoeffs1, &_distCoeffs2,\r
-               imageSize, &_R, &_T, &_R1, &_R2, &_P1, &_P2, &_Q, flags,\r
+               imageSize, &matR, &matT, &_R1, &_R2, &_P1, &_P2, &matQ, flags,\r
                alpha, newImageSize, (CvRect*)validPixROI1, (CvRect*)validPixROI2);\r
 }\r
 \r
@@ -1650,9 +1650,9 @@ bool CV_StereoCalibrationTest_C::rectifyUncalibrated( const Mat& points1,
 {\r
        H1.create(3, 3, CV_64F);\r
        H2.create(3, 3, CV_64F);\r
-       CvMat _pt1 = points1, _pt2 = points2, _F, *pF=0, _H1 = H1, _H2 = H2;\r
+       CvMat _pt1 = points1, _pt2 = points2, matF, *pF=0, _H1 = H1, _H2 = H2;\r
        if( F.size() == Size(3, 3) )\r
-               pF = &(_F = F);\r
+               pF = &(matF = F);\r
        return cvStereoRectifyUncalibrated(&_pt1, &_pt2, pF, imgSize, &_H1, &_H2, threshold) > 0;\r
 }\r
 \r
@@ -1715,4 +1715,4 @@ bool CV_StereoCalibrationTest_CPP::rectifyUncalibrated( const Mat& points1,
 }\r
 \r
 CV_StereoCalibrationTest_CPP stereocalib_test_cpp;\r
-
+\r
index 7922d481eed55c9ddbcc03c21c2fb8d768d0634e..e01912ddad647ecf37dd4311a9fc84c5b7d8c7ce 100644 (file)
@@ -47,7 +47,7 @@ int cvTsRodrigues( const CvMat* src, CvMat* dst, CvMat* jacobian )
     int i;
     float Jf[27];
     double J[27];
-    CvMat _Jf, _J = cvMat( 3, 9, CV_64F, J );
+    CvMat _Jf, matJ = cvMat( 3, 9, CV_64F, J );
 
     depth = CV_MAT_DEPTH(src->type);
 
@@ -100,13 +100,13 @@ int cvTsRodrigues( const CvMat* src, CvMat* dst, CvMat* jacobian )
             };
             double R[9];
             CvMat _omegav = cvMat(3, 3, CV_64F, omegav);
-            CvMat _A = cvMat(3, 3, CV_64F, A);
-            CvMat _R = cvMat(3, 3, CV_64F, R);
+            CvMat matA = cvMat(3, 3, CV_64F, A);
+            CvMat matR = cvMat(3, 3, CV_64F, R);
 
-            cvSetIdentity( &_R, cvRealScalar(alpha) );
-            cvScaleAdd( &_omegav, cvRealScalar(beta), &_R, &_R );
-            cvScaleAdd( &_A, cvRealScalar(gamma), &_R, &_R );
-            cvConvert( &_R, dst );
+            cvSetIdentity( &matR, cvRealScalar(alpha) );
+            cvScaleAdd( &_omegav, cvRealScalar(beta), &matR, &matR );
+            cvScaleAdd( &matA, cvRealScalar(gamma), &matR, &matR );
+            cvConvert( &matR, dst );
 
             if( jacobian )
             {
@@ -173,8 +173,8 @@ int cvTsRodrigues( const CvMat* src, CvMat* dst, CvMat* jacobian )
                 cvTranspose( &_omegav, &_dRdm1_part );
 
                 cvGetCol( &_dRdm1, &_dRdm1_part, 2 );
-                cvReshape( &_A, &_A, 1, 1 );
-                cvTranspose( &_A, &_dRdm1_part );
+                cvReshape( &matA, &matA, 1, 1 );
+                cvTranspose( &matA, &_dRdm1_part );
 
                 cvGetSubRect( &_dRdm1, &_dRdm1_part, cvRect(3,0,9,9) );
                 cvSetIdentity( &_dRdm1_part, cvScalarAll(beta) );
@@ -182,14 +182,14 @@ int cvTsRodrigues( const CvMat* src, CvMat* dst, CvMat* jacobian )
                 cvGetSubRect( &_dRdm1, &_dRdm1_part, cvRect(12,0,9,9) );
                 cvSetIdentity( &_dRdm1_part, cvScalarAll(gamma) );
 
-                _J = cvMat( 9, 3, CV_64FC1, J );
+                matJ = cvMat( 9, 3, CV_64FC1, J );
 
                 cvMatMul( &_dRdm1, &_dm1dm2, &_t0 );
                 cvMatMul( &_t0, &_dm2dm3, &_t1 );
-                cvMatMul( &_t1, &_dm3din, &_J );
+                cvMatMul( &_t1, &_dm3din, &matJ );
 
                 _t0 = cvMat( 3, 9, CV_64FC1, t0 );
-                cvTranspose( &_J, &_t0 );
+                cvTranspose( &matJ, &_t0 );
 
                 for( i = 0; i < 3; i++ )
                 {
@@ -197,7 +197,7 @@ int cvTsRodrigues( const CvMat* src, CvMat* dst, CvMat* jacobian )
                     cvTranspose( &_t1, &_t1 );
                 }
 
-                cvTranspose( &_t0, &_J );
+                cvTranspose( &_t0, &matJ );
             }
         }
     }
@@ -205,26 +205,26 @@ int cvTsRodrigues( const CvMat* src, CvMat* dst, CvMat* jacobian )
     {
         double R[9], A[9], I[9], r[3], W[3], U[9], V[9];
         double tr, alpha, beta, theta;
-        CvMat _R = cvMat( 3, 3, CV_64F, R );
-        CvMat _A = cvMat( 3, 3, CV_64F, A );
-        CvMat _I = cvMat( 3, 3, CV_64F, I );
+        CvMat matR = cvMat( 3, 3, CV_64F, R );
+        CvMat matA = cvMat( 3, 3, CV_64F, A );
+        CvMat matI = cvMat( 3, 3, CV_64F, I );
         CvMat _r = cvMat( dst->rows, dst->cols, CV_MAKETYPE(CV_64F, CV_MAT_CN(dst->type)), r );
-        CvMat _W = cvMat( 1, 3, CV_64F, W );
-        CvMat _U = cvMat( 3, 3, CV_64F, U );
-        CvMat _V = cvMat( 3, 3, CV_64F, V );
+        CvMat matW = cvMat( 1, 3, CV_64F, W );
+        CvMat matU = cvMat( 3, 3, CV_64F, U );
+        CvMat matV = cvMat( 3, 3, CV_64F, V );
 
-        cvConvert( src, &_R );
-        cvSVD( &_R, &_W, &_U, &_V, CV_SVD_MODIFY_A + CV_SVD_U_T + CV_SVD_V_T );
-        cvGEMM( &_U, &_V, 1, 0, 0, &_R, CV_GEMM_A_T );
+        cvConvert( src, &matR );
+        cvSVD( &matR, &matW, &matU, &matV, CV_SVD_MODIFY_A + CV_SVD_U_T + CV_SVD_V_T );
+        cvGEMM( &matU, &matV, 1, 0, 0, &matR, CV_GEMM_A_T );
 
-        cvMulTransposed( &_R, &_A, 0 );
-        cvSetIdentity( &_I );
+        cvMulTransposed( &matR, &matA, 0 );
+        cvSetIdentity( &matI );
 
-        if( cvNorm( &_A, &_I, CV_C ) > 1e-3 ||
-            fabs( cvDet(&_R) - 1 ) > 1e-3 )
+        if( cvNorm( &matA, &matI, CV_C ) > 1e-3 ||
+            fabs( cvDet(&matR) - 1 ) > 1e-3 )
             return 0;
 
-        tr = (cvTrace(&_R).val[0] - 1.)*0.5;
+        tr = (cvTrace(&matR).val[0] - 1.)*0.5;
         tr = tr > 1. ? 1. : tr < -1. ? -1. : tr;
         theta = acos(tr);
         alpha = cos(theta);
@@ -282,7 +282,7 @@ int cvTsRodrigues( const CvMat* src, CvMat* dst, CvMat* jacobian )
                 CvMat _t0 = cvMat( 3, 5, CV_64FC1, t0 );
 
                 cvMatMul( &_domegadvar2, &_dvar2dvar, &_t0 );
-                cvMatMul( &_t0, &_dvardR, &_J );
+                cvMatMul( &_t0, &_dvardR, &matJ );
             }
         }
         else if( tr > 0 )
@@ -325,19 +325,19 @@ int cvTsRodrigues( const CvMat* src, CvMat* dst, CvMat* jacobian )
     {
         if( depth == CV_32F )
         {
-            if( jacobian->rows == _J.rows )
-                cvConvert( &_J, jacobian );
+            if( jacobian->rows == matJ.rows )
+                cvConvert( &matJ, jacobian );
             else
             {
-                _Jf = cvMat( _J.rows, _J.cols, CV_32FC1, Jf );
-                cvConvert( &_J, &_Jf );
+                _Jf = cvMat( matJ.rows, matJ.cols, CV_32FC1, Jf );
+                cvConvert( &matJ, &_Jf );
                 cvTranspose( &_Jf, jacobian );
             }
         }
-        else if( jacobian->rows == _J.rows )
-            cvCopy( &_J, jacobian );
+        else if( jacobian->rows == matJ.rows )
+            cvCopy( &matJ, jacobian );
         else
-            cvTranspose( &_J, jacobian );
+            cvTranspose( &matJ, jacobian );
     }
 
     return 1;
index f52f0c41960dc2a1205be2b39e357fb8693d0033..264ce56cf484f9dfd772b80eff6aa776b0c3412e 100644 (file)
@@ -168,7 +168,7 @@ protected:
        void run_func();
        void cvTsDistortPoints(const CvMat* _src, CvMat* _dst, const CvMat* _cameraMatrix,
                const CvMat* _distCoeffs,
-               const CvMat* _R, const CvMat* _P);
+               const CvMat* matR, const CvMat* matP);
 
 private:
        bool useCPlus;
@@ -501,18 +501,18 @@ void CV_UndistortPointsTest::run_func()
 
 void CV_UndistortPointsTest::cvTsDistortPoints(const CvMat* _src, CvMat* _dst, const CvMat* _cameraMatrix,
                                                                                           const CvMat* _distCoeffs,
-                                                                                          const CvMat* _R, const CvMat* _P)
+                                                                                          const CvMat* matR, const CvMat* matP)
 {
        double a[9];
 
        CvMat* __P;
-       if ((!_P)||(_P->cols == 3))
+       if ((!matP)||(matP->cols == 3))
                __P = cvCreateMat(3,3,CV_64F);
        else
                __P = cvCreateMat(3,4,CV_64F);
-       if (_P)
+       if (matP)
        {
-               cvTsConvert(_P,__P);
+               cvTsConvert(matP,__P);
        }
        else
        {
@@ -522,9 +522,9 @@ void CV_UndistortPointsTest::cvTsDistortPoints(const CvMat* _src, CvMat* _dst, c
                __P->data.db[8] = 1;
        }
        CvMat* __R = cvCreateMat(3,3,CV_64F);;
-       if (_R)
+       if (matR)
        {
-               cvCopy(_R,__R);
+               cvCopy(matR,__R);
        }
        else
        {
index a0c21244f84cacac3c6688b825faa0fed0701894..4439b44c90d34afec699a599d1571f84bd6ebcee 100644 (file)
@@ -57,8 +57,8 @@ private:
 
        //C
        CvMat* _camera_mat;
-       CvMat* _R;
-       CvMat* _P;
+       CvMat* matR;
+       CvMat* matP;
        CvMat* _distortion_coeffs;
        CvMat* _src_points;
        CvMat* _dst_points;
@@ -88,7 +88,7 @@ void CV_UndistortPointsBadArgTest::run_func()
        }
        else
        {
-               cvUndistortPoints(_src_points,_dst_points,_camera_mat,_distortion_coeffs,_R,_P);
+               cvUndistortPoints(_src_points,_dst_points,_camera_mat,_distortion_coeffs,matR,matP);
        }
 }
 
@@ -116,8 +116,8 @@ void CV_UndistortPointsBadArgTest::run(int)
 
        _camera_mat = &_camera_mat_orig;
        _distortion_coeffs = &_distortion_coeffs_orig;
-       _P = &_P_orig;
-       _R = &_R_orig;
+       matP = &_P_orig;
+       matR = &_R_orig;
        _src_points = &_src_points_orig; 
        _dst_points = &_dst_points_orig; 
 
@@ -207,38 +207,38 @@ void CV_UndistortPointsBadArgTest::run(int)
        cvReleaseMat(&temp);
 //----------
        temp = (CvMat*)temp_img;
-       _R = temp;
+       matR = temp;
        errcount += run_test_case( CV_StsAssert, "R data is not CvMat*" ); 
-       _R = &_R_orig; 
+       matR = &_R_orig; 
 
        temp = cvCreateMat(4,3,CV_64F);
-       _R = temp;
+       matR = temp;
        errcount += run_test_case( CV_StsAssert, "Invalid R data matrix size" ); 
-       _R = &_R_orig; 
+       matR = &_R_orig; 
        cvReleaseMat(&temp);
 
        temp = cvCreateMat(3,2,CV_64F);
-       _R = temp;
+       matR = temp;
        errcount += run_test_case( CV_StsAssert, "Invalid R data matrix size" ); 
-       _R = &_R_orig; 
+       matR = &_R_orig; 
        cvReleaseMat(&temp);
 
 //-----------
        temp = (CvMat*)temp_img;
-       _P = temp;
+       matP = temp;
        errcount += run_test_case( CV_StsAssert, "P data is not CvMat*" ); 
-       _P = &_P_orig; 
+       matP = &_P_orig; 
 
        temp = cvCreateMat(4,3,CV_64F);
-       _P = temp;
+       matP = temp;
        errcount += run_test_case( CV_StsAssert, "Invalid P data matrix size" ); 
-       _P = &_P_orig; 
+       matP = &_P_orig; 
        cvReleaseMat(&temp);
 
        temp = cvCreateMat(3,2,CV_64F);
-       _P = temp;
+       matP = temp;
        errcount += run_test_case( CV_StsAssert, "Invalid P data matrix size" ); 
-       _P = &_P_orig; 
+       matP = &_P_orig; 
        cvReleaseMat(&temp);
 //------------
        //C++ tests
@@ -291,7 +291,7 @@ private:
 
        //C
        CvMat* _camera_mat;
-       CvMat* _R;
+       CvMat* matR;
        CvMat* _new_camera_mat;
        CvMat* _distortion_coeffs;
        CvMat* _mapx;
@@ -323,7 +323,7 @@ void CV_InitUndistortRectifyMapBadArgTest::run_func()
        }
        else
        {
-               cvInitUndistortRectifyMap(_camera_mat,_distortion_coeffs,_R,_new_camera_mat,_mapx,_mapy);
+               cvInitUndistortRectifyMap(_camera_mat,_distortion_coeffs,matR,_new_camera_mat,_mapx,_mapy);
        }
 }
 
@@ -351,7 +351,7 @@ void CV_InitUndistortRectifyMapBadArgTest::run(int)
        _camera_mat = &_camera_mat_orig;
        _distortion_coeffs = &_distortion_coeffs_orig;
        _new_camera_mat = &_new_camera_mat_orig;
-       _R = &_R_orig;
+       matR = &_R_orig;
        _mapx = &_mapx_orig; 
        _mapy = &_mapy_orig; 
        mat_type = mat_type_orig;
index 8e93b3951ea11d2c93ad672d96e7468d7888fe11..e5f56d3656876d6e8c4d5a967746a4305cd0a0d8 100644 (file)
@@ -169,7 +169,7 @@ void CV_ArrayOpTest::run( int /* start_from */)
     {
     int sz3[] = {5, 10, 15};
     MatND A(3, sz3, CV_32F), B(3, sz3, CV_16SC4);
-    CvMatND _A = A, _B = B;
+    CvMatND matA = A, matB = B;
     RNG rng;
     rng.fill(A, CV_RAND_UNI, Scalar::all(-10), Scalar::all(10));
     rng.fill(B, CV_RAND_UNI, Scalar::all(-10), Scalar::all(10));
@@ -177,21 +177,21 @@ void CV_ArrayOpTest::run( int /* start_from */)
     int idx0[] = {3,4,5}, idx1[] = {0, 9, 7};
     float val0 = 130;
     Scalar val1(-1000, 30, 3, 8);
-    cvSetRealND(&_A, idx0, val0);
-    cvSetReal3D(&_A, idx1[0], idx1[1], idx1[2], -val0);
-    cvSetND(&_B, idx0, val1);
-    cvSet3D(&_B, idx1[0], idx1[1], idx1[2], -val1);
-    Ptr<CvMatND> _C = cvCloneMatND(&_B);
+    cvSetRealND(&matA, idx0, val0);
+    cvSetReal3D(&matA, idx1[0], idx1[1], idx1[2], -val0);
+    cvSetND(&matB, idx0, val1);
+    cvSet3D(&matB, idx1[0], idx1[1], idx1[2], -val1);
+    Ptr<CvMatND> matC = cvCloneMatND(&matB);
     
     if( A.at<float>(idx0[0], idx0[1], idx0[2]) != val0 ||
         A.at<float>(idx1[0], idx1[1], idx1[2]) != -val0 ||
-        cvGetReal3D(&_A, idx0[0], idx0[1], idx0[2]) != val0 ||
-        cvGetRealND(&_A, idx1) != -val0 ||
+        cvGetReal3D(&matA, idx0[0], idx0[1], idx0[2]) != val0 ||
+        cvGetRealND(&matA, idx1) != -val0 ||
         
         Scalar(B.at<Vec4s>(idx0[0], idx0[1], idx0[2])) != val1 ||
         Scalar(B.at<Vec4s>(idx1[0], idx1[1], idx1[2])) != -val1 ||
-        Scalar(cvGet3D(_C, idx0[0], idx0[1], idx0[2])) != val1 ||
-        Scalar(cvGetND(_C, idx1)) != -val1 )
+        Scalar(cvGet3D(matC, idx0[0], idx0[1], idx0[2])) != val1 ||
+        Scalar(cvGetND(matC, idx1)) != -val1 )
     {
         ts->printf(CvTS::LOG, "one of cvSetReal3D, cvSetRealND, cvSet3D, cvSetND "
                               "or the corresponding *Get* functions is not correct\n");