50 #ifndef __OPENCV_COMPAT_HPP__
51 #define __OPENCV_COMPAT_HPP__
106 #define cvCreateImageData cvCreateData
107 #define cvReleaseImageData cvReleaseData
108 #define cvSetImageData cvSetData
109 #define cvGetImageRawData cvGetRawData
111 #define cvmAlloc cvCreateData
112 #define cvmFree cvReleaseData
113 #define cvmAllocArray cvCreateData
114 #define cvmFreeArray cvReleaseData
116 #define cvIntegralImage cvIntegral
117 #define cvMatchContours cvMatchShapes
122 #define cvUpdateMHIByTime cvUpdateMotionHistory
124 #define cvAccMask cvAcc
125 #define cvSquareAccMask cvSquareAcc
126 #define cvMultiplyAccMask cvMultiplyAcc
127 #define cvRunningAvgMask(imgY, imgU, mask, alpha) cvRunningAvg(imgY, imgU, alpha, mask)
129 #define cvSetHistThresh cvSetHistBinRanges
130 #define cvCalcHistMask(img, mask, hist, doNotClear) cvCalcHist(img, hist, doNotClear, mask)
140 #define cvCvtPixToPlane cvSplit
141 #define cvCvtPlaneToPix cvMerge
155 double param2,
int seed,
161 #define cvRandNext( _state ) cvRandInt( &(_state)->state )
166 float*
magnitude,
float* angle,
int len );
177 #define cvPseudoInv cvPseudoInverse
179 #define cvContourMoments( contour, moments ) cvMoments( contour, moments, 0 )
181 #define cvGetPtrAt cvPtr2D
182 #define cvGetAt cvGet2D
183 #define cvSetAt(arr,val,y,x) cvSet2D((arr),(y),(x),(val))
185 #define cvMeanMask cvMean
186 #define cvMean_StdDevMask(img,mask,mean,sdv) cvMean_StdDev(img,mean,sdv,mask)
188 #define cvNormMask(imgA,imgB,mask,normType) cvNorm(imgA,imgB,normType,mask)
190 #define cvMinMaxLocMask(img, mask, min_val, max_val, min_loc, max_loc) \
191 cvMinMaxLoc(img, min_val, max_val, min_loc, max_loc, mask)
193 #define cvRemoveMemoryManager cvSetMemoryManager
195 #define cvmSetZero( mat ) cvSetZero( mat )
196 #define cvmSetIdentity( mat ) cvSetIdentity( mat )
197 #define cvmAdd( src1, src2, dst ) cvAdd( src1, src2, dst, 0 )
198 #define cvmSub( src1, src2, dst ) cvSub( src1, src2, dst, 0 )
199 #define cvmCopy( src, dst ) cvCopy( src, dst, 0 )
200 #define cvmMul( src1, src2, dst ) cvMatMulAdd( src1, src2, 0, dst )
201 #define cvmTranspose( src, dst ) cvT( src, dst )
202 #define cvmInvert( src, dst ) cvInv( src, dst )
203 #define cvmMahalanobis(vec1, vec2, mat) cvMahalanobis( vec1, vec2, mat )
204 #define cvmDotProduct( vec1, vec2 ) cvDotProduct( vec1, vec2 )
205 #define cvmCrossProduct(vec1, vec2,dst) cvCrossProduct( vec1, vec2, dst )
206 #define cvmTrace( mat ) (cvTrace( mat )).val[0]
207 #define cvmMulTransposed( src, dst, order ) cvMulTransposed( src, dst, order )
208 #define cvmEigenVV( mat, evec, eval, eps) cvEigenVV( mat, evec, eval, eps )
209 #define cvmDet( mat ) cvDet( mat )
210 #define cvmScale( src, dst, scale ) cvScale( src, dst, scale )
212 #define cvCopyImage( src, dst ) cvCopy( src, dst, 0 )
213 #define cvReleaseMatHeader cvReleaseMat
218 int orientation,
int* hull,
int* hullsize );
222 int left,
int bottom,
233 void *
param,
float reps,
float aeps,
float*
line );
237 void *
param,
float reps,
float aeps,
float*
line );
250 #define cvQueryHistValue_1D( hist, idx0 ) \
251 ((float)cvGetReal1D( (hist)->bins, (idx0)))
252 #define cvQueryHistValue_2D( hist, idx0, idx1 ) \
253 ((float)cvGetReal2D( (hist)->bins, (idx0), (idx1)))
254 #define cvQueryHistValue_3D( hist, idx0, idx1, idx2 ) \
255 ((float)cvGetReal3D( (hist)->bins, (idx0), (idx1), (idx2)))
256 #define cvQueryHistValue_nD( hist, idx ) \
257 ((float)cvGetRealND( (hist)->bins, (idx)))
261 #define cvGetHistValue_1D( hist, idx0 ) \
262 ((float*)cvPtr1D( (hist)->bins, (idx0), 0))
263 #define cvGetHistValue_2D( hist, idx0, idx1 ) \
264 ((float*)cvPtr2D( (hist)->bins, (idx0), (idx1), 0))
265 #define cvGetHistValue_3D( hist, idx0, idx1, idx2 ) \
266 ((float*)cvPtr3D( (hist)->bins, (idx0), (idx1), (idx2), 0))
267 #define cvGetHistValue_nD( hist, idx ) \
268 ((float*)cvPtrND( (hist)->bins, (idx), 0))
271 #define CV_IS_SET_ELEM_EXISTS CV_IS_SET_ELEM
276 float*
lines,
int linesNumber );
280 int lineLength,
int lineGap,
281 int*
lines,
int linesNumber );
286 float*
lines,
int linesNumber );
289 const float* signature2,
int size2,
296 int num_samples,
int vec_size,
314 double angle,
double start_angle,
315 double end_angle,
double color,
373 #define CV_INIT_PIXEL_POS(pos, origin, _step, roi, _x, _y, orientation) \
375 (pos).step = (_step)/sizeof((pos).currline[0]) * (orientation ? -1 : 1), \
376 (pos).width = (roi).width, \
377 (pos).height = (roi).height, \
378 (pos).bottomline = (origin) + (pos).step*(pos).height, \
379 (pos).topline = (origin) - (pos).step, \
380 (pos).step_arr[0] = 0, \
381 (pos).step_arr[1] = -(pos).step, \
382 (pos).step_arr[2] = (pos).step, \
384 (pos).currline = (origin) + (pos).step*(_y) )
391 #define CV_MOVE_TO( pos, _x, _y, cs ) \
392 ((pos).currline = (_y) >= 0 && (_y) < (pos).height ? (pos).topline + ((_y)+1)*(pos).step : 0, \
393 (pos).x = (_x) >= 0 && (_x) < (pos).width ? (_x) : 0, (pos).currline + (_x) * (cs) )
399 #define CV_GET_CURRENT( pos, cs ) ((pos).currline + (pos).x * (cs))
406 #define CV_MOVE_LEFT( pos, cs ) \
407 ( --(pos).x >= 0 ? (pos).currline + (pos).x*(cs) : 0 )
410 #define CV_MOVE_RIGHT( pos, cs ) \
411 ( ++(pos).x < (pos).width ? (pos).currline + (pos).x*(cs) : 0 )
414 #define CV_MOVE_UP( pos, cs ) \
415 (((pos).currline -= (pos).step) != (pos).topline ? (pos).currline + (pos).x*(cs) : 0 )
418 #define CV_MOVE_DOWN( pos, cs ) \
419 (((pos).currline += (pos).step) != (pos).bottomline ? (pos).currline + (pos).x*(cs) : 0 )
422 #define CV_MOVE_LU( pos, cs ) ( CV_MOVE_LEFT(pos, cs), CV_MOVE_UP(pos, cs))
425 #define CV_MOVE_RU( pos, cs ) ( CV_MOVE_RIGHT(pos, cs), CV_MOVE_UP(pos, cs))
428 #define CV_MOVE_LD( pos, cs ) ( CV_MOVE_LEFT(pos, cs), CV_MOVE_DOWN(pos, cs))
431 #define CV_MOVE_RD( pos, cs ) ( CV_MOVE_RIGHT(pos, cs), CV_MOVE_DOWN(pos, cs))
441 #define CV_MOVE_LEFT_WRAP( pos, cs ) \
442 ((pos).currline + ( --(pos).x >= 0 ? (pos).x : ((pos).x = (pos).width-1))*(cs))
445 #define CV_MOVE_RIGHT_WRAP( pos, cs ) \
446 ((pos).currline + ( ++(pos).x < (pos).width ? (pos).x : ((pos).x = 0))*(cs) )
449 #define CV_MOVE_UP_WRAP( pos, cs ) \
450 ((((pos).currline -= (pos).step) != (pos).topline ? \
451 (pos).currline : ((pos).currline = (pos).bottomline - (pos).step)) + (pos).x*(cs) )
454 #define CV_MOVE_DOWN_WRAP( pos, cs ) \
455 ((((pos).currline += (pos).step) != (pos).bottomline ? \
456 (pos).currline : ((pos).currline = (pos).topline + (pos).step)) + (pos).x*(cs) )
459 #define CV_MOVE_LU_WRAP( pos, cs ) ( CV_MOVE_LEFT_WRAP(pos, cs), CV_MOVE_UP_WRAP(pos, cs))
461 #define CV_MOVE_RU_WRAP( pos, cs ) ( CV_MOVE_RIGHT_WRAP(pos, cs), CV_MOVE_UP_WRAP(pos, cs))
463 #define CV_MOVE_LD_WRAP( pos, cs ) ( CV_MOVE_LEFT_WRAP(pos, cs), CV_MOVE_DOWN_WRAP(pos, cs))
465 #define CV_MOVE_RD_WRAP( pos, cs ) ( CV_MOVE_RIGHT_WRAP(pos, cs), CV_MOVE_DOWN_WRAP(pos, cs))
485 #define CV_MOVE_PARAM( pos, shift, cs ) \
486 ( (pos).currline += (pos).step_arr[(shift)>>2], (pos).x += ((shift)&3)-2, \
487 ((pos).currline != (pos).topline && (pos).currline != (pos).bottomline && \
488 (pos).x >= 0 && (pos).x < (pos).width) ? (pos).currline + (pos).x*(cs) : 0 )
495 #define CV_MOVE_PARAM_WRAP( pos, shift, cs ) \
496 ( (pos).currline += (pos).step_arr[(shift)>>2], \
497 (pos).currline = ((pos).currline == (pos).topline ? \
498 (pos).bottomline - (pos).step : \
499 (pos).currline == (pos).bottomline ? \
500 (pos).topline + (pos).step : (pos).currline), \
502 (pos).x += ((shift)&3)-2, \
503 (pos).x = ((pos).x < 0 ? (pos).width-1 : (pos).x >= (pos).width ? 0 : (pos).x), \
505 (pos).currline + (pos).x*(cs) )
514 const float* intrinsic_matrix,
515 const float* distortion_coeffs,
521 CvArr* undistortion_map,
522 const float* A,
const float* k,
526 const CvArr* undistortion_map,
531 int numpoints,
int method,
float* matrix );
542 float* _distortion_coeffs,
float* _camera_matrix,
float* _translation_vectors,
543 float* _rotation_matrices,
int flags );
548 double* _distortion_coeffs,
double* _camera_matrix,
double* _translation_vectors,
549 double* _rotation_matrices,
int flags );
557 CvPoint2D32f principal_point,
float* _distortion_coeffs,
558 float* _rotation_vector,
float* _translation_vector );
564 CvPoint2D64f principal_point,
double* _distortion_coeffs,
565 double* _rotation_vector,
double* _translation_vector );
580 double* _rotation_vector,
double* _translation_vector,
583 double* _deriv_points_rotation_matrix,
584 double* _deriv_points_translation_vect,
585 double* _deriv_points_focal,
586 double* _deriv_points_principal_point,
587 double* _deriv_points_distortion_coeffs );
592 double* _rotation_matrix,
double* _translation_vector,
593 double* _camera_matrix,
double* _distortion,
CvPoint2D64f* _image_points );
596 #define cvMake2DPoints cvConvertPointsHomogeneous
597 #define cvMake3DPoints cvConvertPointsHomogeneous
599 #define cvWarpPerspectiveQMatrix cvGetPerspectiveTransform
601 #define cvConvertPointsHomogenious cvConvertPointsHomogeneous