EstervQrCode 1.1.1
Library for qr code manipulation
core_c.h
1 /*M///////////////////////////////////////////////////////////////////////////////////////
2 //
3 // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
4 //
5 // By downloading, copying, installing or using the software you agree to this license.
6 // If you do not agree to this license, do not download, install,
7 // copy or use the software.
8 //
9 //
10 // License Agreement
11 // For Open Source Computer Vision Library
12 //
13 // Copyright (C) 2000-2008, Intel Corporation, all rights reserved.
14 // Copyright (C) 2009, Willow Garage Inc., all rights reserved.
15 // Copyright (C) 2013, OpenCV Foundation, all rights reserved.
16 // Third party copyrights are property of their respective owners.
17 //
18 // Redistribution and use in source and binary forms, with or without modification,
19 // are permitted provided that the following conditions are met:
20 //
21 // * Redistribution's of source code must retain the above copyright notice,
22 // this list of conditions and the following disclaimer.
23 //
24 // * Redistribution's in binary form must reproduce the above copyright notice,
25 // this list of conditions and the following disclaimer in the documentation
26 // and/or other materials provided with the distribution.
27 //
28 // * The name of the copyright holders may not be used to endorse or promote products
29 // derived from this software without specific prior written permission.
30 //
31 // This software is provided by the copyright holders and contributors "as is" and
32 // any express or implied warranties, including, but not limited to, the implied
33 // warranties of merchantability and fitness for a particular purpose are disclaimed.
34 // In no event shall the Intel Corporation or contributors be liable for any direct,
35 // indirect, incidental, special, exemplary, or consequential damages
36 // (including, but not limited to, procurement of substitute goods or services;
37 // loss of use, data, or profits; or business interruption) however caused
38 // and on any theory of liability, whether in contract, strict liability,
39 // or tort (including negligence or otherwise) arising in any way out of
40 // the use of this software, even if advised of the possibility of such damage.
41 //
42 //M*/
43 
44 
45 #ifndef OPENCV_CORE_C_H
46 #define OPENCV_CORE_C_H
47 
48 #include "opencv2/core/types_c.h"
49 
50 #ifdef __cplusplus
51 /* disable MSVC warning C4190 / clang-cl -Wreturn-type-c-linkage:
52  'function' has C-linkage specified, but returns UDT 'typename'
53  which is incompatible with C
54 
55  It is OK to disable it because we only extend few plain structures with
56  C++ constructors for simpler interoperability with C++ API of the library
57 */
58 # if defined(__clang__)
59  // handle clang on Linux and clang-cl (i. e. clang on Windows) first
60 # pragma GCC diagnostic ignored "-Wreturn-type-c-linkage"
61 # elif defined(_MSC_VER)
62  // then handle MSVC
63 # pragma warning(disable:4190)
64 # endif
65 #endif
66 
67 #ifdef __cplusplus
68 extern "C" {
69 #endif
70 
75 /****************************************************************************************\
76 * Array allocation, deallocation, initialization and access to elements *
77 \****************************************************************************************/
78 
83 CVAPI(void*) cvAlloc( size_t size );
84 
91 CVAPI(void) cvFree_( void* ptr );
92 #define cvFree(ptr) (cvFree_(*(ptr)), *(ptr)=0)
93 
100 CVAPI(IplImage*) cvCreateImageHeader( CvSize size, int depth, int channels );
101 
112 CVAPI(IplImage*) cvInitImageHeader( IplImage* image, CvSize size, int depth,
113  int channels, int origin CV_DEFAULT(0),
114  int align CV_DEFAULT(4));
115 
128 CVAPI(IplImage*) cvCreateImage( CvSize size, int depth, int channels );
129 
143 CVAPI(void) cvReleaseImageHeader( IplImage** image );
144 
157 CVAPI(void) cvReleaseImage( IplImage** image );
158 
160 CVAPI(IplImage*) cvCloneImage( const IplImage* image );
161 
172 CVAPI(void) cvSetImageCOI( IplImage* image, int coi );
173 
180 CVAPI(int) cvGetImageCOI( const IplImage* image );
181 
193 CVAPI(void) cvSetImageROI( IplImage* image, CvRect rect );
194 
204 CVAPI(void) cvResetImageROI( IplImage* image );
205 
211 CVAPI(CvRect) cvGetImageROI( const IplImage* image );
212 
221 CVAPI(CvMat*) cvCreateMatHeader( int rows, int cols, int type );
222 
223 #define CV_AUTOSTEP 0x7fffffff
224 
257 CVAPI(CvMat*) cvInitMatHeader( CvMat* mat, int rows, int cols,
258  int type, void* data CV_DEFAULT(NULL),
260 
275 CVAPI(CvMat*) cvCreateMat( int rows, int cols, int type );
276 
288 CVAPI(void) cvReleaseMat( CvMat** mat );
289 
302 {
303  if( CV_IS_MAT( arr ))
304  {
305  CvMat* mat = (CvMat*)arr;
306  mat->data.ptr = NULL;
307  if( mat->refcount != NULL && --*mat->refcount == 0 )
308  cvFree( &mat->refcount );
309  mat->refcount = NULL;
310  }
311  else if( CV_IS_MATND( arr ))
312  {
313  CvMatND* mat = (CvMatND*)arr;
314  mat->data.ptr = NULL;
315  if( mat->refcount != NULL && --*mat->refcount == 0 )
316  cvFree( &mat->refcount );
317  mat->refcount = NULL;
318  }
319 }
320 
328 {
329  int refcount = 0;
330  if( CV_IS_MAT( arr ))
331  {
332  CvMat* mat = (CvMat*)arr;
333  if( mat->refcount != NULL )
334  refcount = ++*mat->refcount;
335  }
336  else if( CV_IS_MATND( arr ))
337  {
338  CvMatND* mat = (CvMatND*)arr;
339  if( mat->refcount != NULL )
340  refcount = ++*mat->refcount;
341  }
342  return refcount;
343 }
344 
345 
347 CVAPI(CvMat*) cvCloneMat( const CvMat* mat );
348 
349 
360 CVAPI(CvMat*) cvGetSubRect( const CvArr* arr, CvMat* submat, CvRect rect );
361 #define cvGetSubArr cvGetSubRect
362 
374 CVAPI(CvMat*) cvGetRows( const CvArr* arr, CvMat* submat,
375  int start_row, int end_row,
376  int delta_row CV_DEFAULT(1));
377 
383 CV_INLINE CvMat* cvGetRow( const CvArr* arr, CvMat* submat, int row )
384 {
385  return cvGetRows( arr, submat, row, row + 1, 1 );
386 }
387 
388 
401 CVAPI(CvMat*) cvGetCols( const CvArr* arr, CvMat* submat,
402  int start_col, int end_col );
403 
409 CV_INLINE CvMat* cvGetCol( const CvArr* arr, CvMat* submat, int col )
410 {
411  return cvGetCols( arr, submat, col, col + 1 );
412 }
413 
423 CVAPI(CvMat*) cvGetDiag( const CvArr* arr, CvMat* submat,
424  int diag CV_DEFAULT(0));
425 
427 CVAPI(void) cvScalarToRawData( const CvScalar* scalar, void* data, int type,
428  int extend_to_12 CV_DEFAULT(0) );
429 
430 CVAPI(void) cvRawDataToScalar( const void* data, int type, CvScalar* scalar );
431 
440 CVAPI(CvMatND*) cvCreateMatNDHeader( int dims, const int* sizes, int type );
441 
454 CVAPI(CvMatND*) cvCreateMatND( int dims, const int* sizes, int type );
455 
464 CVAPI(CvMatND*) cvInitMatNDHeader( CvMatND* mat, int dims, const int* sizes,
465  int type, void* data CV_DEFAULT(NULL) );
466 
479 {
480  cvReleaseMat( (CvMat**)mat );
481 }
482 
484 CVAPI(CvMatND*) cvCloneMatND( const CvMatND* mat );
485 
495 CVAPI(CvSparseMat*) cvCreateSparseMat( int dims, const int* sizes, int type );
496 
502 CVAPI(void) cvReleaseSparseMat( CvSparseMat** mat );
503 
505 CVAPI(CvSparseMat*) cvCloneSparseMat( const CvSparseMat* mat );
506 
514 CVAPI(CvSparseNode*) cvInitSparseMatIterator( const CvSparseMat* mat,
516 
546 {
547  if( mat_iterator->node->next )
548  return mat_iterator->node = mat_iterator->node->next;
549  else
550  {
551  int idx;
552  for( idx = ++mat_iterator->curidx; idx < mat_iterator->mat->hashsize; idx++ )
553  {
555  if( node )
556  {
558  return mat_iterator->node = node;
559  }
560  }
561  return NULL;
562  }
563 }
564 
565 
566 #define CV_MAX_ARR 10
567 
569 typedef struct CvNArrayIterator
570 {
571  int count;
572  int dims;
578 }
580 
581 #define CV_NO_DEPTH_CHECK 1
582 #define CV_NO_CN_CHECK 2
583 #define CV_NO_SIZE_CHECK 4
584 
588 CVAPI(int) cvInitNArrayIterator( int count, CvArr** arrs,
591  int flags CV_DEFAULT(0) );
592 
594 CVAPI(int) cvNextNArraySlice( CvNArrayIterator* array_iterator );
595 
596 
607 CVAPI(int) cvGetElemType( const CvArr* arr );
608 
625 CVAPI(int) cvGetDims( const CvArr* arr, int* sizes CV_DEFAULT(NULL) );
626 
627 
634 CVAPI(int) cvGetDimSize( const CvArr* arr, int index );
635 
636 
652 CVAPI(uchar*) cvPtr1D( const CvArr* arr, int idx0, int* type CV_DEFAULT(NULL));
654 CVAPI(uchar*) cvPtr2D( const CvArr* arr, int idx0, int idx1, int* type CV_DEFAULT(NULL) );
656 CVAPI(uchar*) cvPtr3D( const CvArr* arr, int idx0, int idx1, int idx2,
657  int* type CV_DEFAULT(NULL));
668 CVAPI(uchar*) cvPtrND( const CvArr* arr, const int* idx, int* type CV_DEFAULT(NULL),
669  int create_node CV_DEFAULT(1),
670  unsigned* precalc_hashval CV_DEFAULT(NULL));
671 
679 CVAPI(CvScalar) cvGet1D( const CvArr* arr, int idx0 );
681 CVAPI(CvScalar) cvGet2D( const CvArr* arr, int idx0, int idx1 );
683 CVAPI(CvScalar) cvGet3D( const CvArr* arr, int idx0, int idx1, int idx2 );
688 CVAPI(CvScalar) cvGetND( const CvArr* arr, const int* idx );
689 
701 CVAPI(double) cvGetReal1D( const CvArr* arr, int idx0 );
703 CVAPI(double) cvGetReal2D( const CvArr* arr, int idx0, int idx1 );
705 CVAPI(double) cvGetReal3D( const CvArr* arr, int idx0, int idx1, int idx2 );
710 CVAPI(double) cvGetRealND( const CvArr* arr, const int* idx );
711 
720 CVAPI(void) cvSet1D( CvArr* arr, int idx0, CvScalar value );
722 CVAPI(void) cvSet2D( CvArr* arr, int idx0, int idx1, CvScalar value );
724 CVAPI(void) cvSet3D( CvArr* arr, int idx0, int idx1, int idx2, CvScalar value );
730 CVAPI(void) cvSetND( CvArr* arr, const int* idx, CvScalar value );
731 
743 CVAPI(void) cvSetReal1D( CvArr* arr, int idx0, double value );
745 CVAPI(void) cvSetReal2D( CvArr* arr, int idx0, int idx1, double value );
747 CVAPI(void) cvSetReal3D( CvArr* arr, int idx0,
748  int idx1, int idx2, double value );
754 CVAPI(void) cvSetRealND( CvArr* arr, const int* idx, double value );
755 
758 CVAPI(void) cvClearND( CvArr* arr, const int* idx );
759 
782 CVAPI(CvMat*) cvGetMat( const CvArr* arr, CvMat* header,
783  int* coi CV_DEFAULT(NULL),
784  int allowND CV_DEFAULT(0));
785 
796 CVAPI(IplImage*) cvGetImage( const CvArr* arr, IplImage* image_header );
797 
798 
835 CVAPI(CvArr*) cvReshapeMatND( const CvArr* arr,
837  int new_cn, int new_dims, int* new_sizes );
838 
839 #define cvReshapeND( arr, header, new_cn, new_dims, new_sizes ) \
840  cvReshapeMatND( (arr), sizeof(*(header)), (header), \
841  (new_cn), (new_dims), (new_sizes))
842 
870 CVAPI(CvMat*) cvReshape( const CvArr* arr, CvMat* header,
871  int new_cn, int new_rows CV_DEFAULT(0) );
872 
875 CVAPI(void) cvRepeat( const CvArr* src, CvArr* dst );
876 
885 CVAPI(void) cvCreateData( CvArr* arr );
886 
894 CVAPI(void) cvReleaseData( CvArr* arr );
895 
905 CVAPI(void) cvSetData( CvArr* arr, void* data, int step );
906 
933 CVAPI(void) cvGetRawData( const CvArr* arr, uchar** data,
934  int* step CV_DEFAULT(NULL),
935  CvSize* roi_size CV_DEFAULT(NULL));
936 
943 CVAPI(CvSize) cvGetSize( const CvArr* arr );
944 
959 CVAPI(void) cvCopy( const CvArr* src, CvArr* dst,
960  const CvArr* mask CV_DEFAULT(NULL) );
961 
972 CVAPI(void) cvSet( CvArr* arr, CvScalar value,
973  const CvArr* mask CV_DEFAULT(NULL) );
974 
982 CVAPI(void) cvSetZero( CvArr* arr );
983 #define cvZero cvSetZero
984 
985 
988 CVAPI(void) cvSplit( const CvArr* src, CvArr* dst0, CvArr* dst1,
990 
993 CVAPI(void) cvMerge( const CvArr* src0, const CvArr* src1,
994  const CvArr* src2, const CvArr* src3,
995  CvArr* dst );
996 
999 CVAPI(void) cvMixChannels( const CvArr** src, int src_count,
1001  const int* from_to, int pair_count );
1002 
1021 CVAPI(void) cvConvertScale( const CvArr* src, CvArr* dst,
1022  double scale CV_DEFAULT(1),
1023  double shift CV_DEFAULT(0) );
1024 #define cvCvtScale cvConvertScale
1025 #define cvScale cvConvertScale
1026 #define cvConvert( src, dst ) cvConvertScale( (src), (dst), 1, 0 )
1027 
1028 
1034 CVAPI(void) cvConvertScaleAbs( const CvArr* src, CvArr* dst,
1035  double scale CV_DEFAULT(1),
1036  double shift CV_DEFAULT(0) );
1037 #define cvCvtScaleAbs cvConvertScaleAbs
1038 
1039 
1045  double default_eps,
1047 
1048 /****************************************************************************************\
1049 * Arithmetic, logic and comparison operations *
1050 \****************************************************************************************/
1051 
1053 CVAPI(void) cvAdd( const CvArr* src1, const CvArr* src2, CvArr* dst,
1054  const CvArr* mask CV_DEFAULT(NULL));
1055 
1057 CVAPI(void) cvAddS( const CvArr* src, CvScalar value, CvArr* dst,
1058  const CvArr* mask CV_DEFAULT(NULL));
1059 
1061 CVAPI(void) cvSub( const CvArr* src1, const CvArr* src2, CvArr* dst,
1062  const CvArr* mask CV_DEFAULT(NULL));
1063 
1066  const CvArr* mask CV_DEFAULT(NULL))
1067 {
1068  cvAddS( src, cvScalar( -value.val[0], -value.val[1], -value.val[2], -value.val[3]),
1069  dst, mask );
1070 }
1071 
1073 CVAPI(void) cvSubRS( const CvArr* src, CvScalar value, CvArr* dst,
1074  const CvArr* mask CV_DEFAULT(NULL));
1075 
1078 CVAPI(void) cvMul( const CvArr* src1, const CvArr* src2,
1079  CvArr* dst, double scale CV_DEFAULT(1) );
1080 
1084 CVAPI(void) cvDiv( const CvArr* src1, const CvArr* src2,
1085  CvArr* dst, double scale CV_DEFAULT(1));
1086 
1088 CVAPI(void) cvScaleAdd( const CvArr* src1, CvScalar scale,
1089  const CvArr* src2, CvArr* dst );
1090 #define cvAXPY( A, real_scalar, B, C ) cvScaleAdd(A, cvRealScalar(real_scalar), B, C)
1091 
1093 CVAPI(void) cvAddWeighted( const CvArr* src1, double alpha,
1094  const CvArr* src2, double beta,
1095  double gamma, CvArr* dst );
1096 
1109 CVAPI(double) cvDotProduct( const CvArr* src1, const CvArr* src2 );
1110 
1112 CVAPI(void) cvAnd( const CvArr* src1, const CvArr* src2,
1113  CvArr* dst, const CvArr* mask CV_DEFAULT(NULL));
1114 
1116 CVAPI(void) cvAndS( const CvArr* src, CvScalar value,
1117  CvArr* dst, const CvArr* mask CV_DEFAULT(NULL));
1118 
1120 CVAPI(void) cvOr( const CvArr* src1, const CvArr* src2,
1121  CvArr* dst, const CvArr* mask CV_DEFAULT(NULL));
1122 
1124 CVAPI(void) cvOrS( const CvArr* src, CvScalar value,
1125  CvArr* dst, const CvArr* mask CV_DEFAULT(NULL));
1126 
1128 CVAPI(void) cvXor( const CvArr* src1, const CvArr* src2,
1129  CvArr* dst, const CvArr* mask CV_DEFAULT(NULL));
1130 
1132 CVAPI(void) cvXorS( const CvArr* src, CvScalar value,
1133  CvArr* dst, const CvArr* mask CV_DEFAULT(NULL));
1134 
1136 CVAPI(void) cvNot( const CvArr* src, CvArr* dst );
1137 
1139 CVAPI(void) cvInRange( const CvArr* src, const CvArr* lower,
1140  const CvArr* upper, CvArr* dst );
1141 
1143 CVAPI(void) cvInRangeS( const CvArr* src, CvScalar lower,
1144  CvScalar upper, CvArr* dst );
1145 
1146 #define CV_CMP_EQ 0
1147 #define CV_CMP_GT 1
1148 #define CV_CMP_GE 2
1149 #define CV_CMP_LT 3
1150 #define CV_CMP_LE 4
1151 #define CV_CMP_NE 5
1152 
1157 CVAPI(void) cvCmp( const CvArr* src1, const CvArr* src2, CvArr* dst, int cmp_op );
1158 
1160 CVAPI(void) cvCmpS( const CvArr* src, double value, CvArr* dst, int cmp_op );
1161 
1163 CVAPI(void) cvMin( const CvArr* src1, const CvArr* src2, CvArr* dst );
1164 
1166 CVAPI(void) cvMax( const CvArr* src1, const CvArr* src2, CvArr* dst );
1167 
1169 CVAPI(void) cvMinS( const CvArr* src, double value, CvArr* dst );
1170 
1172 CVAPI(void) cvMaxS( const CvArr* src, double value, CvArr* dst );
1173 
1175 CVAPI(void) cvAbsDiff( const CvArr* src1, const CvArr* src2, CvArr* dst );
1176 
1178 CVAPI(void) cvAbsDiffS( const CvArr* src, CvArr* dst, CvScalar value );
1179 #define cvAbs( src, dst ) cvAbsDiffS( (src), (dst), cvScalarAll(0))
1180 
1181 /****************************************************************************************\
1182 * Math operations *
1183 \****************************************************************************************/
1184 
1187 CVAPI(void) cvCartToPolar( const CvArr* x, const CvArr* y,
1189  int angle_in_degrees CV_DEFAULT(0));
1190 
1194 CVAPI(void) cvPolarToCart( const CvArr* magnitude, const CvArr* angle,
1196  int angle_in_degrees CV_DEFAULT(0));
1197 
1199 CVAPI(void) cvPow( const CvArr* src, CvArr* dst, double power );
1200 
1204 CVAPI(void) cvExp( const CvArr* src, CvArr* dst );
1205 
1210 CVAPI(void) cvLog( const CvArr* src, CvArr* dst );
1211 
1213 CVAPI(float) cvFastArctan( float y, float x );
1214 
1216 CVAPI(float) cvCbrt( float value );
1217 
1218 #define CV_CHECK_RANGE 1
1219 #define CV_CHECK_QUIET 2
1224 CVAPI(int) cvCheckArr( const CvArr* arr, int flags CV_DEFAULT(0),
1225  double min_val CV_DEFAULT(0), double max_val CV_DEFAULT(0));
1226 #define cvCheckArray cvCheckArr
1227 
1228 #define CV_RAND_UNI 0
1229 #define CV_RAND_NORMAL 1
1230 
1247 CVAPI(void) cvRandArr( CvRNG* rng, CvArr* arr, int dist_type,
1249 
1250 CVAPI(void) cvRandShuffle( CvArr* mat, CvRNG* rng,
1251  double iter_factor CV_DEFAULT(1.));
1252 
1253 #define CV_SORT_EVERY_ROW 0
1254 #define CV_SORT_EVERY_COLUMN 1
1255 #define CV_SORT_ASCENDING 0
1256 #define CV_SORT_DESCENDING 16
1257 
1258 CVAPI(void) cvSort( const CvArr* src, CvArr* dst CV_DEFAULT(NULL),
1259  CvArr* idxmat CV_DEFAULT(NULL),
1260  int flags CV_DEFAULT(0));
1261 
1263 CVAPI(int) cvSolveCubic( const CvMat* coeffs, CvMat* roots );
1264 
1266 CVAPI(void) cvSolvePoly(const CvMat* coeffs, CvMat *roots2,
1267  int maxiter CV_DEFAULT(20), int fig CV_DEFAULT(100));
1268 
1269 /****************************************************************************************\
1270 * Matrix operations *
1271 \****************************************************************************************/
1272 
1283 CVAPI(void) cvCrossProduct( const CvArr* src1, const CvArr* src2, CvArr* dst );
1284 
1286 #define cvMatMulAdd( src1, src2, src3, dst ) cvGEMM( (src1), (src2), 1., (src3), 1., (dst), 0 )
1287 #define cvMatMul( src1, src2, dst ) cvMatMulAdd( (src1), (src2), NULL, (dst))
1288 
1289 #define CV_GEMM_A_T 1
1290 #define CV_GEMM_B_T 2
1291 #define CV_GEMM_C_T 4
1294 CVAPI(void) cvGEMM( const CvArr* src1, const CvArr* src2, double alpha,
1295  const CvArr* src3, double beta, CvArr* dst,
1296  int tABC CV_DEFAULT(0));
1297 #define cvMatMulAddEx cvGEMM
1298 
1301 CVAPI(void) cvTransform( const CvArr* src, CvArr* dst,
1302  const CvMat* transmat,
1303  const CvMat* shiftvec CV_DEFAULT(NULL));
1304 #define cvMatMulAddS cvTransform
1305 
1307 CVAPI(void) cvPerspectiveTransform( const CvArr* src, CvArr* dst,
1308  const CvMat* mat );
1309 
1311 CVAPI(void) cvMulTransposed( const CvArr* src, CvArr* dst, int order,
1312  const CvArr* delta CV_DEFAULT(NULL),
1313  double scale CV_DEFAULT(1.) );
1314 
1316 CVAPI(void) cvTranspose( const CvArr* src, CvArr* dst );
1317 #define cvT cvTranspose
1318 
1320 CVAPI(void) cvCompleteSymm( CvMat* matrix, int LtoR CV_DEFAULT(0) );
1321 
1325 CVAPI(void) cvFlip( const CvArr* src, CvArr* dst CV_DEFAULT(NULL),
1326  int flip_mode CV_DEFAULT(0));
1327 #define cvMirror cvFlip
1328 
1329 
1330 #define CV_SVD_MODIFY_A 1
1331 #define CV_SVD_U_T 2
1332 #define CV_SVD_V_T 4
1333 
1335 CVAPI(void) cvSVD( CvArr* A, CvArr* W, CvArr* U CV_DEFAULT(NULL),
1336  CvArr* V CV_DEFAULT(NULL), int flags CV_DEFAULT(0));
1337 
1340 CVAPI(void) cvSVBkSb( const CvArr* W, const CvArr* U,
1341  const CvArr* V, const CvArr* B,
1342  CvArr* X, int flags );
1343 
1344 #define CV_LU 0
1345 #define CV_SVD 1
1346 #define CV_SVD_SYM 2
1347 #define CV_CHOLESKY 3
1348 #define CV_QR 4
1349 #define CV_NORMAL 16
1350 
1352 CVAPI(double) cvInvert( const CvArr* src, CvArr* dst,
1354 #define cvInv cvInvert
1355 
1358 CVAPI(int) cvSolve( const CvArr* src1, const CvArr* src2, CvArr* dst,
1359  int method CV_DEFAULT(CV_LU));
1360 
1362 CVAPI(double) cvDet( const CvArr* mat );
1363 
1365 CVAPI(CvScalar) cvTrace( const CvArr* mat );
1366 
1368 CVAPI(void) cvEigenVV( CvArr* mat, CvArr* evects, CvArr* evals,
1369  double eps CV_DEFAULT(0),
1370  int lowindex CV_DEFAULT(-1),
1371  int highindex CV_DEFAULT(-1));
1372 
1374 //CVAPI(void) cvSelectedEigenVV( CvArr* mat, CvArr* evects, CvArr* evals,
1375 // int lowindex, int highindex );
1376 
1378 CVAPI(void) cvSetIdentity( CvArr* mat, CvScalar value CV_DEFAULT(cvRealScalar(1)) );
1379 
1381 CVAPI(CvArr*) cvRange( CvArr* mat, double start, double end );
1382 
1390 #define CV_COVAR_SCRAMBLED 0
1391 
1393 #define CV_COVAR_NORMAL 1
1394 
1397 #define CV_COVAR_USE_AVG 2
1398 
1400 #define CV_COVAR_SCALE 4
1401 
1403 #define CV_COVAR_ROWS 8
1404 
1406 #define CV_COVAR_COLS 16
1407 
1413 CVAPI(void) cvCalcCovarMatrix( const CvArr** vects, int count,
1415 
1416 #define CV_PCA_DATA_AS_ROW 0
1417 #define CV_PCA_DATA_AS_COL 1
1418 #define CV_PCA_USE_AVG 2
1419 CVAPI(void) cvCalcPCA( const CvArr* data, CvArr* mean,
1421 
1422 CVAPI(void) cvProjectPCA( const CvArr* data, const CvArr* mean,
1424 
1425 CVAPI(void) cvBackProjectPCA( const CvArr* proj, const CvArr* mean,
1426  const CvArr* eigenvects, CvArr* result );
1427 
1429 CVAPI(double) cvMahalanobis( const CvArr* vec1, const CvArr* vec2, const CvArr* mat );
1430 #define cvMahalonobis cvMahalanobis
1431 
1432 /****************************************************************************************\
1433 * Array Statistics *
1434 \****************************************************************************************/
1435 
1437 CVAPI(CvScalar) cvSum( const CvArr* arr );
1438 
1440 CVAPI(int) cvCountNonZero( const CvArr* arr );
1441 
1443 CVAPI(CvScalar) cvAvg( const CvArr* arr, const CvArr* mask CV_DEFAULT(NULL) );
1444 
1446 CVAPI(void) cvAvgSdv( const CvArr* arr, CvScalar* mean, CvScalar* std_dev,
1447  const CvArr* mask CV_DEFAULT(NULL) );
1448 
1450 CVAPI(void) cvMinMaxLoc( const CvArr* arr, double* min_val, double* max_val,
1451  CvPoint* min_loc CV_DEFAULT(NULL),
1452  CvPoint* max_loc CV_DEFAULT(NULL),
1453  const CvArr* mask CV_DEFAULT(NULL) );
1454 
1459 #define CV_C 1
1460 #define CV_L1 2
1461 #define CV_L2 4
1462 #define CV_NORM_MASK 7
1463 #define CV_RELATIVE 8
1464 #define CV_DIFF 16
1465 #define CV_MINMAX 32
1466 
1467 #define CV_DIFF_C (CV_DIFF | CV_C)
1468 #define CV_DIFF_L1 (CV_DIFF | CV_L1)
1469 #define CV_DIFF_L2 (CV_DIFF | CV_L2)
1470 #define CV_RELATIVE_C (CV_RELATIVE | CV_C)
1471 #define CV_RELATIVE_L1 (CV_RELATIVE | CV_L1)
1472 #define CV_RELATIVE_L2 (CV_RELATIVE | CV_L2)
1478 CVAPI(double) cvNorm( const CvArr* arr1, const CvArr* arr2 CV_DEFAULT(NULL),
1479  int norm_type CV_DEFAULT(CV_L2),
1480  const CvArr* mask CV_DEFAULT(NULL) );
1481 
1483 CVAPI(void) cvNormalize( const CvArr* src, CvArr* dst,
1484  double a CV_DEFAULT(1.), double b CV_DEFAULT(0.),
1485  int norm_type CV_DEFAULT(CV_L2),
1486  const CvArr* mask CV_DEFAULT(NULL) );
1487 
1492 #define CV_REDUCE_SUM 0
1493 #define CV_REDUCE_AVG 1
1494 #define CV_REDUCE_MAX 2
1495 #define CV_REDUCE_MIN 3
1499 CVAPI(void) cvReduce( const CvArr* src, CvArr* dst, int dim CV_DEFAULT(-1),
1501 
1502 /****************************************************************************************\
1503 * Discrete Linear Transforms and Related Functions *
1504 \****************************************************************************************/
1505 
1510 #define CV_DXT_FORWARD 0
1511 #define CV_DXT_INVERSE 1
1512 #define CV_DXT_SCALE 2
1513 #define CV_DXT_INV_SCALE (CV_DXT_INVERSE + CV_DXT_SCALE)
1514 #define CV_DXT_INVERSE_SCALE CV_DXT_INV_SCALE
1515 #define CV_DXT_ROWS 4
1516 #define CV_DXT_MUL_CONJ 8
1525 CVAPI(void) cvDFT( const CvArr* src, CvArr* dst, int flags,
1526  int nonzero_rows CV_DEFAULT(0) );
1527 #define cvFFT cvDFT
1528 
1532 CVAPI(void) cvMulSpectrums( const CvArr* src1, const CvArr* src2,
1533  CvArr* dst, int flags );
1534 
1536 CVAPI(int) cvGetOptimalDFTSize( int size0 );
1537 
1541 CVAPI(void) cvDCT( const CvArr* src, CvArr* dst, int flags );
1542 
1543 /****************************************************************************************\
1544 * Dynamic data structures *
1545 \****************************************************************************************/
1546 
1548 CVAPI(int) cvSliceLength( CvSlice slice, const CvSeq* seq );
1549 
1550 
1554 CVAPI(CvMemStorage*) cvCreateMemStorage( int block_size CV_DEFAULT(0));
1555 
1556 
1558 CVAPI(CvMemStorage*) cvCreateChildMemStorage( CvMemStorage* parent );
1559 
1560 
1563 CVAPI(void) cvReleaseMemStorage( CvMemStorage** storage );
1564 
1565 
1570 CVAPI(void) cvClearMemStorage( CvMemStorage* storage );
1571 
1573 CVAPI(void) cvSaveMemStoragePos( const CvMemStorage* storage, CvMemStoragePos* pos );
1574 
1576 CVAPI(void) cvRestoreMemStoragePos( CvMemStorage* storage, CvMemStoragePos* pos );
1577 
1579 CVAPI(void*) cvMemStorageAlloc( CvMemStorage* storage, size_t size );
1580 
1582 //CVAPI(CvString) cvMemStorageAllocString( CvMemStorage* storage, const char* ptr,
1583 // int len CV_DEFAULT(-1) );
1584 
1586 CVAPI(CvSeq*) cvCreateSeq( int seq_flags, size_t header_size,
1588 
1591 CVAPI(void) cvSetSeqBlockSize( CvSeq* seq, int delta_elems );
1592 
1593 
1595 CVAPI(schar*) cvSeqPush( CvSeq* seq, const void* element CV_DEFAULT(NULL));
1596 
1597 
1599 CVAPI(schar*) cvSeqPushFront( CvSeq* seq, const void* element CV_DEFAULT(NULL));
1600 
1601 
1603 CVAPI(void) cvSeqPop( CvSeq* seq, void* element CV_DEFAULT(NULL));
1604 
1605 
1607 CVAPI(void) cvSeqPopFront( CvSeq* seq, void* element CV_DEFAULT(NULL));
1608 
1609 
1610 #define CV_FRONT 1
1611 #define CV_BACK 0
1613 CVAPI(void) cvSeqPushMulti( CvSeq* seq, const void* elements,
1614  int count, int in_front CV_DEFAULT(0) );
1615 
1617 CVAPI(void) cvSeqPopMulti( CvSeq* seq, void* elements,
1618  int count, int in_front CV_DEFAULT(0) );
1619 
1622 CVAPI(schar*) cvSeqInsert( CvSeq* seq, int before_index,
1623  const void* element CV_DEFAULT(NULL));
1624 
1626 CVAPI(void) cvSeqRemove( CvSeq* seq, int index );
1627 
1628 
1632 CVAPI(void) cvClearSeq( CvSeq* seq );
1633 
1634 
1638 CVAPI(schar*) cvGetSeqElem( const CvSeq* seq, int index );
1639 
1642 CVAPI(int) cvSeqElemIdx( const CvSeq* seq, const void* element,
1643  CvSeqBlock** block CV_DEFAULT(NULL) );
1644 
1646 CVAPI(void) cvStartAppendToSeq( CvSeq* seq, CvSeqWriter* writer );
1647 
1648 
1650 CVAPI(void) cvStartWriteSeq( int seq_flags, int header_size,
1652  CvSeqWriter* writer );
1653 
1658 CVAPI(CvSeq*) cvEndWriteSeq( CvSeqWriter* writer );
1659 
1660 
1663 CVAPI(void) cvFlushSeqWriter( CvSeqWriter* writer );
1664 
1665 
1668 CVAPI(void) cvStartReadSeq( const CvSeq* seq, CvSeqReader* reader,
1669  int reverse CV_DEFAULT(0) );
1670 
1671 
1673 CVAPI(int) cvGetSeqReaderPos( CvSeqReader* reader );
1674 
1675 
1678 CVAPI(void) cvSetSeqReaderPos( CvSeqReader* reader, int index,
1679  int is_relative CV_DEFAULT(0));
1680 
1682 CVAPI(void*) cvCvtSeqToArray( const CvSeq* seq, void* elements,
1684 
1688 CVAPI(CvSeq*) cvMakeSeqHeaderForArray( int seq_type, int header_size,
1689  int elem_size, void* elements, int total,
1691 
1693 CVAPI(CvSeq*) cvSeqSlice( const CvSeq* seq, CvSlice slice,
1695  int copy_data CV_DEFAULT(0));
1696 
1698 {
1699  return cvSeqSlice( seq, CV_WHOLE_SEQ, storage, 1 );
1700 }
1701 
1703 CVAPI(void) cvSeqRemoveSlice( CvSeq* seq, CvSlice slice );
1704 
1706 CVAPI(void) cvSeqInsertSlice( CvSeq* seq, int before_index, const CvArr* from_arr );
1707 
1709 typedef int (CV_CDECL* CvCmpFunc)(const void* a, const void* b, void* userdata );
1710 
1712 CVAPI(void) cvSeqSort( CvSeq* seq, CvCmpFunc func, void* userdata CV_DEFAULT(NULL) );
1713 
1715 CVAPI(schar*) cvSeqSearch( CvSeq* seq, const void* elem, CvCmpFunc func,
1716  int is_sorted, int* elem_idx,
1717  void* userdata CV_DEFAULT(NULL) );
1718 
1720 CVAPI(void) cvSeqInvert( CvSeq* seq );
1721 
1723 CVAPI(int) cvSeqPartition( const CvSeq* seq, CvMemStorage* storage,
1725 
1726 /************ Internal sequence functions ************/
1727 CVAPI(void) cvChangeSeqBlock( void* reader, int direction );
1728 CVAPI(void) cvCreateSeqBlock( CvSeqWriter* writer );
1729 
1730 
1732 CVAPI(CvSet*) cvCreateSet( int set_flags, int header_size,
1733  int elem_size, CvMemStorage* storage );
1734 
1736 CVAPI(int) cvSetAdd( CvSet* set_header, CvSetElem* elem CV_DEFAULT(NULL),
1737  CvSetElem** inserted_elem CV_DEFAULT(NULL) );
1738 
1741 {
1742  CvSetElem* elem = set_header->free_elems;
1743  if( elem )
1744  {
1745  set_header->free_elems = elem->next_free;
1746  elem->flags = elem->flags & CV_SET_ELEM_IDX_MASK;
1747  set_header->active_count++;
1748  }
1749  else
1750  cvSetAdd( set_header, NULL, &elem );
1751  return elem;
1752 }
1753 
1755 CV_INLINE void cvSetRemoveByPtr( CvSet* set_header, void* elem )
1756 {
1757  CvSetElem* _elem = (CvSetElem*)elem;
1758  assert( _elem->flags >= 0 /*&& (elem->flags & CV_SET_ELEM_IDX_MASK) < set_header->total*/ );
1759  _elem->next_free = set_header->free_elems;
1760  _elem->flags = (_elem->flags & CV_SET_ELEM_IDX_MASK) | CV_SET_ELEM_FREE_FLAG;
1761  set_header->free_elems = _elem;
1762  set_header->active_count--;
1763 }
1764 
1766 CVAPI(void) cvSetRemove( CvSet* set_header, int index );
1767 
1770 CV_INLINE CvSetElem* cvGetSetElem( const CvSet* set_header, int idx )
1771 {
1772  CvSetElem* elem = (CvSetElem*)(void *)cvGetSeqElem( (CvSeq*)set_header, idx );
1773  return elem && CV_IS_SET_ELEM( elem ) ? elem : 0;
1774 }
1775 
1777 CVAPI(void) cvClearSet( CvSet* set_header );
1778 
1780 CVAPI(CvGraph*) cvCreateGraph( int graph_flags, int header_size,
1782  CvMemStorage* storage );
1783 
1785 CVAPI(int) cvGraphAddVtx( CvGraph* graph, const CvGraphVtx* vtx CV_DEFAULT(NULL),
1786  CvGraphVtx** inserted_vtx CV_DEFAULT(NULL) );
1787 
1788 
1790 CVAPI(int) cvGraphRemoveVtx( CvGraph* graph, int index );
1791 CVAPI(int) cvGraphRemoveVtxByPtr( CvGraph* graph, CvGraphVtx* vtx );
1792 
1793 
1798 CVAPI(int) cvGraphAddEdge( CvGraph* graph,
1799  int start_idx, int end_idx,
1800  const CvGraphEdge* edge CV_DEFAULT(NULL),
1801  CvGraphEdge** inserted_edge CV_DEFAULT(NULL) );
1802 
1803 CVAPI(int) cvGraphAddEdgeByPtr( CvGraph* graph,
1805  const CvGraphEdge* edge CV_DEFAULT(NULL),
1806  CvGraphEdge** inserted_edge CV_DEFAULT(NULL) );
1807 
1809 CVAPI(void) cvGraphRemoveEdge( CvGraph* graph, int start_idx, int end_idx );
1810 CVAPI(void) cvGraphRemoveEdgeByPtr( CvGraph* graph, CvGraphVtx* start_vtx,
1811  CvGraphVtx* end_vtx );
1812 
1814 CVAPI(CvGraphEdge*) cvFindGraphEdge( const CvGraph* graph, int start_idx, int end_idx );
1815 CVAPI(CvGraphEdge*) cvFindGraphEdgeByPtr( const CvGraph* graph,
1816  const CvGraphVtx* start_vtx,
1817  const CvGraphVtx* end_vtx );
1818 #define cvGraphFindEdge cvFindGraphEdge
1819 #define cvGraphFindEdgeByPtr cvFindGraphEdgeByPtr
1820 
1822 CVAPI(void) cvClearGraph( CvGraph* graph );
1823 
1824 
1826 CVAPI(int) cvGraphVtxDegree( const CvGraph* graph, int vtx_idx );
1827 CVAPI(int) cvGraphVtxDegreeByPtr( const CvGraph* graph, const CvGraphVtx* vtx );
1828 
1829 
1831 #define cvGetGraphVtx( graph, idx ) (CvGraphVtx*)cvGetSetElem((CvSet*)(graph), (idx))
1832 
1834 #define cvGraphVtxIdx( graph, vtx ) ((vtx)->flags & CV_SET_ELEM_IDX_MASK)
1835 
1837 #define cvGraphEdgeIdx( graph, edge ) ((edge)->flags & CV_SET_ELEM_IDX_MASK)
1838 
1839 #define cvGraphGetVtxCount( graph ) ((graph)->active_count)
1840 #define cvGraphGetEdgeCount( graph ) ((graph)->edges->active_count)
1841 
1842 #define CV_GRAPH_VERTEX 1
1843 #define CV_GRAPH_TREE_EDGE 2
1844 #define CV_GRAPH_BACK_EDGE 4
1845 #define CV_GRAPH_FORWARD_EDGE 8
1846 #define CV_GRAPH_CROSS_EDGE 16
1847 #define CV_GRAPH_ANY_EDGE 30
1848 #define CV_GRAPH_NEW_TREE 32
1849 #define CV_GRAPH_BACKTRACKING 64
1850 #define CV_GRAPH_OVER -1
1851 
1852 #define CV_GRAPH_ALL_ITEMS -1
1853 
1855 #define CV_GRAPH_ITEM_VISITED_FLAG (1 << 30)
1856 #define CV_IS_GRAPH_VERTEX_VISITED(vtx) \
1857  (((CvGraphVtx*)(vtx))->flags & CV_GRAPH_ITEM_VISITED_FLAG)
1858 #define CV_IS_GRAPH_EDGE_VISITED(edge) \
1859  (((CvGraphEdge*)(edge))->flags & CV_GRAPH_ITEM_VISITED_FLAG)
1860 #define CV_GRAPH_SEARCH_TREE_NODE_FLAG (1 << 29)
1861 #define CV_GRAPH_FORWARD_EDGE_FLAG (1 << 28)
1862 
1863 typedef struct CvGraphScanner
1864 {
1865  CvGraphVtx* vtx; /* current graph vertex (or current edge origin) */
1866  CvGraphVtx* dst; /* current graph edge destination vertex */
1867  CvGraphEdge* edge; /* current edge */
1868 
1869  CvGraph* graph; /* the graph */
1870  CvSeq* stack; /* the graph vertex stack */
1871  int index; /* the lower bound of certainly visited vertices */
1872  int mask; /* event mask */
1873 }
1875 
1877 CVAPI(CvGraphScanner*) cvCreateGraphScanner( CvGraph* graph,
1878  CvGraphVtx* vtx CV_DEFAULT(NULL),
1880 
1882 CVAPI(void) cvReleaseGraphScanner( CvGraphScanner** scanner );
1883 
1885 CVAPI(int) cvNextGraphItem( CvGraphScanner* scanner );
1886 
1888 CVAPI(CvGraph*) cvCloneGraph( const CvGraph* graph, CvMemStorage* storage );
1889 
1890 
1893 CVAPI(void) cvLUT( const CvArr* src, CvArr* dst, const CvArr* lut );
1894 
1895 
1896 /******************* Iteration through the sequence tree *****************/
1897 typedef struct CvTreeNodeIterator
1898 {
1899  const void* node;
1900  int level;
1902 }
1904 
1905 CVAPI(void) cvInitTreeNodeIterator( CvTreeNodeIterator* tree_iterator,
1906  const void* first, int max_level );
1907 CVAPI(void*) cvNextTreeNode( CvTreeNodeIterator* tree_iterator );
1908 CVAPI(void*) cvPrevTreeNode( CvTreeNodeIterator* tree_iterator );
1909 
1913 CVAPI(void) cvInsertNodeIntoTree( void* node, void* parent, void* frame );
1914 
1916 CVAPI(void) cvRemoveNodeFromTree( void* node, void* frame );
1917 
1920 CVAPI(CvSeq*) cvTreeToNodeSeq( const void* first, int header_size,
1921  CvMemStorage* storage );
1922 
1925 #define CV_KMEANS_USE_INITIAL_LABELS 1
1926 CVAPI(int) cvKMeans2( const CvArr* samples, int cluster_count, CvArr* labels,
1928  CvRNG* rng CV_DEFAULT(0), int flags CV_DEFAULT(0),
1929  CvArr* _centers CV_DEFAULT(0), double* compactness CV_DEFAULT(0) );
1930 
1931 /****************************************************************************************\
1932 * System functions *
1933 \****************************************************************************************/
1934 
1936 CVAPI(int) cvUseOptimized( int on_off );
1937 
1939  (int,int,int,char*,char*,int,int,int,int,int,
1940  IplROI*,IplImage*,void*,IplTileInfo*);
1941 typedef void (CV_STDCALL* Cv_iplAllocateImageData)(IplImage*,int,int);
1942 typedef void (CV_STDCALL* Cv_iplDeallocate)(IplImage*,int);
1943 typedef IplROI* (CV_STDCALL* Cv_iplCreateROI)(int,int,int,int,int);
1945 
1962 CVAPI(void) cvSetIPLAllocators( Cv_iplCreateImageHeader create_header,
1967 
1968 #define CV_TURN_ON_IPL_COMPATIBILITY() \
1969  cvSetIPLAllocators( iplCreateImageHeader, iplAllocateImage, \
1970  iplDeallocate, iplCreateROI, iplCloneImage )
1971 
1972 /****************************************************************************************\
1973 * Data Persistence *
1974 \****************************************************************************************/
1975 
1976 #if 0
1977 /********************************** High-level functions ********************************/
1978 
1999 CVAPI(CvFileStorage*) cvOpenFileStorage( const char* filename, CvMemStorage* memstorage,
2000  int flags, const char* encoding CV_DEFAULT(NULL) );
2001 
2008 CVAPI(void) cvReleaseFileStorage( CvFileStorage** fs );
2009 
2011 CVAPI(const char*) cvAttrValue( const CvAttrList* attr, const char* attr_name );
2012 
2039 CVAPI(void) cvStartWriteStruct( CvFileStorage* fs, const char* name,
2040  int struct_flags, const char* type_name CV_DEFAULT(NULL),
2041  CvAttrList attributes CV_DEFAULT(cvAttrList()));
2042 
2047 CVAPI(void) cvEndWriteStruct( CvFileStorage* fs );
2048 
2057 CVAPI(void) cvWriteInt( CvFileStorage* fs, const char* name, int value );
2058 
2084 CVAPI(void) cvWriteReal( CvFileStorage* fs, const char* name, double value );
2085 
2097 CVAPI(void) cvWriteString( CvFileStorage* fs, const char* name,
2098  const char* str, int quote CV_DEFAULT(0) );
2099 
2109 CVAPI(void) cvWriteComment( CvFileStorage* fs, const char* comment,
2110  int eol_comment );
2111 
2157 CVAPI(void) cvWrite( CvFileStorage* fs, const char* name, const void* ptr,
2158  CvAttrList attributes CV_DEFAULT(cvAttrList()));
2159 
2184 CVAPI(void) cvStartNextStream( CvFileStorage* fs );
2185 
2197 CVAPI(void) cvWriteRawData( CvFileStorage* fs, const void* src,
2198  int len, const char* dt );
2199 
2214 CVAPI(void) cvWriteRawDataBase64( CvFileStorage* fs, const void* src,
2215  int len, const char* dt );
2216 
2285 CVAPI(CvStringHashNode*) cvGetHashedKey( CvFileStorage* fs, const char* name,
2286  int len CV_DEFAULT(-1),
2287  int create_missing CV_DEFAULT(0));
2288 
2300 CVAPI(CvFileNode*) cvGetRootFileNode( const CvFileStorage* fs,
2301  int stream_index CV_DEFAULT(0) );
2302 
2313 CVAPI(CvFileNode*) cvGetFileNode( CvFileStorage* fs, CvFileNode* map,
2314  const CvStringHashNode* key,
2315  int create_missing CV_DEFAULT(0) );
2316 
2329 CVAPI(CvFileNode*) cvGetFileNodeByName( const CvFileStorage* fs,
2330  const CvFileNode* map,
2331  const char* name );
2332 
2343 CV_INLINE int cvReadInt( const CvFileNode* node, int default_value CV_DEFAULT(0) )
2344 {
2345  return !node ? default_value :
2346  CV_NODE_IS_INT(node->tag) ? node->data.i :
2347  CV_NODE_IS_REAL(node->tag) ? cvRound(node->data.f) : 0x7fffffff;
2348 }
2349 
2358 CV_INLINE int cvReadIntByName( const CvFileStorage* fs, const CvFileNode* map,
2359  const char* name, int default_value CV_DEFAULT(0) )
2360 {
2361  return cvReadInt( cvGetFileNodeByName( fs, map, name ), default_value );
2362 }
2363 
2374 CV_INLINE double cvReadReal( const CvFileNode* node, double default_value CV_DEFAULT(0.) )
2375 {
2376  return !node ? default_value :
2377  CV_NODE_IS_INT(node->tag) ? (double)node->data.i :
2378  CV_NODE_IS_REAL(node->tag) ? node->data.f : 1e300;
2379 }
2380 
2389 CV_INLINE double cvReadRealByName( const CvFileStorage* fs, const CvFileNode* map,
2390  const char* name, double default_value CV_DEFAULT(0.) )
2391 {
2392  return cvReadReal( cvGetFileNodeByName( fs, map, name ), default_value );
2393 }
2394 
2404 CV_INLINE const char* cvReadString( const CvFileNode* node,
2405  const char* default_value CV_DEFAULT(NULL) )
2406 {
2407  return !node ? default_value : CV_NODE_IS_STRING(node->tag) ? node->data.str.ptr : 0;
2408 }
2409 
2418 CV_INLINE const char* cvReadStringByName( const CvFileStorage* fs, const CvFileNode* map,
2419  const char* name, const char* default_value CV_DEFAULT(NULL) )
2420 {
2421  return cvReadString( cvGetFileNodeByName( fs, map, name ), default_value );
2422 }
2423 
2424 
2439 CVAPI(void*) cvRead( CvFileStorage* fs, CvFileNode* node,
2440  CvAttrList* attributes CV_DEFAULT(NULL));
2441 
2450 CV_INLINE void* cvReadByName( CvFileStorage* fs, const CvFileNode* map,
2451  const char* name, CvAttrList* attributes CV_DEFAULT(NULL) )
2452 {
2453  return cvRead( fs, cvGetFileNodeByName( fs, map, name ), attributes );
2454 }
2455 
2456 
2465 CVAPI(void) cvStartReadRawData( const CvFileStorage* fs, const CvFileNode* src,
2466  CvSeqReader* reader );
2467 
2481 CVAPI(void) cvReadRawDataSlice( const CvFileStorage* fs, CvSeqReader* reader,
2482  int count, void* dst, const char* dt );
2483 
2492 CVAPI(void) cvReadRawData( const CvFileStorage* fs, const CvFileNode* src,
2493  void* dst, const char* dt );
2494 
2508 CVAPI(void) cvWriteFileNode( CvFileStorage* fs, const char* new_node_name,
2509  const CvFileNode* node, int embed );
2510 
2517 CVAPI(const char*) cvGetFileNodeName( const CvFileNode* node );
2518 
2519 /*********************************** Adding own types ***********************************/
2520 
2527 CVAPI(void) cvRegisterType( const CvTypeInfo* info );
2528 
2536 CVAPI(void) cvUnregisterType( const char* type_name );
2537 
2543 CVAPI(CvTypeInfo*) cvFirstType(void);
2544 
2551 CVAPI(CvTypeInfo*) cvFindType( const char* type_name );
2552 
2561 CVAPI(CvTypeInfo*) cvTypeOf( const void* struct_ptr );
2562 
2563 #endif
2564 
2570 CVAPI(void) cvRelease( void** struct_ptr );
2571 
2579 CVAPI(void*) cvClone( const void* struct_ptr );
2580 
2581 /*********************************** Measuring Execution Time ***************************/
2582 
2585 CVAPI(int64) cvGetTickCount( void );
2586 CVAPI(double) cvGetTickFrequency( void );
2587 
2588 /*********************************** CPU capabilities ***********************************/
2589 
2590 CVAPI(int) cvCheckHardwareSupport(int feature);
2591 
2592 /*********************************** Multi-Threading ************************************/
2593 
2595 CVAPI(int) cvGetNumThreads( void );
2596 CVAPI(void) cvSetNumThreads( int threads CV_DEFAULT(0) );
2598 CVAPI(int) cvGetThreadNum( void );
2599 
2600 
2601 /********************************** Error Handling **************************************/
2602 
2604 CVAPI(int) cvGetErrStatus( void );
2605 
2607 CVAPI(void) cvSetErrStatus( int status );
2608 
2609 #define CV_ErrModeLeaf 0 /* Print error and exit program */
2610 #define CV_ErrModeParent 1 /* Print error and continue */
2611 #define CV_ErrModeSilent 2 /* Don't print and continue */
2612 
2614 CVAPI(int) cvGetErrMode( void );
2615 
2617 CVAPI(int) cvSetErrMode( int mode );
2618 
2622 CVAPI(void) cvError( int status, const char* func_name,
2623  const char* err_msg, const char* file_name, int line );
2624 
2626 CVAPI(const char*) cvErrorStr( int status );
2627 
2629 CVAPI(int) cvGetErrInfo( const char** errcode_desc, const char** description,
2630  const char** filename, int* line );
2631 
2633 CVAPI(int) cvErrorFromIppStatus( int ipp_status );
2634 
2635 typedef int (CV_CDECL *CvErrorCallback)( int status, const char* func_name,
2636  const char* err_msg, const char* file_name, int line, void* userdata );
2637 
2639 CVAPI(CvErrorCallback) cvRedirectError( CvErrorCallback error_handler,
2640  void* userdata CV_DEFAULT(NULL),
2641  void** prev_userdata CV_DEFAULT(NULL) );
2642 
2644 CVAPI(int) cvNulDevReport( int status, const char* func_name, const char* err_msg,
2645  const char* file_name, int line, void* userdata );
2646 
2648 CVAPI(int) cvStdErrReport( int status, const char* func_name, const char* err_msg,
2649  const char* file_name, int line, void* userdata );
2650 
2652 CVAPI(int) cvGuiBoxReport( int status, const char* func_name, const char* err_msg,
2653  const char* file_name, int line, void* userdata );
2654 
2655 #define OPENCV_ERROR(status,func,context) \
2656 cvError((status),(func),(context),__FILE__,__LINE__)
2657 
2658 #define OPENCV_ASSERT(expr,func,context) \
2659 {if (! (expr)) \
2660 {OPENCV_ERROR(CV_StsInternal,(func),(context));}}
2661 
2662 #define OPENCV_CALL( Func ) \
2663 { \
2664 Func; \
2665 }
2666 
2667 
2669 #ifdef CV_NO_FUNC_NAMES
2670 #define CV_FUNCNAME( Name )
2671 #define cvFuncName ""
2672 #else
2673 #define CV_FUNCNAME( Name ) \
2674 static char cvFuncName[] = Name
2675 #endif
2676 
2677 
2682 #define CV_ERROR( Code, Msg ) \
2683 { \
2684  cvError( (Code), cvFuncName, Msg, __FILE__, __LINE__ ); \
2685  __CV_EXIT__; \
2686 }
2687 
2693 #define CV_CHECK() \
2694 { \
2695  if( cvGetErrStatus() < 0 ) \
2696  CV_ERROR( CV_StsBackTrace, "Inner function failed." ); \
2697 }
2698 
2699 
2705 #define CV_CALL( Func ) \
2706 { \
2707  Func; \
2708  CV_CHECK(); \
2709 }
2710 
2711 
2713 #define CV_ASSERT( Condition ) \
2714 { \
2715  if( !(Condition) ) \
2716  CV_ERROR( CV_StsInternal, "Assertion: " #Condition " failed" ); \
2717 }
2718 
2719 #define __CV_BEGIN__ {
2720 #define __CV_END__ goto exit; exit: ; }
2721 #define __CV_EXIT__ goto exit
2722 
2725 #ifdef __cplusplus
2726 } // extern "C"
2727 #endif
2728 
2729 #ifdef __cplusplus
2730 
2731 #include "opencv2/core/utility.hpp"
2732 
2733 namespace cv
2734 {
2735 
2738 
2740 
2742 CV_EXPORTS Mat cvarrToMat(const CvArr* arr, bool copyData=false,
2743  bool allowND=true, int coiMode=0,
2744  AutoBuffer<double>* buf=0);
2745 
2746 static inline Mat cvarrToMatND(const CvArr* arr, bool copyData=false, int coiMode=0)
2747 {
2748  return cvarrToMat(arr, copyData, true, coiMode);
2749 }
2750 
2751 
2753 CV_EXPORTS void extractImageCOI(const CvArr* arr, OutputArray coiimg, int coi=-1);
2755 CV_EXPORTS void insertImageCOI(InputArray coiimg, CvArr* arr, int coi=-1);
2756 
2757 
2758 
2760 
2761 template<> struct DefaultDeleter<CvMat>{ CV_EXPORTS void operator ()(CvMat* obj) const; };
2762 template<> struct DefaultDeleter<IplImage>{ CV_EXPORTS void operator ()(IplImage* obj) const; };
2763 template<> struct DefaultDeleter<CvMatND>{ CV_EXPORTS void operator ()(CvMatND* obj) const; };
2764 template<> struct DefaultDeleter<CvSparseMat>{ CV_EXPORTS void operator ()(CvSparseMat* obj) const; };
2765 template<> struct DefaultDeleter<CvMemStorage>{ CV_EXPORTS void operator ()(CvMemStorage* obj) const; };
2766 
2768 
2769 template<typename _Tp> class SeqIterator;
2770 
2771 typedef Ptr<CvMemStorage> MemStorage;
2772 
2783 template<typename _Tp> class Seq
2784 {
2785 public:
2786  typedef SeqIterator<_Tp> iterator;
2787  typedef SeqIterator<_Tp> const_iterator;
2788 
2790  Seq();
2792  Seq(const CvSeq* seq);
2794  Seq(MemStorage& storage, int headerSize = sizeof(CvSeq));
2796  _Tp& operator [](int idx);
2798  const _Tp& operator[](int idx) const;
2800  SeqIterator<_Tp> begin() const;
2802  SeqIterator<_Tp> end() const;
2804  size_t size() const;
2806  int type() const;
2808  int depth() const;
2810  int channels() const;
2812  size_t elemSize() const;
2814  size_t index(const _Tp& elem) const;
2816  void push_back(const _Tp& elem);
2818  void push_front(const _Tp& elem);
2820  void push_back(const _Tp* elems, size_t count);
2822  void push_front(const _Tp* elems, size_t count);
2824  void insert(int idx, const _Tp& elem);
2826  void insert(int idx, const _Tp* elems, size_t count);
2828  void remove(int idx);
2830  void remove(const Range& r);
2831 
2833  _Tp& front();
2835  const _Tp& front() const;
2837  _Tp& back();
2839  const _Tp& back() const;
2841  bool empty() const;
2842 
2844  void clear();
2846  void pop_front();
2848  void pop_back();
2850  void pop_front(_Tp* elems, size_t count);
2852  void pop_back(_Tp* elems, size_t count);
2853 
2855  void copyTo(std::vector<_Tp>& vec, const Range& range=Range::all()) const;
2857  operator std::vector<_Tp>() const;
2858 
2859  CvSeq* seq;
2860 };
2861 
2862 
2866 template<typename _Tp> class SeqIterator : public CvSeqReader
2867 {
2868 public:
2870  SeqIterator();
2872  SeqIterator(const Seq<_Tp>& seq, bool seekEnd=false);
2874  void seek(size_t pos);
2876  size_t tell() const;
2878  _Tp& operator *();
2880  const _Tp& operator *() const;
2882  SeqIterator& operator ++();
2884  SeqIterator operator ++(int) const;
2886  SeqIterator& operator --();
2888  SeqIterator operator --(int) const;
2889 
2891  SeqIterator& operator +=(int);
2893  SeqIterator& operator -=(int);
2894 
2895  // this is index of the current element module seq->total*2
2896  // (to distinguish between 0 and seq->total)
2897  int index;
2898 };
2899 
2900 
2901 
2902 // bridge C++ => C Seq API
2903 CV_EXPORTS schar* seqPush( CvSeq* seq, const void* element=0);
2904 CV_EXPORTS schar* seqPushFront( CvSeq* seq, const void* element=0);
2905 CV_EXPORTS void seqPop( CvSeq* seq, void* element=0);
2906 CV_EXPORTS void seqPopFront( CvSeq* seq, void* element=0);
2907 CV_EXPORTS void seqPopMulti( CvSeq* seq, void* elements,
2908  int count, int in_front=0 );
2909 CV_EXPORTS void seqRemove( CvSeq* seq, int index );
2910 CV_EXPORTS void clearSeq( CvSeq* seq );
2911 CV_EXPORTS schar* getSeqElem( const CvSeq* seq, int index );
2912 CV_EXPORTS void seqRemoveSlice( CvSeq* seq, CvSlice slice );
2913 CV_EXPORTS void seqInsertSlice( CvSeq* seq, int before_index, const CvArr* from_arr );
2914 
2915 template<typename _Tp> inline Seq<_Tp>::Seq() : seq(0) {}
2916 template<typename _Tp> inline Seq<_Tp>::Seq( const CvSeq* _seq ) : seq((CvSeq*)_seq)
2917 {
2918  CV_Assert(!_seq || _seq->elem_size == sizeof(_Tp));
2919 }
2920 
2921 template<typename _Tp> inline Seq<_Tp>::Seq( MemStorage& storage,
2922  int headerSize )
2923 {
2924  CV_Assert(headerSize >= (int)sizeof(CvSeq));
2925  seq = cvCreateSeq(DataType<_Tp>::type, headerSize, sizeof(_Tp), storage);
2926 }
2927 
2928 template<typename _Tp> inline _Tp& Seq<_Tp>::operator [](int idx)
2929 { return *(_Tp*)getSeqElem(seq, idx); }
2930 
2931 template<typename _Tp> inline const _Tp& Seq<_Tp>::operator [](int idx) const
2932 { return *(_Tp*)getSeqElem(seq, idx); }
2933 
2934 template<typename _Tp> inline SeqIterator<_Tp> Seq<_Tp>::begin() const
2935 { return SeqIterator<_Tp>(*this); }
2936 
2937 template<typename _Tp> inline SeqIterator<_Tp> Seq<_Tp>::end() const
2938 { return SeqIterator<_Tp>(*this, true); }
2939 
2940 template<typename _Tp> inline size_t Seq<_Tp>::size() const
2941 { return seq ? seq->total : 0; }
2942 
2943 template<typename _Tp> inline int Seq<_Tp>::type() const
2944 { return seq ? CV_MAT_TYPE(seq->flags) : 0; }
2945 
2946 template<typename _Tp> inline int Seq<_Tp>::depth() const
2947 { return seq ? CV_MAT_DEPTH(seq->flags) : 0; }
2948 
2949 template<typename _Tp> inline int Seq<_Tp>::channels() const
2950 { return seq ? CV_MAT_CN(seq->flags) : 0; }
2951 
2952 template<typename _Tp> inline size_t Seq<_Tp>::elemSize() const
2953 { return seq ? seq->elem_size : 0; }
2954 
2955 template<typename _Tp> inline size_t Seq<_Tp>::index(const _Tp& elem) const
2956 { return cvSeqElemIdx(seq, &elem); }
2957 
2958 template<typename _Tp> inline void Seq<_Tp>::push_back(const _Tp& elem)
2959 { cvSeqPush(seq, &elem); }
2960 
2961 template<typename _Tp> inline void Seq<_Tp>::push_front(const _Tp& elem)
2962 { cvSeqPushFront(seq, &elem); }
2963 
2964 template<typename _Tp> inline void Seq<_Tp>::push_back(const _Tp* elem, size_t count)
2965 { cvSeqPushMulti(seq, elem, (int)count, 0); }
2966 
2967 template<typename _Tp> inline void Seq<_Tp>::push_front(const _Tp* elem, size_t count)
2968 { cvSeqPushMulti(seq, elem, (int)count, 1); }
2969 
2970 template<typename _Tp> inline _Tp& Seq<_Tp>::back()
2971 { return *(_Tp*)getSeqElem(seq, -1); }
2972 
2973 template<typename _Tp> inline const _Tp& Seq<_Tp>::back() const
2974 { return *(const _Tp*)getSeqElem(seq, -1); }
2975 
2976 template<typename _Tp> inline _Tp& Seq<_Tp>::front()
2977 { return *(_Tp*)getSeqElem(seq, 0); }
2978 
2979 template<typename _Tp> inline const _Tp& Seq<_Tp>::front() const
2980 { return *(const _Tp*)getSeqElem(seq, 0); }
2981 
2982 template<typename _Tp> inline bool Seq<_Tp>::empty() const
2983 { return !seq || seq->total == 0; }
2984 
2985 template<typename _Tp> inline void Seq<_Tp>::clear()
2986 { if(seq) clearSeq(seq); }
2987 
2988 template<typename _Tp> inline void Seq<_Tp>::pop_back()
2989 { seqPop(seq); }
2990 
2991 template<typename _Tp> inline void Seq<_Tp>::pop_front()
2992 { seqPopFront(seq); }
2993 
2994 template<typename _Tp> inline void Seq<_Tp>::pop_back(_Tp* elem, size_t count)
2995 { seqPopMulti(seq, elem, (int)count, 0); }
2996 
2997 template<typename _Tp> inline void Seq<_Tp>::pop_front(_Tp* elem, size_t count)
2998 { seqPopMulti(seq, elem, (int)count, 1); }
2999 
3000 template<typename _Tp> inline void Seq<_Tp>::insert(int idx, const _Tp& elem)
3001 { seqInsert(seq, idx, &elem); }
3002 
3003 template<typename _Tp> inline void Seq<_Tp>::insert(int idx, const _Tp* elems, size_t count)
3004 {
3005  CvMat m = cvMat(1, count, DataType<_Tp>::type, elems);
3006  seqInsertSlice(seq, idx, &m);
3007 }
3008 
3009 template<typename _Tp> inline void Seq<_Tp>::remove(int idx)
3010 { seqRemove(seq, idx); }
3011 
3012 template<typename _Tp> inline void Seq<_Tp>::remove(const Range& r)
3013 { seqRemoveSlice(seq, cvSlice(r.start, r.end)); }
3014 
3015 template<typename _Tp> inline void Seq<_Tp>::copyTo(std::vector<_Tp>& vec, const Range& range) const
3016 {
3017  size_t len = !seq ? 0 : range == Range::all() ? seq->total : range.end - range.start;
3018  vec.resize(len);
3019  if( seq && len )
3020  cvCvtSeqToArray(seq, &vec[0], cvSlice(range));
3021 }
3022 
3023 template<typename _Tp> inline Seq<_Tp>::operator std::vector<_Tp>() const
3024 {
3025  std::vector<_Tp> vec;
3026  copyTo(vec);
3027  return vec;
3028 }
3029 
3030 template<typename _Tp> inline SeqIterator<_Tp>::SeqIterator()
3031 { memset(this, 0, sizeof(*this)); }
3032 
3033 template<typename _Tp> inline SeqIterator<_Tp>::SeqIterator(const Seq<_Tp>& _seq, bool seekEnd)
3034 {
3035  cvStartReadSeq(_seq.seq, this);
3036  index = seekEnd ? _seq.seq->total : 0;
3037 }
3038 
3039 template<typename _Tp> inline void SeqIterator<_Tp>::seek(size_t pos)
3040 {
3041  cvSetSeqReaderPos(this, (int)pos, false);
3042  index = pos;
3043 }
3044 
3045 template<typename _Tp> inline size_t SeqIterator<_Tp>::tell() const
3046 { return index; }
3047 
3048 template<typename _Tp> inline _Tp& SeqIterator<_Tp>::operator *()
3049 { return *(_Tp*)ptr; }
3050 
3051 template<typename _Tp> inline const _Tp& SeqIterator<_Tp>::operator *() const
3052 { return *(const _Tp*)ptr; }
3053 
3054 template<typename _Tp> inline SeqIterator<_Tp>& SeqIterator<_Tp>::operator ++()
3055 {
3056  CV_NEXT_SEQ_ELEM(sizeof(_Tp), *this);
3057  if( ++index >= seq->total*2 )
3058  index = 0;
3059  return *this;
3060 }
3061 
3062 template<typename _Tp> inline SeqIterator<_Tp> SeqIterator<_Tp>::operator ++(int) const
3063 {
3064  SeqIterator<_Tp> it = *this;
3065  ++*this;
3066  return it;
3067 }
3068 
3069 template<typename _Tp> inline SeqIterator<_Tp>& SeqIterator<_Tp>::operator --()
3070 {
3071  CV_PREV_SEQ_ELEM(sizeof(_Tp), *this);
3072  if( --index < 0 )
3073  index = seq->total*2-1;
3074  return *this;
3075 }
3076 
3077 template<typename _Tp> inline SeqIterator<_Tp> SeqIterator<_Tp>::operator --(int) const
3078 {
3079  SeqIterator<_Tp> it = *this;
3080  --*this;
3081  return it;
3082 }
3083 
3084 template<typename _Tp> inline SeqIterator<_Tp>& SeqIterator<_Tp>::operator +=(int delta)
3085 {
3086  cvSetSeqReaderPos(this, delta, 1);
3087  index += delta;
3088  int n = seq->total*2;
3089  if( index < 0 )
3090  index += n;
3091  if( index >= n )
3092  index -= n;
3093  return *this;
3094 }
3095 
3096 template<typename _Tp> inline SeqIterator<_Tp>& SeqIterator<_Tp>::operator -=(int delta)
3097 {
3098  return (*this += -delta);
3099 }
3100 
3101 template<typename _Tp> inline ptrdiff_t operator - (const SeqIterator<_Tp>& a,
3102  const SeqIterator<_Tp>& b)
3103 {
3104  ptrdiff_t delta = a.index - b.index, n = a.seq->total;
3105  if( delta > n || delta < -n )
3106  delta += delta < 0 ? n : -n;
3107  return delta;
3108 }
3109 
3110 template<typename _Tp> inline bool operator == (const SeqIterator<_Tp>& a,
3111  const SeqIterator<_Tp>& b)
3112 {
3113  return a.seq == b.seq && a.index == b.index;
3114 }
3115 
3116 template<typename _Tp> inline bool operator != (const SeqIterator<_Tp>& a,
3117  const SeqIterator<_Tp>& b)
3118 {
3119  return !(a == b);
3120 }
3121 
3123 
3124 } // cv
3125 
3126 #endif
3127 
3128 #endif
T begin(T... args)
CV_EXPORTS MatExpr operator-(const Mat &a, const Mat &b)
CV_EXPORTS MatExpr operator!=(const Mat &a, const Mat &b)
CV_EXPORTS MatExpr operator==(const Mat &a, const Mat &b)
static Range all()
void CV_EXPORTS_W copyTo(InputArray src, OutputArray dst, InputArray mask)
This is an overloaded member function, provided for convenience (python) Copies the matrix to another...
const _OutputArray & OutputArray
Definition: mat.hpp:444
CV__DEBUG_NS_END typedef const _InputArray & InputArray
Definition: mat.hpp:442
const CvArr * angle
Definition: core_c.h:1194
CvMemStorage CvSeq CvCmpFunc is_equal
Definition: core_c.h:1724
int src_count
Definition: core_c.h:999
const CvArr * lower
Definition: core_c.h:1139
void void * frame
Definition: core_c.h:1913
CvGraphVtx CvGraphVtx * end_vtx
Definition: core_c.h:1804
#define CV_GRAPH_ALL_ITEMS
Definition: core_c.h:1852
int rows
Definition: core_c.h:257
CvMat int int end_col
Definition: core_c.h:402
int CvArr int dst_count
Definition: core_c.h:1000
CvMat * roots
Definition: core_c.h:1263
double int default_max_iters
Definition: core_c.h:1046
int sizeof_header
Definition: core_c.h:836
#define cvFree(ptr)
Definition: core_c.h:92
struct CvTreeNodeIterator CvTreeNodeIterator
CvMat * roots2
Definition: core_c.h:1266
int int end_idx
Definition: core_c.h:1799
#define CV_REDUCE_SUM
Definition: core_c.h:1492
CvCmpFunc func
Definition: core_c.h:1712
CvArr int order
Definition: core_c.h:1311
CvMemStorage CvSeq ** labels
Definition: core_c.h:1724
CV_INLINE CvMat cvMat(int rows, int cols, int type, void *data CV_DEFAULT(NULL))
Definition: types_c.h:537
int int int edge_size
Definition: core_c.h:1781
CvGraphVtx * vtx
Definition: core_c.h:1791
size_t size_t CvMemStorage * storage
Definition: core_c.h:1587
int CvScalar value
Definition: core_c.h:720
IplImage *(CV_STDCALL * Cv_iplCloneImage)(const IplImage *)
Definition: core_c.h:1944
uint64 CvRNG
Definition: types_c.h:214
int int void int CvSeq CvSeqBlock * block
Definition: core_c.h:1690
int int idx1
Definition: core_c.h:654
int CvArr int int int * new_sizes
Definition: core_c.h:837
int int void int total
Definition: core_c.h:1689
const CvArr const CvArr const CvArr CvArr int flags
Definition: core_c.h:1342
#define CV_AUTOSTEP
Definition: core_c.h:223
int int channels
Definition: core_c.h:100
const CvArr CvArr int cmp_op
Definition: core_c.h:1157
CvSeqReader * reader
Definition: core_c.h:1668
const void CvCmpFunc int is_sorted
Definition: core_c.h:1716
double * min_val
Definition: core_c.h:1450
CvMat int int end_row
Definition: core_c.h:375
const CvArr const CvArr const CvArr * src3
Definition: core_c.h:994
CvArr int CvScalar CvScalar param2
Definition: core_c.h:1248
double double end
Definition: core_c.h:1381
CvMat * header
Definition: core_c.h:782
int CvArr int const int int pair_count
Definition: core_c.h:1001
CvMat * submat
Definition: core_c.h:360
CvArr CvArr CvArr * eigenvects
Definition: core_c.h:1420
const void * elem
Definition: core_c.h:1715
CvGraphVtx * start_vtx
Definition: core_c.h:1804
CvArr CvArr * evals
Definition: core_c.h:1368
Cv_iplAllocateImageData allocate_data
Definition: core_c.h:1963
CV_INLINE void cvSetRemoveByPtr(CvSet *set_header, void *elem)
Definition: core_c.h:1755
CV_INLINE void cvSubS(const CvArr *src, CvScalar value, CvArr *dst, const CvArr *mask CV_DEFAULT(NULL))
Definition: core_c.h:1065
CvArr * dst
Definition: core_c.h:875
int cols
Definition: core_c.h:221
const void int max_level
Definition: core_c.h:1906
double start
Definition: core_c.h:1381
struct CvGraphScanner CvGraphScanner
CV_INLINE int cvIncRefData(CvArr *arr)
Increments array data reference counter.
Definition: core_c.h:327
CvArr * W
Definition: core_c.h:1335
int int int idx2
Definition: core_c.h:656
CvArr int CvScalar param1
Definition: core_c.h:1248
const CvArr const CvArr * upper
Definition: core_c.h:1140
int delta_elems
Definition: core_c.h:1591
double const CvArr double beta
Definition: core_c.h:1094
CvMat int start_row
Definition: core_c.h:375
size_t header_size
Definition: core_c.h:1586
CvSlice slice
Definition: core_c.h:1693
CvArr int dist_type
Definition: core_c.h:1247
CvRect rect
Definition: core_c.h:193
#define CV_LU
Definition: core_c.h:1344
CvArr CvArr * eigenvals
Definition: core_c.h:1420
Cv_iplAllocateImageData Cv_iplDeallocate deallocate
Definition: core_c.h:1964
const char ** description
Definition: core_c.h:2629
CvArr ** arrs
Definition: core_c.h:588
void(CV_STDCALL * Cv_iplDeallocate)(IplImage *, int)
Definition: core_c.h:1942
const int * idx
Definition: core_c.h:668
int CvArr CvArr * avg
Definition: core_c.h:1414
int const CvArr * from_arr
Definition: core_c.h:1706
int int vtx_size
Definition: core_c.h:1781
void * parent
Definition: core_c.h:1913
CV_INLINE CvSetElem * cvGetSetElem(const CvSet *set_header, int idx)
Definition: core_c.h:1770
const char const char const char int line
Definition: core_c.h:2623
CV_INLINE void cvReleaseMatND(CvMatND **mat)
Deallocates a multi-dimensional array.
Definition: core_c.h:478
CvArr const CvMat * mat
Definition: core_c.h:1308
CVAPI(void *) cvAlloc(size_t size)
Changes the shape of a multi-dimensional array without copying the data.
CvMemStoragePos * pos
Definition: core_c.h:1573
Cv_iplAllocateImageData Cv_iplDeallocate Cv_iplCreateROI Cv_iplCloneImage clone_image
Definition: core_c.h:1966
CV_INLINE void cvDecRefData(CvArr *arr)
Decrements an array data reference counter.
Definition: core_c.h:301
CvScalar CvScalar * std_dev
Definition: core_c.h:1446
int(CV_CDECL * CvErrorCallback)(int status, const char *func_name, const char *err_msg, const char *file_name, int line, void *userdata)
Definition: core_c.h:2635
CvScalar scale
Definition: core_c.h:1088
IplROI *(CV_STDCALL * Cv_iplCreateROI)(int, int, int, int, int)
Definition: core_c.h:1943
CvSparseMatIterator * mat_iterator
Definition: core_c.h:515
const void * first
Definition: core_c.h:1906
int index
Definition: core_c.h:634
const CvArr const CvArr * src2
Definition: core_c.h:994
int coi
Definition: core_c.h:172
const void * element
Definition: core_c.h:1642
CvArr const CvArr CvMatND * stubs
Definition: core_c.h:589
int vtx_idx
Definition: core_c.h:1826
int start_idx
Definition: core_c.h:1799
int CvScalar * scalar
Definition: core_c.h:430
CvArr * dst0
Definition: core_c.h:988
int before_index
Definition: core_c.h:1622
CvSize size
Definition: core_c.h:112
Cv_iplAllocateImageData Cv_iplDeallocate Cv_iplCreateROI create_roi
Definition: core_c.h:1965
CV_INLINE CvSlice cvSlice(int start, int end)
Definition: types_c.h:1344
int direction
Definition: core_c.h:1727
const CvArr * src1
Definition: core_c.h:993
IplImage * image_header
Definition: core_c.h:796
struct _IplTileInfo IplTileInfo
Definition: types_c.h:366
int int type
Definition: core_c.h:221
CvRNG * rng
Definition: core_c.h:1250
#define CV_L2
Definition: core_c.h:1461
double double * max_val
Definition: core_c.h:1450
int count
Definition: core_c.h:1413
int cluster_count
Definition: core_c.h:1926
CvMemStorage CvSeq CvCmpFunc void * userdata
Definition: core_c.h:1724
CV_INLINE CvMat * cvGetRow(const CvArr *arr, CvMat *submat, int row)
Definition: core_c.h:383
CV_INLINE CvScalar cvRealScalar(double val0)
Definition: types_c.h:1440
CvArr * evects
Definition: core_c.h:1368
CV_INLINE CvSeq * cvCloneSeq(const CvSeq *seq, CvMemStorage *storage CV_DEFAULT(NULL))
Definition: core_c.h:1697
#define CV_IS_MATND(mat)
Definition: types_c.h:717
const CvSeq * seq
Definition: core_c.h:1548
#define CV_PREV_SEQ_ELEM(elem_size, reader)
Definition: types_c.h:1915
const CvArr const CvArr const CvArr CvArr * X
Definition: core_c.h:1342
CvArr double power
Definition: core_c.h:1199
const CvArr const CvArr const CvArr * B
Definition: core_c.h:1341
CvSize int int int origin CV_DEFAULT(0)
const char const char * err_msg
Definition: core_c.h:2623
const CvArr * vec2
Definition: core_c.h:1429
double default_eps
Definition: core_c.h:1045
void int step
Definition: core_c.h:905
const CvArr * U
Definition: core_c.h:1340
int CvArr int int new_dims
Definition: core_c.h:837
CvMat int start_col
Definition: core_c.h:402
int(CV_CDECL * CvCmpFunc)(const void *a, const void *b, void *userdata)
Definition: core_c.h:1709
CvSeqWriter * writer
Definition: core_c.h:1646
CvArr const CvArr * mask
Definition: core_c.h:589
#define CV_MAX_ARR
Definition: core_c.h:566
struct CvNArrayIterator CvNArrayIterator
CvArr * arr
Definition: core_c.h:1247
CV_INLINE CvMat * cvGetCol(const CvArr *arr, CvMat *submat, int col)
Definition: core_c.h:409
void(CV_STDCALL * Cv_iplAllocateImageData)(IplImage *, int, int)
Definition: core_c.h:1941
CvArr const CvArr * lut
Definition: core_c.h:1893
#define CV_NEXT_SEQ_ELEM(elem_size, reader)
Definition: types_c.h:1905
void CvArr
This is the "metatype" used only as a function parameter.
Definition: types_c.h:133
CvArr CvArr CvArr CvArr * dst3
Definition: core_c.h:989
CvArr CvArr * dst1
Definition: core_c.h:988
int depth
Definition: core_c.h:100
const char const char ** filename
Definition: core_c.h:2630
void * data
Definition: core_c.h:427
CvArr * mean
Definition: core_c.h:1419
const CvArr CvArr * x
Definition: core_c.h:1195
double const CvArr double double gamma
Definition: core_c.h:1095
double alpha
Definition: core_c.h:1093
CvArr CvArr CvArr * dst2
Definition: core_c.h:989
int CvArr CvTermCriteria termcrit
Definition: core_c.h:1927
CV_INLINE CvSparseNode * cvGetNextSparseNode(CvSparseMatIterator *mat_iterator)
Returns the next sparse matrix element.
Definition: core_c.h:545
int CvArr int const int * from_to
Definition: core_c.h:1001
const CvArr const CvArr * V
Definition: core_c.h:1341
int CvArr * cov_mat
Definition: core_c.h:1414
#define CV_IS_MAT(mat)
Definition: types_c.h:507
const CvArr const CvArr CvArr * result
Definition: core_c.h:1423
const char * func_name
Definition: core_c.h:2622
const CvArr CvArr * magnitude
Definition: core_c.h:1188
const void * elements
Definition: core_c.h:1613
size_t size_t elem_size
Definition: core_c.h:1587
CV_INLINE CvSetElem * cvSetNew(CvSet *set_header)
Definition: core_c.h:1740
const char const char const char * file_name
Definition: core_c.h:2623
int dims
Definition: core_c.h:464
IplImage *(CV_STDCALL * Cv_iplCreateImageHeader)(int, int, int, char *, char *, int, int, int, int, int, IplROI *, IplImage *, void *, IplTileInfo *)
Definition: core_c.h:1939
CV_INLINE CvScalar cvScalar(double val0, double val1 CV_DEFAULT(0), double val2 CV_DEFAULT(0), double val3 CV_DEFAULT(0))
Definition: types_c.h:1401
#define CV_SET_ELEM_IDX_MASK
Definition: types_c.h:1594
int CvArr int new_cn
Definition: core_c.h:837
int idx0
Definition: core_c.h:652
const int * sizes
Definition: core_c.h:440
CvArr const CvArr CvMatND CvNArrayIterator * array_iterator
Definition: core_c.h:590
#define CV_IS_SET_ELEM(ptr)
Definition: types_c.h:1598
#define CV_WHOLE_SEQ
Definition: types_c.h:1318
const void CvCmpFunc int int * elem_idx
Definition: core_c.h:1716
#define CV_SET_ELEM_FREE_FLAG
Definition: types_c.h:1595
CvArr const CvMat * transmat
Definition: core_c.h:1302
const CvArr * y
Definition: core_c.h:1187
signed char schar
Definition: interface.h:48
#define CV_MAT_DEPTH(flags)
Definition: interface.h:83
unsigned char uchar
Definition: interface.h:51
int64_t int64
Definition: interface.h:61
CV_INLINE v_reg< _Tp, n > operator*(const v_reg< _Tp, n > &a, const v_reg< _Tp, n > &b)
Multiply values.
CV_INLINE v_reg< _Tp, n > & operator-=(v_reg< _Tp, n > &a, const v_reg< _Tp, n > &b)
CV_INLINE v_reg< _Tp, n > & operator+=(v_reg< _Tp, n > &a, const v_reg< _Tp, n > &b)
#define CV_EXPORTS
Definition: cvdef.h:435
CV_INLINE int cvRound(double value)
Rounds floating-point number to the nearest integer.
Definition: fast_math.hpp:200
#define CV_STDCALL
Definition: cvdef.h:209
#define CV_MAT_CN(flags)
Definition: cvdef.h:495
#define CV_CDECL
Definition: cvdef.h:208
#define CV_MAX_DIM
Definition: cvdef.h:493
#define CV_MAT_TYPE(flags)
Definition: cvdef.h:497
#define CV_Assert(expr)
Checks a condition at runtime and throws exception if it fails.
Definition: base.hpp:342
#define CV_INLINE
Definition: cvdef.h:218
CvArr int block_size
Definition: imgproc_c.h:877
CvRect r
Definition: imgproc_c.h:984
CvSize int int int CvPoint int delta
Definition: imgproc_c.h:1168
CvArr CvSize range
Definition: imgproc_c.h:781
int CvMemStorage int double eps
Definition: imgproc_c.h:493
const CvArr CvArr int method
Definition: imgproc_c.h:384
CvPoint2D32f int CvSize CvSize CvTermCriteria criteria
Definition: imgproc_c.h:900
T memset(T... args)
"black box" representation of the file storage associated with a file on disk.
Definition: calib3d.hpp:441
DualQuat< T > operator*(const T a, const DualQuat< T > &q)
Definition: dualquaternion.inl.hpp:274
T remove(T... args)
T resize(T... args)
Definition: types_c.h:1635
Definition: core_c.h:1864
CvGraph * graph
Definition: core_c.h:1869
int index
Definition: core_c.h:1871
CvGraphVtx * dst
Definition: core_c.h:1866
int mask
Definition: core_c.h:1872
CvGraphEdge * edge
Definition: core_c.h:1867
CvSeq * stack
Definition: core_c.h:1870
CvGraphVtx * vtx
Definition: core_c.h:1865
Definition: types_c.h:1641
Definition: types_c.h:1662
Definition: types_c.h:674
Definition: types_c.h:455
union CvMat::@77 data
uchar * ptr
Definition: types_c.h:465
int * refcount
Definition: types_c.h:460
Definition: types_c.h:1498
Definition: types_c.h:1482
Definition: core_c.h:570
int stack[CV_MAX_DIM]
Definition: core_c.h:575
CvSize size
Definition: core_c.h:573
int count
Definition: core_c.h:571
int dims
Definition: core_c.h:572
CvMatND * hdr[CV_MAX_ARR]
Definition: core_c.h:576
uchar * ptr[CV_MAX_ARR]
Definition: core_c.h:574
Definition: types_c.h:935
Definition: types_c.h:832
Definition: types_c.h:1367
double val[4]
Definition: types_c.h:1368
Definition: types_c.h:1508
Definition: types_c.h:1861
Definition: types_c.h:1836
Definition: types_c.h:1558
Definition: types_c.h:1577
Definition: types_c.h:1588
Definition: types_c.h:1158
Definition: types_c.h:1321
Definition: types_c.h:771
CvSparseNode * node
Definition: types_c.h:773
int curidx
Definition: types_c.h:774
CvSparseMat * mat
Definition: types_c.h:772
Definition: types_c.h:731
void ** hashtable
Definition: types_c.h:738
Definition: types_c.h:764
struct CvSparseNode * next
Definition: types_c.h:766
Definition: types_c.h:902
Definition: core_c.h:1898
int level
Definition: core_c.h:1900
int max_level
Definition: core_c.h:1901
const void * node
Definition: core_c.h:1899
Definition: types_c.h:314
Definition: types_c.h:369