1 # 1 "../../../cv/include/cv.h"
4 # 1 "../../../cv/include/cv.h"
5 # 58 "../../../cv/include/cv.h"
6 # 1 "../../../cxcore/include/cxcore.h" 1
7 # 69 "../../../cxcore/include/cxcore.h"
8 # 1 "../../../cxcore/include/cxtypes.h" 1
9 # 144 "../../../cxcore/include/cxtypes.h"
10 typedef long long int64;
11 typedef unsigned long long uint64;
15 typedef unsigned char uchar;
16 typedef unsigned short ushort;
39 # 205 "../../../cxcore/include/cxtypes.h"
40 inline int cvRound( double value )
42 # 225 "../../../cxcore/include/cxtypes.h"
44 temp.f = value + 6755399441055744.0;
50 inline int cvFloor( double value )
57 int temp = cvRound(value);
59 diff.f = (float)(value - temp);
60 return temp - (diff.i < 0);
65 inline int cvCeil( double value )
72 int temp = cvRound(value);
74 diff.f = (float)(temp - value);
75 return temp + (diff.i < 0);
82 inline int cvIsNaN( double value )
91 return ((unsigned)(ieee754.u >> 32) & 0x7fffffff) +
92 ((unsigned)ieee754.u != 0) > 0x7ff00000;
97 inline int cvIsInf( double value )
106 return ((unsigned)(ieee754.u >> 32) & 0x7fffffff) == 0x7ff00000 &&
107 (unsigned)ieee754.u == 0;
114 typedef uint64 CvRNG;
116 inline CvRNG cvRNG( int64 seed = -1)
118 CvRNG rng = seed ? (uint64)seed : (uint64)(int64)-1;
123 inline unsigned cvRandInt( CvRNG* rng )
126 temp = (uint64)(unsigned)temp*1554115554 + (temp >> 32);
128 return (unsigned)temp;
132 inline double cvRandReal( CvRNG* rng )
134 return cvRandInt(rng)*2.3283064365386962890625e-10 ;
136 # 360 "../../../cxcore/include/cxtypes.h"
137 typedef struct _IplImage
156 struct _IplImage *maskROI;
158 struct _IplTileInfo *tileInfo;
166 char *imageDataOrigin;
172 typedef struct _IplTileInfo IplTileInfo;
174 typedef struct _IplROI
184 typedef struct _IplConvKernel
195 typedef struct _IplConvKernelFP
204 # 538 "../../../cxcore/include/cxtypes.h"
242 # 615 "../../../cxcore/include/cxtypes.h"
243 inline CvMat cvMat( int rows, int cols, int type, void* data = NULL)
247 assert( (unsigned)((type) & ((1 << 3) - 1)) <= 6 );
248 type = ((type) & ((1 << 3)*64 - 1));
249 m.type = 0x42420000 | (1 << 14) | type;
252 m.step = rows > 1 ? m.cols*(((((type) & ((64 - 1) << 3)) >> 3) + 1) << ((((sizeof(size_t)/4+1)*16384|0x3a50) >> ((type) & ((1 << 3) - 1))*2) & 3)) : 0;
253 m.data.ptr = (uchar*)data;
259 # 645 "../../../cxcore/include/cxtypes.h"
260 inline double cvmGet( const CvMat* mat, int row, int col )
264 type = ((mat->type) & ((1 << 3)*64 - 1));
265 assert( (unsigned)row < (unsigned)mat->rows &&
266 (unsigned)col < (unsigned)mat->cols );
268 if( type == ((5) + (((1)-1) << 3)) )
269 return ((float*)(mat->data.ptr + (size_t)mat->step*row))[col];
272 assert( type == ((6) + (((1)-1) << 3)) );
273 return ((double*)(mat->data.ptr + (size_t)mat->step*row))[col];
278 inline void cvmSet( CvMat* mat, int row, int col, double value )
281 type = ((mat->type) & ((1 << 3)*64 - 1));
282 assert( (unsigned)row < (unsigned)mat->rows &&
283 (unsigned)col < (unsigned)mat->cols );
285 if( type == ((5) + (((1)-1) << 3)) )
286 ((float*)(mat->data.ptr + (size_t)mat->step*row))[col] = (float)value;
289 assert( type == ((6) + (((1)-1) << 3)) );
290 ((double*)(mat->data.ptr + (size_t)mat->step*row))[col] = (double)value;
295 inline int cvCvToIplDepth( int type )
297 int depth = ((type) & ((1 << 3) - 1));
298 return ((((sizeof(size_t)<<28)|0x8442211) >> ((depth) & ((1 << 3) - 1))*4) & 15)*8 | (depth == 1 || depth == 3 ||
299 depth == 4 ? 0x80000000 : 0);
301 # 698 "../../../cxcore/include/cxtypes.h"
302 typedef struct CvMatND
327 # 738 "../../../cxcore/include/cxtypes.h"
330 typedef struct CvSparseMat
345 # 765 "../../../cxcore/include/cxtypes.h"
346 typedef struct CvSparseNode
349 struct CvSparseNode* next;
353 typedef struct CvSparseMatIterator
360 # 787 "../../../cxcore/include/cxtypes.h"
361 typedef int CvHistType;
362 # 803 "../../../cxcore/include/cxtypes.h"
363 typedef struct CvHistogram
372 # 833 "../../../cxcore/include/cxtypes.h"
373 typedef struct CvRect
382 inline CvRect cvRect( int x, int y, int width, int height )
395 inline IplROI cvRectToROI( CvRect rect, int coi )
398 roi.xOffset = rect.x;
399 roi.yOffset = rect.y;
400 roi.width = rect.width;
401 roi.height = rect.height;
408 inline CvRect cvROIToRect( IplROI roi )
410 return cvRect( roi.xOffset, roi.yOffset, roi.width, roi.height );
419 typedef struct CvTermCriteria
429 inline CvTermCriteria cvTermCriteria( int type, int max_iter, double epsilon )
434 t.max_iter = max_iter;
435 t.epsilon = (float)epsilon;
443 typedef struct CvPoint
451 inline CvPoint cvPoint( int x, int y )
462 typedef struct CvPoint2D32f
470 inline CvPoint2D32f cvPoint2D32f( double x, double y )
481 inline CvPoint2D32f cvPointTo32f( CvPoint point )
483 return cvPoint2D32f( (float)point.x, (float)point.y );
487 inline CvPoint cvPointFrom32f( CvPoint2D32f point )
490 ipt.x = cvRound(point.x);
491 ipt.y = cvRound(point.y);
497 typedef struct CvPoint3D32f
506 inline CvPoint3D32f cvPoint3D32f( double x, double y, double z )
518 typedef struct CvPoint2D64f
526 inline CvPoint2D64f cvPoint2D64f( double x, double y )
537 typedef struct CvPoint3D64f
546 inline CvPoint3D64f cvPoint3D64f( double x, double y, double z )
567 inline CvSize cvSize( int width, int height )
577 typedef struct CvSize2D32f
585 inline CvSize2D32f cvSize2D32f( double width, double height )
589 s.width = (float)width;
590 s.height = (float)height;
595 typedef struct CvBox2D
606 typedef struct CvLineIterator
624 typedef struct CvSlice
626 int start_index, end_index;
630 inline CvSlice cvSlice( int start, int end )
633 slice.start_index = start;
634 slice.end_index = end;
645 typedef struct CvScalar
651 inline CvScalar cvScalar( double val0, double val1 = 0,
652 double val2 = 0, double val3 = 0)
655 scalar.val[0] = val0; scalar.val[1] = val1;
656 scalar.val[2] = val2; scalar.val[3] = val3;
661 inline CvScalar cvRealScalar( double val0 )
664 scalar.val[0] = val0;
665 scalar.val[1] = scalar.val[2] = scalar.val[3] = 0;
669 inline CvScalar cvScalarAll( double val0123 )
672 scalar.val[0] = val0123;
673 scalar.val[1] = val0123;
674 scalar.val[2] = val0123;
675 scalar.val[3] = val0123;
685 typedef struct CvMemBlock
687 struct CvMemBlock* prev;
688 struct CvMemBlock* next;
694 typedef struct CvMemStorage
699 struct CvMemStorage* parent;
710 typedef struct CvMemStoragePos
720 typedef struct CvSeqBlock
722 struct CvSeqBlock* prev;
723 struct CvSeqBlock* next;
730 # 1215 "../../../cxcore/include/cxtypes.h"
733 int flags; int header_size; struct CvSeq* h_prev; struct CvSeq* h_next; struct CvSeq* v_prev; struct CvSeq* v_next; int total; int elem_size; char* block_max; char* ptr; int delta_elems; CvMemStorage* storage; CvSeqBlock* free_blocks; CvSeqBlock* first;
736 # 1235 "../../../cxcore/include/cxtypes.h"
737 typedef struct CvSetElem
739 int flags; struct CvSetElem* next_free;
750 int flags; int header_size; struct CvSeq* h_prev; struct CvSeq* h_next; struct CvSeq* v_prev; struct CvSeq* v_next; int total; int elem_size; char* block_max; char* ptr; int delta_elems; CvMemStorage* storage; CvSeqBlock* free_blocks; CvSeqBlock* first; CvSetElem* free_elems; int active_count;
753 # 1288 "../../../cxcore/include/cxtypes.h"
754 typedef struct CvGraphEdge
756 int flags; float weight; struct CvGraphEdge* next[2]; struct CvGraphVtx* vtx[2];
760 typedef struct CvGraphVtx
762 int flags; struct CvGraphEdge* first;
766 typedef struct CvGraphVtx2D
768 int flags; struct CvGraphEdge* first;
772 # 1315 "../../../cxcore/include/cxtypes.h"
773 typedef struct CvGraph
775 int flags; int header_size; struct CvSeq* h_prev; struct CvSeq* h_next; struct CvSeq* v_prev; struct CvSeq* v_next; int total; int elem_size; char* block_max; char* ptr; int delta_elems; CvMemStorage* storage; CvSeqBlock* free_blocks; CvSeqBlock* first; CvSetElem* free_elems; int active_count; CvSet* edges;
783 typedef struct CvChain
785 int flags; int header_size; struct CvSeq* h_prev; struct CvSeq* h_next; struct CvSeq* v_prev; struct CvSeq* v_next; int total; int elem_size; char* block_max; char* ptr; int delta_elems; CvMemStorage* storage; CvSeqBlock* free_blocks; CvSeqBlock* first;
796 typedef struct CvContour
798 int flags; int header_size; struct CvSeq* h_prev; struct CvSeq* h_next; struct CvSeq* v_prev; struct CvSeq* v_next; int total; int elem_size; char* block_max; char* ptr; int delta_elems; CvMemStorage* storage; CvSeqBlock* free_blocks; CvSeqBlock* first; CvRect rect; int color; int reserved[3];
802 typedef CvContour CvPoint2DSeq;
803 # 1482 "../../../cxcore/include/cxtypes.h"
804 typedef struct CvSeqWriter
806 int header_size; CvSeq* seq; CvSeqBlock* block; char* ptr; char* block_min; char* block_max;
809 # 1500 "../../../cxcore/include/cxtypes.h"
810 typedef struct CvSeqReader
812 int header_size; CvSeq* seq; CvSeqBlock* block; char* ptr; char* block_min; char* block_max; int delta_index; char* prev_elem;
815 # 1620 "../../../cxcore/include/cxtypes.h"
816 typedef struct CvFileStorage CvFileStorage;
817 # 1630 "../../../cxcore/include/cxtypes.h"
818 typedef struct CvAttrList
821 struct CvAttrList* next;
825 inline CvAttrList cvAttrList( const char** attr = NULL,
826 CvAttrList* next = NULL )
836 # 1683 "../../../cxcore/include/cxtypes.h"
837 typedef struct CvString
846 typedef struct CvStringHashNode
850 struct CvStringHashNode* next;
854 typedef struct CvGenericHash CvFileNodeHash;
857 typedef struct CvFileNode
860 struct CvTypeInfo* info;
876 typedef int ( *CvIsInstanceFunc)( const void* struct_ptr );
877 typedef void ( *CvReleaseFunc)( void** struct_dblptr );
878 typedef void* ( *CvReadFunc)( CvFileStorage* storage, CvFileNode* node );
879 typedef void ( *CvWriteFunc)( CvFileStorage* storage, const char* name,
880 const void* struct_ptr, CvAttrList attributes );
881 typedef void* ( *CvCloneFunc)( const void* struct_ptr );
886 typedef struct CvTypeInfo
890 struct CvTypeInfo* prev;
891 struct CvTypeInfo* next;
892 const char* type_name;
893 CvIsInstanceFunc is_instance;
894 CvReleaseFunc release;
904 typedef struct CvPluginFuncInfo
907 void* default_func_addr;
908 const char* func_names;
914 typedef struct CvModuleInfo
916 struct CvModuleInfo* next;
919 CvPluginFuncInfo* func_tab;
922 # 70 "../../../cxcore/include/cxcore.h" 2
923 # 1 "../../../cxcore/include/cxerror.h" 1
924 # 47 "../../../cxcore/include/cxerror.h"
925 typedef int CVStatus;
926 # 71 "../../../cxcore/include/cxcore.h" 2
927 # 1 "../../../cxcore/include/cvver.h" 1
928 # 72 "../../../cxcore/include/cxcore.h" 2
932 # 85 "../../../cxcore/include/cxcore.h"
933 extern "C" void* cvAlloc( size_t size );
941 extern "C" void cvFree_( void* ptr );
945 extern "C" IplImage* cvCreateImageHeader( CvSize size, int depth, int channels );
948 extern "C" IplImage* cvInitImageHeader( IplImage* image, CvSize size, int depth,
949 int channels, int origin = 0,
953 extern "C" IplImage* cvCreateImage( CvSize size, int depth, int channels );
956 extern "C" void cvReleaseImageHeader( IplImage** image );
959 extern "C" void cvReleaseImage( IplImage** image );
962 extern "C" IplImage* cvCloneImage( const IplImage* image );
966 extern "C" void cvSetImageCOI( IplImage* image, int coi );
969 extern "C" int cvGetImageCOI( const IplImage* image );
972 extern "C" void cvSetImageROI( IplImage* image, CvRect rect );
975 extern "C" void cvResetImageROI( IplImage* image );
978 extern "C" CvRect cvGetImageROI( const IplImage* image );
981 extern "C" CvMat* cvCreateMatHeader( int rows, int cols, int type );
986 extern "C" CvMat* cvInitMatHeader( CvMat* mat, int rows, int cols,
987 int type, void* data = NULL,
988 int step = 0x7fffffff );
991 extern "C" CvMat* cvCreateMat( int rows, int cols, int type );
995 extern "C" void cvReleaseMat( CvMat** mat );
999 inline void cvDecRefData( CvArr* arr )
1001 if( (((arr) != NULL && (((const CvMat*)(arr))->type & 0xFFFF0000) == 0x42420000 && ((const CvMat*)(arr))->cols > 0 && ((const CvMat*)(arr))->rows > 0) && ((const CvMat*)(arr))->data.ptr != NULL))
1003 CvMat* mat = (CvMat*)arr;
1004 mat->data.ptr = NULL;
1005 if( mat->refcount != NULL && --*mat->refcount == 0 )
1006 (cvFree_(*(&mat->refcount)), *(&mat->refcount)=0);
1007 mat->refcount = NULL;
1009 else if( (((arr) != NULL && (((const CvMatND*)(arr))->type & 0xFFFF0000) == 0x42430000) && ((const CvMatND*)(arr))->data.ptr != NULL))
1011 CvMatND* mat = (CvMatND*)arr;
1012 mat->data.ptr = NULL;
1013 if( mat->refcount != NULL && --*mat->refcount == 0 )
1014 (cvFree_(*(&mat->refcount)), *(&mat->refcount)=0);
1015 mat->refcount = NULL;
1020 inline int cvIncRefData( CvArr* arr )
1023 if( (((arr) != NULL && (((const CvMat*)(arr))->type & 0xFFFF0000) == 0x42420000 && ((const CvMat*)(arr))->cols > 0 && ((const CvMat*)(arr))->rows > 0) && ((const CvMat*)(arr))->data.ptr != NULL))
1025 CvMat* mat = (CvMat*)arr;
1026 if( mat->refcount != NULL )
1027 refcount = ++*mat->refcount;
1029 else if( (((arr) != NULL && (((const CvMatND*)(arr))->type & 0xFFFF0000) == 0x42430000) && ((const CvMatND*)(arr))->data.ptr != NULL))
1031 CvMatND* mat = (CvMatND*)arr;
1032 if( mat->refcount != NULL )
1033 refcount = ++*mat->refcount;
1040 extern "C" CvMat* cvCloneMat( const CvMat* mat );
1045 extern "C" CvMat* cvGetSubRect( const CvArr* arr, CvMat* submat, CvRect rect );
1050 extern "C" CvMat* cvGetRows( const CvArr* arr, CvMat* submat,
1051 int start_row, int end_row,
1054 inline CvMat* cvGetRow( const CvArr* arr, CvMat* submat, int row )
1056 return cvGetRows( arr, submat, row, row + 1, 1 );
1062 extern "C" CvMat* cvGetCols( const CvArr* arr, CvMat* submat,
1063 int start_col, int end_col );
1065 inline CvMat* cvGetCol( const CvArr* arr, CvMat* submat, int col )
1067 return cvGetCols( arr, submat, col, col + 1 );
1074 extern "C" CvMat* cvGetDiag( const CvArr* arr, CvMat* submat,
1078 extern "C" void cvScalarToRawData( const CvScalar* scalar, void* data, int type,
1079 int extend_to_12 = 0 );
1081 extern "C" void cvRawDataToScalar( const void* data, int type, CvScalar* scalar );
1084 extern "C" CvMatND* cvCreateMatNDHeader( int dims, const int* sizes, int type );
1087 extern "C" CvMatND* cvCreateMatND( int dims, const int* sizes, int type );
1090 extern "C" CvMatND* cvInitMatNDHeader( CvMatND* mat, int dims, const int* sizes,
1091 int type, void* data = NULL );
1094 inline void cvReleaseMatND( CvMatND** mat )
1096 cvReleaseMat( (CvMat**)mat );
1100 extern "C" CvMatND* cvCloneMatND( const CvMatND* mat );
1103 extern "C" CvSparseMat* cvCreateSparseMat( int dims, const int* sizes, int type );
1106 extern "C" void cvReleaseSparseMat( CvSparseMat** mat );
1109 extern "C" CvSparseMat* cvCloneSparseMat( const CvSparseMat* mat );
1113 extern "C" CvSparseNode* cvInitSparseMatIterator( const CvSparseMat* mat,
1114 CvSparseMatIterator* mat_iterator );
1117 inline CvSparseNode* cvGetNextSparseNode( CvSparseMatIterator* mat_iterator )
1119 if( mat_iterator->node->next )
1120 return mat_iterator->node = mat_iterator->node->next;
1124 for( idx = ++mat_iterator->curidx; idx < mat_iterator->mat->hashsize; idx++ )
1126 CvSparseNode* node = (CvSparseNode*)mat_iterator->mat->hashtable[idx];
1129 mat_iterator->curidx = idx;
1130 return mat_iterator->node = node;
1141 typedef struct CvNArrayIterator
1152 # 312 "../../../cxcore/include/cxcore.h"
1153 extern "C" int cvInitNArrayIterator( int count, CvArr** arrs,
1154 const CvArr* mask, CvMatND* stubs,
1155 CvNArrayIterator* array_iterator,
1159 extern "C" int cvNextNArraySlice( CvNArrayIterator* array_iterator );
1164 extern "C" int cvGetElemType( const CvArr* arr );
1168 extern "C" int cvGetDims( const CvArr* arr, int* sizes = NULL );
1174 extern "C" int cvGetDimSize( const CvArr* arr, int index );
1179 extern "C" uchar* cvPtr1D( const CvArr* arr, int idx0, int* type = NULL);
1180 extern "C" uchar* cvPtr2D( const CvArr* arr, int idx0, int idx1, int* type = NULL );
1181 extern "C" uchar* cvPtr3D( const CvArr* arr, int idx0, int idx1, int idx2,
1188 extern "C" uchar* cvPtrND( const CvArr* arr, const int* idx, int* type = NULL,
1189 int create_node = 1,
1190 unsigned* precalc_hashval = NULL);
1193 extern "C" CvScalar cvGet1D( const CvArr* arr, int idx0 );
1194 extern "C" CvScalar cvGet2D( const CvArr* arr, int idx0, int idx1 );
1195 extern "C" CvScalar cvGet3D( const CvArr* arr, int idx0, int idx1, int idx2 );
1196 extern "C" CvScalar cvGetND( const CvArr* arr, const int* idx );
1199 extern "C" double cvGetReal1D( const CvArr* arr, int idx0 );
1200 extern "C" double cvGetReal2D( const CvArr* arr, int idx0, int idx1 );
1201 extern "C" double cvGetReal3D( const CvArr* arr, int idx0, int idx1, int idx2 );
1202 extern "C" double cvGetRealND( const CvArr* arr, const int* idx );
1205 extern "C" void cvSet1D( CvArr* arr, int idx0, CvScalar value );
1206 extern "C" void cvSet2D( CvArr* arr, int idx0, int idx1, CvScalar value );
1207 extern "C" void cvSet3D( CvArr* arr, int idx0, int idx1, int idx2, CvScalar value );
1208 extern "C" void cvSetND( CvArr* arr, const int* idx, CvScalar value );
1211 extern "C" void cvSetReal1D( CvArr* arr, int idx0, double value );
1212 extern "C" void cvSetReal2D( CvArr* arr, int idx0, int idx1, double value );
1213 extern "C" void cvSetReal3D( CvArr* arr, int idx0,
1214 int idx1, int idx2, double value );
1215 extern "C" void cvSetRealND( CvArr* arr, const int* idx, double value );
1219 extern "C" void cvClearND( CvArr* arr, const int* idx );
1226 extern "C" CvMat* cvGetMat( const CvArr* arr, CvMat* header,
1231 extern "C" IplImage* cvGetImage( const CvArr* arr, IplImage* image_header );
1232 # 403 "../../../cxcore/include/cxcore.h"
1233 extern "C" CvArr* cvReshapeMatND( const CvArr* arr,
1234 int sizeof_header, CvArr* header,
1235 int new_cn, int new_dims, int* new_sizes );
1241 extern "C" CvMat* cvReshape( const CvArr* arr, CvMat* header,
1242 int new_cn, int new_rows = 0 );
1246 extern "C" void cvRepeat( const CvArr* src, CvArr* dst );
1249 extern "C" void cvCreateData( CvArr* arr );
1252 extern "C" void cvReleaseData( CvArr* arr );
1257 extern "C" void cvSetData( CvArr* arr, void* data, int step );
1262 extern "C" void cvGetRawData( const CvArr* arr, uchar** data,
1264 CvSize* roi_size = NULL);
1267 extern "C" CvSize cvGetSize( const CvArr* arr );
1270 extern "C" void cvCopy( const CvArr* src, CvArr* dst,
1271 const CvArr* mask = NULL );
1275 extern "C" void cvSet( CvArr* arr, CvScalar value,
1276 const CvArr* mask = NULL );
1279 extern "C" void cvSetZero( CvArr* arr );
1285 extern "C" void cvSplit( const CvArr* src, CvArr* dst0, CvArr* dst1,
1286 CvArr* dst2, CvArr* dst3 );
1290 extern "C" void cvMerge( const CvArr* src0, const CvArr* src1,
1291 const CvArr* src2, const CvArr* src3,
1296 extern "C" void cvMixChannels( const CvArr** src, int src_count,
1297 CvArr** dst, int dst_count,
1298 const int* from_to, int pair_count );
1305 extern "C" void cvConvertScale( const CvArr* src, CvArr* dst,
1308 # 488 "../../../cxcore/include/cxcore.h"
1309 extern "C" void cvConvertScaleAbs( const CvArr* src, CvArr* dst,
1319 extern "C" CvTermCriteria cvCheckTermCriteria( CvTermCriteria criteria,
1321 int default_max_iters );
1328 extern "C" void cvAdd( const CvArr* src1, const CvArr* src2, CvArr* dst,
1329 const CvArr* mask = NULL);
1332 extern "C" void cvAddS( const CvArr* src, CvScalar value, CvArr* dst,
1333 const CvArr* mask = NULL);
1336 extern "C" void cvSub( const CvArr* src1, const CvArr* src2, CvArr* dst,
1337 const CvArr* mask = NULL);
1340 inline void cvSubS( const CvArr* src, CvScalar value, CvArr* dst,
1341 const CvArr* mask = NULL)
1343 cvAddS( src, cvScalar( -value.val[0], -value.val[1], -value.val[2], -value.val[3]),
1348 extern "C" void cvSubRS( const CvArr* src, CvScalar value, CvArr* dst,
1349 const CvArr* mask = NULL);
1353 extern "C" void cvMul( const CvArr* src1, const CvArr* src2,
1354 CvArr* dst, double scale = 1 );
1359 extern "C" void cvDiv( const CvArr* src1, const CvArr* src2,
1360 CvArr* dst, double scale = 1);
1363 extern "C" void cvScaleAdd( const CvArr* src1, CvScalar scale,
1364 const CvArr* src2, CvArr* dst );
1368 extern "C" void cvAddWeighted( const CvArr* src1, double alpha,
1369 const CvArr* src2, double beta,
1370 double gamma, CvArr* dst );
1373 extern "C" double cvDotProduct( const CvArr* src1, const CvArr* src2 );
1376 extern "C" void cvAnd( const CvArr* src1, const CvArr* src2,
1377 CvArr* dst, const CvArr* mask = NULL);
1380 extern "C" void cvAndS( const CvArr* src, CvScalar value,
1381 CvArr* dst, const CvArr* mask = NULL);
1384 extern "C" void cvOr( const CvArr* src1, const CvArr* src2,
1385 CvArr* dst, const CvArr* mask = NULL);
1388 extern "C" void cvOrS( const CvArr* src, CvScalar value,
1389 CvArr* dst, const CvArr* mask = NULL);
1392 extern "C" void cvXor( const CvArr* src1, const CvArr* src2,
1393 CvArr* dst, const CvArr* mask = NULL);
1396 extern "C" void cvXorS( const CvArr* src, CvScalar value,
1397 CvArr* dst, const CvArr* mask = NULL);
1400 extern "C" void cvNot( const CvArr* src, CvArr* dst );
1403 extern "C" void cvInRange( const CvArr* src, const CvArr* lower,
1404 const CvArr* upper, CvArr* dst );
1407 extern "C" void cvInRangeS( const CvArr* src, CvScalar lower,
1408 CvScalar upper, CvArr* dst );
1409 # 600 "../../../cxcore/include/cxcore.h"
1410 extern "C" void cvCmp( const CvArr* src1, const CvArr* src2, CvArr* dst, int cmp_op );
1413 extern "C" void cvCmpS( const CvArr* src, double value, CvArr* dst, int cmp_op );
1416 extern "C" void cvMin( const CvArr* src1, const CvArr* src2, CvArr* dst );
1419 extern "C" void cvMax( const CvArr* src1, const CvArr* src2, CvArr* dst );
1422 extern "C" void cvMinS( const CvArr* src, double value, CvArr* dst );
1425 extern "C" void cvMaxS( const CvArr* src, double value, CvArr* dst );
1428 extern "C" void cvAbsDiff( const CvArr* src1, const CvArr* src2, CvArr* dst );
1431 extern "C" void cvAbsDiffS( const CvArr* src, CvArr* dst, CvScalar value );
1432 # 630 "../../../cxcore/include/cxcore.h"
1433 extern "C" void cvCartToPolar( const CvArr* x, const CvArr* y,
1434 CvArr* magnitude, CvArr* angle = NULL,
1435 int angle_in_degrees = 0);
1440 extern "C" void cvPolarToCart( const CvArr* magnitude, const CvArr* angle,
1442 int angle_in_degrees = 0);
1445 extern "C" void cvPow( const CvArr* src, CvArr* dst, double power );
1450 extern "C" void cvExp( const CvArr* src, CvArr* dst );
1456 extern "C" void cvLog( const CvArr* src, CvArr* dst );
1459 extern "C" float cvFastArctan( float y, float x );
1462 extern "C" float cvCbrt( float value );
1470 extern "C" int cvCheckArr( const CvArr* arr, int flags = 0,
1471 double min_val = 0, double max_val = 0);
1476 extern "C" void cvRandArr( CvRNG* rng, CvArr* arr, int dist_type,
1477 CvScalar param1, CvScalar param2 );
1479 extern "C" void cvRandShuffle( CvArr* mat, CvRNG* rng,
1480 double iter_factor = 1.);
1483 extern "C" int cvSolveCubic( const CvMat* coeffs, CvMat* roots );
1490 extern "C" void cvCrossProduct( const CvArr* src1, const CvArr* src2, CvArr* dst );
1491 # 698 "../../../cxcore/include/cxcore.h"
1492 extern "C" void cvGEMM( const CvArr* src1, const CvArr* src2, double alpha,
1493 const CvArr* src3, double beta, CvArr* dst,
1499 extern "C" void cvTransform( const CvArr* src, CvArr* dst,
1500 const CvMat* transmat,
1501 const CvMat* shiftvec = NULL);
1505 extern "C" void cvPerspectiveTransform( const CvArr* src, CvArr* dst,
1509 extern "C" void cvMulTransposed( const CvArr* src, CvArr* dst, int order,
1510 const CvArr* delta = NULL,
1511 double scale = 1. );
1514 extern "C" void cvTranspose( const CvArr* src, CvArr* dst );
1521 extern "C" void cvFlip( const CvArr* src, CvArr* dst = NULL,
1523 # 737 "../../../cxcore/include/cxcore.h"
1524 extern "C" void cvSVD( CvArr* A, CvArr* W, CvArr* U = NULL,
1525 CvArr* V = NULL, int flags = 0);
1529 extern "C" void cvSVBkSb( const CvArr* W, const CvArr* U,
1530 const CvArr* V, const CvArr* B,
1531 CvArr* X, int flags );
1537 extern "C" double cvInvert( const CvArr* src, CvArr* dst,
1543 extern "C" int cvSolve( const CvArr* src1, const CvArr* src2, CvArr* dst,
1547 extern "C" double cvDet( const CvArr* mat );
1550 extern "C" CvScalar cvTrace( const CvArr* mat );
1553 extern "C" void cvEigenVV( CvArr* mat, CvArr* evects,
1554 CvArr* evals, double eps = 0);
1557 extern "C" void cvSetIdentity( CvArr* mat, CvScalar value = cvRealScalar(1) );
1560 extern "C" CvArr* cvRange( CvArr* mat, double start, double end );
1561 # 795 "../../../cxcore/include/cxcore.h"
1562 extern "C" void cvCalcCovarMatrix( const CvArr** vects, int count,
1563 CvArr* cov_mat, CvArr* avg, int flags );
1568 extern "C" void cvCalcPCA( const CvArr* data, CvArr* mean,
1569 CvArr* eigenvals, CvArr* eigenvects, int flags );
1571 extern "C" void cvProjectPCA( const CvArr* data, const CvArr* mean,
1572 const CvArr* eigenvects, CvArr* result );
1574 extern "C" void cvBackProjectPCA( const CvArr* proj, const CvArr* mean,
1575 const CvArr* eigenvects, CvArr* result );
1578 extern "C" double cvMahalanobis( const CvArr* vec1, const CvArr* vec2, CvArr* mat );
1586 extern "C" CvScalar cvSum( const CvArr* arr );
1589 extern "C" int cvCountNonZero( const CvArr* arr );
1592 extern "C" CvScalar cvAvg( const CvArr* arr, const CvArr* mask = NULL );
1595 extern "C" void cvAvgSdv( const CvArr* arr, CvScalar* mean, CvScalar* std_dev,
1596 const CvArr* mask = NULL );
1599 extern "C" void cvMinMaxLoc( const CvArr* arr, double* min_val, double* max_val,
1600 CvPoint* min_loc = NULL,
1601 CvPoint* max_loc = NULL,
1602 const CvArr* mask = NULL );
1603 # 854 "../../../cxcore/include/cxcore.h"
1604 extern "C" double cvNorm( const CvArr* arr1, const CvArr* arr2 = NULL,
1606 const CvArr* mask = NULL );
1608 extern "C" void cvNormalize( const CvArr* src, CvArr* dst,
1609 double a = 1., double b = 0.,
1611 const CvArr* mask = NULL );
1619 extern "C" void cvReduce( const CvArr* src, CvArr* dst, int dim = -1,
1621 # 888 "../../../cxcore/include/cxcore.h"
1622 extern "C" void cvDFT( const CvArr* src, CvArr* dst, int flags,
1623 int nonzero_rows = 0 );
1627 extern "C" void cvMulSpectrums( const CvArr* src1, const CvArr* src2,
1628 CvArr* dst, int flags );
1631 extern "C" int cvGetOptimalDFTSize( int size0 );
1634 extern "C" void cvDCT( const CvArr* src, CvArr* dst, int flags );
1641 extern "C" int cvSliceLength( CvSlice slice, const CvSeq* seq );
1647 extern "C" CvMemStorage* cvCreateMemStorage( int block_size = 0);
1651 extern "C" CvMemStorage* cvCreateChildMemStorage( CvMemStorage* parent );
1656 extern "C" void cvReleaseMemStorage( CvMemStorage** storage );
1663 extern "C" void cvClearMemStorage( CvMemStorage* storage );
1666 extern "C" void cvSaveMemStoragePos( const CvMemStorage* storage, CvMemStoragePos* pos );
1669 extern "C" void cvRestoreMemStoragePos( CvMemStorage* storage, CvMemStoragePos* pos );
1672 extern "C" void* cvMemStorageAlloc( CvMemStorage* storage, size_t size );
1675 extern "C" CvString cvMemStorageAllocString( CvMemStorage* storage, const char* ptr,
1679 extern "C" CvSeq* cvCreateSeq( int seq_flags, int header_size,
1680 int elem_size, CvMemStorage* storage );
1684 extern "C" void cvSetSeqBlockSize( CvSeq* seq, int delta_elems );
1688 extern "C" char* cvSeqPush( CvSeq* seq, void* element = NULL);
1692 extern "C" char* cvSeqPushFront( CvSeq* seq, void* element = NULL);
1696 extern "C" void cvSeqPop( CvSeq* seq, void* element = NULL);
1700 extern "C" void cvSeqPopFront( CvSeq* seq, void* element = NULL);
1706 extern "C" void cvSeqPushMulti( CvSeq* seq, void* elements,
1707 int count, int in_front = 0 );
1710 extern "C" void cvSeqPopMulti( CvSeq* seq, void* elements,
1711 int count, int in_front = 0 );
1715 extern "C" char* cvSeqInsert( CvSeq* seq, int before_index,
1716 void* element = NULL);
1719 extern "C" void cvSeqRemove( CvSeq* seq, int index );
1725 extern "C" void cvClearSeq( CvSeq* seq );
1731 extern "C" char* cvGetSeqElem( const CvSeq* seq, int index );
1735 extern "C" int cvSeqElemIdx( const CvSeq* seq, const void* element,
1736 CvSeqBlock** block = NULL );
1739 extern "C" void cvStartAppendToSeq( CvSeq* seq, CvSeqWriter* writer );
1743 extern "C" void cvStartWriteSeq( int seq_flags, int header_size,
1744 int elem_size, CvMemStorage* storage,
1745 CvSeqWriter* writer );
1751 extern "C" CvSeq* cvEndWriteSeq( CvSeqWriter* writer );
1756 extern "C" void cvFlushSeqWriter( CvSeqWriter* writer );
1761 extern "C" void cvStartReadSeq( const CvSeq* seq, CvSeqReader* reader,
1766 extern "C" int cvGetSeqReaderPos( CvSeqReader* reader );
1771 extern "C" void cvSetSeqReaderPos( CvSeqReader* reader, int index,
1772 int is_relative = 0);
1775 extern "C" void* cvCvtSeqToArray( const CvSeq* seq, void* elements,
1776 CvSlice slice = cvSlice(0, 0x3fffffff) );
1781 extern "C" CvSeq* cvMakeSeqHeaderForArray( int seq_type, int header_size,
1782 int elem_size, void* elements, int total,
1783 CvSeq* seq, CvSeqBlock* block );
1786 extern "C" CvSeq* cvSeqSlice( const CvSeq* seq, CvSlice slice,
1787 CvMemStorage* storage = NULL,
1790 inline CvSeq* cvCloneSeq( const CvSeq* seq, CvMemStorage* storage = NULL)
1792 return cvSeqSlice( seq, cvSlice(0, 0x3fffffff), storage, 1 );
1796 extern "C" void cvSeqRemoveSlice( CvSeq* seq, CvSlice slice );
1799 extern "C" void cvSeqInsertSlice( CvSeq* seq, int before_index, const CvArr* from_arr );
1802 typedef int (* CvCmpFunc)(const void* a, const void* b, void* userdata );
1805 extern "C" void cvSeqSort( CvSeq* seq, CvCmpFunc func, void* userdata = NULL );
1808 extern "C" char* cvSeqSearch( CvSeq* seq, const void* elem, CvCmpFunc func,
1809 int is_sorted, int* elem_idx,
1810 void* userdata = NULL );
1813 extern "C" void cvSeqInvert( CvSeq* seq );
1816 extern "C" int cvSeqPartition( const CvSeq* seq, CvMemStorage* storage,
1817 CvSeq** labels, CvCmpFunc is_equal, void* userdata );
1820 extern "C" void cvChangeSeqBlock( void* reader, int direction );
1821 extern "C" void cvCreateSeqBlock( CvSeqWriter* writer );
1825 extern "C" CvSet* cvCreateSet( int set_flags, int header_size,
1826 int elem_size, CvMemStorage* storage );
1829 extern "C" int cvSetAdd( CvSet* set_header, CvSetElem* elem = NULL,
1830 CvSetElem** inserted_elem = NULL );
1833 inline CvSetElem* cvSetNew( CvSet* set_header )
1835 CvSetElem* elem = set_header->free_elems;
1838 set_header->free_elems = elem->next_free;
1839 elem->flags = elem->flags & ((1 << 26) - 1);
1840 set_header->active_count++;
1843 cvSetAdd( set_header, NULL, (CvSetElem**)&elem );
1848 inline void cvSetRemoveByPtr( CvSet* set_header, void* elem )
1850 CvSetElem* _elem = (CvSetElem*)elem;
1851 assert( _elem->flags >= 0 );
1852 _elem->next_free = set_header->free_elems;
1853 _elem->flags = (_elem->flags & ((1 << 26) - 1)) | (1 << (sizeof(int)*8-1));
1854 set_header->free_elems = _elem;
1855 set_header->active_count--;
1859 extern "C" void cvSetRemove( CvSet* set_header, int index );
1863 inline CvSetElem* cvGetSetElem( const CvSet* set_header, int index )
1865 CvSetElem* elem = (CvSetElem*)cvGetSeqElem( (CvSeq*)set_header, index );
1866 return elem && (((CvSetElem*)(elem))->flags >= 0) ? elem : 0;
1870 extern "C" void cvClearSet( CvSet* set_header );
1873 extern "C" CvGraph* cvCreateGraph( int graph_flags, int header_size,
1874 int vtx_size, int edge_size,
1875 CvMemStorage* storage );
1878 extern "C" int cvGraphAddVtx( CvGraph* graph, const CvGraphVtx* vtx = NULL,
1879 CvGraphVtx** inserted_vtx = NULL );
1883 extern "C" int cvGraphRemoveVtx( CvGraph* graph, int index );
1884 extern "C" int cvGraphRemoveVtxByPtr( CvGraph* graph, CvGraphVtx* vtx );
1891 extern "C" int cvGraphAddEdge( CvGraph* graph,
1892 int start_idx, int end_idx,
1893 const CvGraphEdge* edge = NULL,
1894 CvGraphEdge** inserted_edge = NULL );
1896 extern "C" int cvGraphAddEdgeByPtr( CvGraph* graph,
1897 CvGraphVtx* start_vtx, CvGraphVtx* end_vtx,
1898 const CvGraphEdge* edge = NULL,
1899 CvGraphEdge** inserted_edge = NULL );
1902 extern "C" void cvGraphRemoveEdge( CvGraph* graph, int start_idx, int end_idx );
1903 extern "C" void cvGraphRemoveEdgeByPtr( CvGraph* graph, CvGraphVtx* start_vtx,
1904 CvGraphVtx* end_vtx );
1907 extern "C" CvGraphEdge* cvFindGraphEdge( const CvGraph* graph, int start_idx, int end_idx );
1908 extern "C" CvGraphEdge* cvFindGraphEdgeByPtr( const CvGraph* graph,
1909 const CvGraphVtx* start_vtx,
1910 const CvGraphVtx* end_vtx );
1915 extern "C" void cvClearGraph( CvGraph* graph );
1919 extern "C" int cvGraphVtxDegree( const CvGraph* graph, int vtx_idx );
1920 extern "C" int cvGraphVtxDegreeByPtr( const CvGraph* graph, const CvGraphVtx* vtx );
1921 # 1222 "../../../cxcore/include/cxcore.h"
1922 typedef struct CvGraphScanner
1936 extern "C" CvGraphScanner* cvCreateGraphScanner( CvGraph* graph,
1937 CvGraphVtx* vtx = NULL,
1941 extern "C" void cvReleaseGraphScanner( CvGraphScanner** scanner );
1944 extern "C" int cvNextGraphItem( CvGraphScanner* scanner );
1947 extern "C" CvGraph* cvCloneGraph( const CvGraph* graph, CvMemStorage* storage );
1948 # 1269 "../../../cxcore/include/cxcore.h"
1949 extern "C" void cvLine( CvArr* img, CvPoint pt1, CvPoint pt2,
1950 CvScalar color, int thickness = 1,
1951 int line_type = 8, int shift = 0 );
1955 extern "C" void cvRectangle( CvArr* img, CvPoint pt1, CvPoint pt2,
1956 CvScalar color, int thickness = 1,
1962 extern "C" void cvCircle( CvArr* img, CvPoint center, int radius,
1963 CvScalar color, int thickness = 1,
1964 int line_type = 8, int shift = 0);
1969 extern "C" void cvEllipse( CvArr* img, CvPoint center, CvSize axes,
1970 double angle, double start_angle, double end_angle,
1971 CvScalar color, int thickness = 1,
1972 int line_type = 8, int shift = 0);
1974 inline void cvEllipseBox( CvArr* img, CvBox2D box, CvScalar color,
1976 int line_type = 8, int shift = 0 )
1979 axes.width = cvRound(box.size.height*0.5);
1980 axes.height = cvRound(box.size.width*0.5);
1982 cvEllipse( img, cvPointFrom32f( box.center ), axes, box.angle,
1983 0, 360, color, thickness, line_type, shift );
1987 extern "C" void cvFillConvexPoly( CvArr* img, CvPoint* pts, int npts, CvScalar color,
1988 int line_type = 8, int shift = 0);
1991 extern "C" void cvFillPoly( CvArr* img, CvPoint** pts, int* npts, int contours, CvScalar color,
1992 int line_type = 8, int shift = 0 );
1995 extern "C" void cvPolyLine( CvArr* img, CvPoint** pts, int* npts, int contours,
1996 int is_closed, CvScalar color, int thickness = 1,
1997 int line_type = 8, int shift = 0 );
1998 # 1328 "../../../cxcore/include/cxcore.h"
1999 extern "C" int cvClipLine( CvSize img_size, CvPoint* pt1, CvPoint* pt2 );
2004 extern "C" int cvInitLineIterator( const CvArr* image, CvPoint pt1, CvPoint pt2,
2005 CvLineIterator* line_iterator,
2006 int connectivity = 8,
2007 int left_to_right = 0);
2008 # 1365 "../../../cxcore/include/cxcore.h"
2009 typedef struct CvFont
2014 const int* cyrillic;
2015 float hscale, vscale;
2024 extern "C" void cvInitFont( CvFont* font, int font_face,
2025 double hscale, double vscale,
2030 inline CvFont cvFont( double scale, int thickness = 1 )
2033 cvInitFont( &font, 1, scale, scale, 0, thickness, 16 );
2039 extern "C" void cvPutText( CvArr* img, const char* text, CvPoint org,
2040 const CvFont* font, CvScalar color );
2043 extern "C" void cvGetTextSize( const char* text_string, const CvFont* font,
2044 CvSize* text_size, int* baseline );
2049 extern "C" CvScalar cvColorToScalar( double packed_color, int arrtype );
2057 extern "C" int cvEllipse2Poly( CvPoint center, CvSize axes,
2058 int angle, int arc_start, int arc_end, CvPoint * pts, int delta );
2061 extern "C" void cvDrawContours( CvArr *img, CvSeq* contour,
2062 CvScalar external_color, CvScalar hole_color,
2063 int max_level, int thickness = 1,
2065 CvPoint offset = cvPoint(0,0));
2069 extern "C" void cvLUT( const CvArr* src, CvArr* dst, const CvArr* lut );
2073 typedef struct CvTreeNodeIterator
2081 extern "C" void cvInitTreeNodeIterator( CvTreeNodeIterator* tree_iterator,
2082 const void* first, int max_level );
2083 extern "C" void* cvNextTreeNode( CvTreeNodeIterator* tree_iterator );
2084 extern "C" void* cvPrevTreeNode( CvTreeNodeIterator* tree_iterator );
2089 extern "C" void cvInsertNodeIntoTree( void* node, void* parent, void* frame );
2092 extern "C" void cvRemoveNodeFromTree( void* node, void* frame );
2096 extern "C" CvSeq* cvTreeToNodeSeq( const void* first, int header_size,
2097 CvMemStorage* storage );
2101 extern "C" void cvKMeans2( const CvArr* samples, int cluster_count,
2102 CvArr* labels, CvTermCriteria termcrit );
2109 extern "C" int cvRegisterModule( const CvModuleInfo* module_info );
2112 extern "C" int cvUseOptimized( int on_off );
2115 extern "C" void cvGetModuleInfo( const char* module_name,
2116 const char** version,
2117 const char** loaded_addon_plugins );
2120 extern "C" int cvGetErrStatus( void );
2123 extern "C" void cvSetErrStatus( int status );
2130 extern "C" int cvGetErrMode( void );
2133 extern "C" int cvSetErrMode( int mode );
2138 extern "C" void cvError( int status, const char* func_name,
2139 const char* err_msg, const char* file_name, int line );
2142 extern "C" const char* cvErrorStr( int status );
2145 extern "C" int cvGetErrInfo( const char** errcode_desc, const char** description,
2146 const char** filename, int* line );
2149 extern "C" int cvErrorFromIppStatus( int ipp_status );
2151 typedef int ( *CvErrorCallback)( int status, const char* func_name,
2152 const char* err_msg, const char* file_name, int line, void* userdata );
2155 extern "C" CvErrorCallback cvRedirectError( CvErrorCallback error_handler,
2156 void* userdata = NULL,
2157 void** prev_userdata = NULL );
2165 extern "C" int cvNulDevReport( int status, const char* func_name, const char* err_msg,
2166 const char* file_name, int line, void* userdata );
2168 extern "C" int cvStdErrReport( int status, const char* func_name, const char* err_msg,
2169 const char* file_name, int line, void* userdata );
2171 extern "C" int cvGuiBoxReport( int status, const char* func_name, const char* err_msg,
2172 const char* file_name, int line, void* userdata );
2174 typedef void* ( *CvAllocFunc)(size_t size, void* userdata);
2175 typedef int ( *CvFreeFunc)(void* pptr, void* userdata);
2179 extern "C" void cvSetMemoryManager( CvAllocFunc alloc_func = NULL,
2180 CvFreeFunc free_func = NULL,
2181 void* userdata = NULL);
2184 typedef IplImage* (* Cv_iplCreateImageHeader)
2185 (int,int,int,char*,char*,int,int,int,int,int,
2186 IplROI*,IplImage*,void*,IplTileInfo*);
2187 typedef void (* Cv_iplAllocateImageData)(IplImage*,int,int);
2188 typedef void (* Cv_iplDeallocate)(IplImage*,int);
2189 typedef IplROI* (* Cv_iplCreateROI)(int,int,int,int,int);
2190 typedef IplImage* (* Cv_iplCloneImage)(const IplImage*);
2193 extern "C" void cvSetIPLAllocators( Cv_iplCreateImageHeader create_header,
2194 Cv_iplAllocateImageData allocate_data,
2195 Cv_iplDeallocate deallocate,
2196 Cv_iplCreateROI create_roi,
2197 Cv_iplCloneImage clone_image );
2198 # 1566 "../../../cxcore/include/cxcore.h"
2199 extern "C" CvFileStorage* cvOpenFileStorage( const char* filename,
2200 CvMemStorage* memstorage,
2204 extern "C" void cvReleaseFileStorage( CvFileStorage** fs );
2207 extern "C" const char* cvAttrValue( const CvAttrList* attr, const char* attr_name );
2210 extern "C" void cvStartWriteStruct( CvFileStorage* fs, const char* name,
2211 int struct_flags, const char* type_name = NULL,
2212 CvAttrList attributes = cvAttrList());
2215 extern "C" void cvEndWriteStruct( CvFileStorage* fs );
2218 extern "C" void cvWriteInt( CvFileStorage* fs, const char* name, int value );
2221 extern "C" void cvWriteReal( CvFileStorage* fs, const char* name, double value );
2224 extern "C" void cvWriteString( CvFileStorage* fs, const char* name,
2225 const char* str, int quote = 0 );
2228 extern "C" void cvWriteComment( CvFileStorage* fs, const char* comment,
2233 extern "C" void cvWrite( CvFileStorage* fs, const char* name, const void* ptr,
2234 CvAttrList attributes = cvAttrList());
2237 extern "C" void cvStartNextStream( CvFileStorage* fs );
2240 extern "C" void cvWriteRawData( CvFileStorage* fs, const void* src,
2241 int len, const char* dt );
2245 extern "C" CvStringHashNode* cvGetHashedKey( CvFileStorage* fs, const char* name,
2247 int create_missing = 0);
2251 extern "C" CvFileNode* cvGetRootFileNode( const CvFileStorage* fs,
2252 int stream_index = 0 );
2256 extern "C" CvFileNode* cvGetFileNode( CvFileStorage* fs, CvFileNode* map,
2257 const CvStringHashNode* key,
2258 int create_missing = 0 );
2261 extern "C" CvFileNode* cvGetFileNodeByName( const CvFileStorage* fs,
2262 const CvFileNode* map,
2265 inline int cvReadInt( const CvFileNode* node, int default_value = 0 )
2267 return !node ? default_value :
2268 (((node->tag) & 7) == 1) ? node->data.i :
2269 (((node->tag) & 7) == 2) ? cvRound(node->data.f) : 0x7fffffff;
2273 inline int cvReadIntByName( const CvFileStorage* fs, const CvFileNode* map,
2274 const char* name, int default_value = 0 )
2276 return cvReadInt( cvGetFileNodeByName( fs, map, name ), default_value );
2280 inline double cvReadReal( const CvFileNode* node, double default_value = 0. )
2282 return !node ? default_value :
2283 (((node->tag) & 7) == 1) ? (double)node->data.i :
2284 (((node->tag) & 7) == 2) ? node->data.f : 1e300;
2288 inline double cvReadRealByName( const CvFileStorage* fs, const CvFileNode* map,
2289 const char* name, double default_value = 0. )
2291 return cvReadReal( cvGetFileNodeByName( fs, map, name ), default_value );
2295 inline const char* cvReadString( const CvFileNode* node,
2296 const char* default_value = NULL )
2298 return !node ? default_value : (((node->tag) & 7) == 3) ? node->data.str.ptr : 0;
2302 inline const char* cvReadStringByName( const CvFileStorage* fs, const CvFileNode* map,
2303 const char* name, const char* default_value = NULL )
2305 return cvReadString( cvGetFileNodeByName( fs, map, name ), default_value );
2310 extern "C" void* cvRead( CvFileStorage* fs, CvFileNode* node,
2311 CvAttrList* attributes = NULL);
2314 inline void* cvReadByName( CvFileStorage* fs, const CvFileNode* map,
2315 const char* name, CvAttrList* attributes = NULL )
2317 return cvRead( fs, cvGetFileNodeByName( fs, map, name ), attributes );
2322 extern "C" void cvStartReadRawData( const CvFileStorage* fs, const CvFileNode* src,
2323 CvSeqReader* reader );
2326 extern "C" void cvReadRawDataSlice( const CvFileStorage* fs, CvSeqReader* reader,
2327 int count, void* dst, const char* dt );
2330 extern "C" void cvReadRawData( const CvFileStorage* fs, const CvFileNode* src,
2331 void* dst, const char* dt );
2334 extern "C" void cvWriteFileNode( CvFileStorage* fs, const char* new_node_name,
2335 const CvFileNode* node, int embed );
2338 extern "C" const char* cvGetFileNodeName( const CvFileNode* node );
2342 extern "C" void cvRegisterType( const CvTypeInfo* info );
2343 extern "C" void cvUnregisterType( const char* type_name );
2344 extern "C" CvTypeInfo* cvFirstType(void);
2345 extern "C" CvTypeInfo* cvFindType( const char* type_name );
2346 extern "C" CvTypeInfo* cvTypeOf( const void* struct_ptr );
2349 extern "C" void cvRelease( void** struct_ptr );
2350 extern "C" void* cvClone( const void* struct_ptr );
2353 extern "C" void cvSave( const char* filename, const void* struct_ptr,
2354 const char* name = NULL,
2355 const char* comment = NULL,
2356 CvAttrList attributes = cvAttrList());
2357 extern "C" void* cvLoad( const char* filename,
2358 CvMemStorage* memstorage = NULL,
2359 const char* name = NULL,
2360 const char** real_name = NULL );
2366 extern "C" int64 cvGetTickCount( void );
2367 extern "C" double cvGetTickFrequency( void );
2372 extern "C" int cvGetNumThreads( void );
2373 extern "C" void cvSetNumThreads( int threads = 0 );
2375 extern "C" int cvGetThreadNum( void );
2380 # 1 "../../../cxcore/include/cxcore.hpp" 1
2381 # 46 "../../../cxcore/include/cxcore.hpp"
2385 CvImage() : image(0), refcount(0) {}
2386 CvImage( CvSize size, int depth, int channels )
2388 image = cvCreateImage( size, depth, channels );
2389 refcount = image ? new int(1) : 0;
2392 CvImage( IplImage* img ) : image(img)
2394 refcount = image ? new int(1) : 0;
2397 CvImage( const CvImage& img ) : image(img.image), refcount(img.refcount)
2399 if( refcount ) ++(*refcount);
2402 CvImage( const char* filename, const char* imgname=0, int color=-1 ) : image(0), refcount(0)
2403 { load( filename, imgname, color ); }
2405 CvImage( CvFileStorage* fs, const char* mapname, const char* imgname ) : image(0), refcount(0)
2406 { read( fs, mapname, imgname ); }
2408 CvImage( CvFileStorage* fs, const char* seqname, int idx ) : image(0), refcount(0)
2409 { read( fs, seqname, idx ); }
2413 if( refcount && !(--*refcount) )
2415 cvReleaseImage( &image );
2420 CvImage clone() { return CvImage(image ? cvCloneImage(image) : 0); }
2422 void create( CvSize size, int depth, int channels )
2424 attach( cvCreateImage( size, depth, channels ));
2427 void release() { detach(); }
2428 void clear() { detach(); }
2430 void attach( IplImage* img, bool use_refcount=true )
2434 if( --*refcount == 0 )
2435 cvReleaseImage( &image );
2439 refcount = use_refcount && image ? new int(1) : 0;
2446 if( --*refcount == 0 )
2447 cvReleaseImage( &image );
2454 bool load( const char* filename, const char* imgname=0, int color=-1 );
2455 bool read( CvFileStorage* fs, const char* mapname, const char* imgname );
2456 bool read( CvFileStorage* fs, const char* seqname, int idx );
2457 void save( const char* filename, const char* imgname );
2458 void write( CvFileStorage* fs, const char* imgname );
2460 void show( const char* window_name );
2461 bool is_valid() { return image != 0; }
2463 int width() const { return image ? image->width : 0; }
2464 int height() const { return image ? image->height : 0; }
2466 CvSize size() const { return image ? cvSize(image->width, image->height) : cvSize(0,0); }
2468 CvSize roi_size() const
2470 return !image ? cvSize(0,0) :
2471 !image->roi ? cvSize(image->width,image->height) :
2472 cvSize(image->roi->width, image->roi->height);
2477 return !image ? cvRect(0,0,0,0) :
2478 !image->roi ? cvRect(0,0,image->width,image->height) :
2479 cvRect(image->roi->xOffset,image->roi->yOffset,
2480 image->roi->width,image->roi->height);
2483 int coi() const { return !image || !image->roi ? 0 : image->roi->coi; }
2485 void set_roi(CvRect roi) { cvSetImageROI(image,roi); }
2486 void reset_roi() { cvResetImageROI(image); }
2487 void set_coi(int coi) { cvSetImageCOI(image,coi); }
2488 int depth() const { return image ? image->depth : 0; }
2489 int channels() const { return image ? image->nChannels : 0; }
2490 int pix_size() const { return image ? ((image->depth & 255)>>3)*image->nChannels : 0; }
2492 uchar* data() { return image ? (uchar*)image->imageData : 0; }
2493 const uchar* data() const { return image ? (const uchar*)image->imageData : 0; }
2494 int step() const { return image ? image->widthStep : 0; }
2495 int origin() const { return image ? image->origin : 0; }
2497 uchar* roi_row(int y)
2502 y<image->roi->height : y<image->height);
2506 (uchar*)(image->imageData + y*image->widthStep) :
2507 (uchar*)(image->imageData + (y+image->roi->yOffset)*image->widthStep +
2508 image->roi->xOffset*((image->depth & 255)>>3)*image->nChannels);
2511 const uchar* roi_row(int y) const
2516 y<image->roi->height : y<image->height);
2520 (const uchar*)(image->imageData + y*image->widthStep) :
2521 (const uchar*)(image->imageData + (y+image->roi->yOffset)*image->widthStep +
2522 image->roi->xOffset*((image->depth & 255)>>3)*image->nChannels);
2525 operator const IplImage* () const { return image; }
2526 operator IplImage* () { return image; }
2528 CvImage& operator = (const CvImage& img)
2532 if( refcount && !(--*refcount) )
2533 cvReleaseImage( &image );
2535 refcount=img.refcount;
2548 CvMatrix() : matrix(0) {}
2549 CvMatrix( int rows, int cols, int type )
2550 { matrix = cvCreateMat( rows, cols, type ); }
2552 CvMatrix( int rows, int cols, int type, CvMat* hdr,
2553 void* data=0, int step=0x7fffffff )
2554 { matrix = cvInitMatHeader( hdr, rows, cols, type, data, step ); }
2556 CvMatrix( int rows, int cols, int type, CvMemStorage* storage, bool alloc_data=true );
2558 CvMatrix( int rows, int cols, int type, void* data, int step=0x7fffffff )
2559 { matrix = cvCreateMatHeader( rows, cols, type );
2560 cvSetData( matrix, data, step ); }
2562 CvMatrix( CvMat* m )
2565 CvMatrix( const CvMatrix& m )
2571 CvMatrix( const char* filename, const char* matname=0, int color=-1 ) : matrix(0)
2572 { load( filename, matname, color ); }
2574 CvMatrix( CvFileStorage* fs, const char* mapname, const char* matname ) : matrix(0)
2575 { read( fs, mapname, matname ); }
2577 CvMatrix( CvFileStorage* fs, const char* seqname, int idx ) : matrix(0)
2578 { read( fs, seqname, idx ); }
2585 CvMatrix clone() { return CvMatrix(matrix ? cvCloneMat(matrix) : 0); }
2587 void set( CvMat* m, bool add_ref )
2595 void create( int rows, int cols, int type )
2597 set( cvCreateMat( rows, cols, type ), false );
2604 if( matrix->hdr_refcount )
2605 ++matrix->hdr_refcount;
2606 else if( matrix->refcount )
2607 ++*matrix->refcount;
2615 if( matrix->hdr_refcount )
2617 if( --matrix->hdr_refcount == 0 )
2618 cvReleaseMat( &matrix );
2620 else if( matrix->refcount )
2622 if( --*matrix->refcount == 0 )
2623 (cvFree_(*(&matrix->refcount)), *(&matrix->refcount)=0);
2634 bool load( const char* filename, const char* matname=0, int color=-1 );
2635 bool read( CvFileStorage* fs, const char* mapname, const char* matname );
2636 bool read( CvFileStorage* fs, const char* seqname, int idx );
2637 void save( const char* filename, const char* matname );
2638 void write( CvFileStorage* fs, const char* matname );
2640 void show( const char* window_name );
2642 bool is_valid() { return matrix != 0; }
2644 int rows() const { return matrix ? matrix->rows : 0; }
2645 int cols() const { return matrix ? matrix->cols : 0; }
2649 return !matrix ? cvSize(0,0) : cvSize(matrix->rows,matrix->cols);
2652 int type() const { return matrix ? ((matrix->type) & ((1 << 3)*64 - 1)) : 0; }
2653 int depth() const { return matrix ? ((matrix->type) & ((1 << 3) - 1)) : 0; }
2654 int channels() const { return matrix ? ((((matrix->type) & ((64 - 1) << 3)) >> 3) + 1) : 0; }
2655 int pix_size() const { return matrix ? (((((matrix->type) & ((64 - 1) << 3)) >> 3) + 1) << ((((sizeof(size_t)/4+1)*16384|0x3a50) >> ((matrix->type) & ((1 << 3) - 1))*2) & 3)) : 0; }
2657 uchar* data() { return matrix ? matrix->data.ptr : 0; }
2658 const uchar* data() const { return matrix ? matrix->data.ptr : 0; }
2659 int step() const { return matrix ? matrix->step : 0; }
2661 void set_data( void* data, int step=0x7fffffff )
2662 { cvSetData( matrix, data, step ); }
2664 uchar* row(int i) { return !matrix ? 0 : matrix->data.ptr + i*matrix->step; }
2665 const uchar* row(int i) const
2666 { return !matrix ? 0 : matrix->data.ptr + i*matrix->step; }
2668 operator const CvMat* () const { return matrix; }
2669 operator CvMat* () { return matrix; }
2671 CvMatrix& operator = (const CvMatrix& _m)
2684 typedef IplImage* ( * CvLoadImageFunc)( const char* filename, int colorness );
2685 typedef CvMat* ( * CvLoadImageMFunc)( const char* filename, int colorness );
2686 typedef int ( * CvSaveImageFunc)( const char* filename, const CvArr* image );
2687 typedef void ( * CvShowImageFunc)( const char* windowname, const CvArr* image );
2689 extern "C" int cvSetImageIOFunctions( CvLoadImageFunc _load_image, CvLoadImageMFunc _load_image_m,
2690 CvSaveImageFunc _save_image, CvShowImageFunc _show_image );
2698 CvModule( CvModuleInfo* _info );
2702 static CvModuleInfo* first;
2703 static CvModuleInfo* last;
2708 CvType( const char* type_name,
2709 CvIsInstanceFunc is_instance, CvReleaseFunc release=0,
2710 CvReadFunc read=0, CvWriteFunc write=0, CvCloneFunc clone=0 );
2714 static CvTypeInfo* first;
2715 static CvTypeInfo* last;
2717 # 1748 "../../../cxcore/include/cxcore.h" 2
2718 # 59 "../../../cv/include/cv.h" 2
2719 # 1 "../../../cv/include/cvtypes.h" 1
2720 # 51 "../../../cv/include/cvtypes.h"
2721 typedef struct CvMoments
2723 double m00, m10, m01, m20, m11, m02, m30, m21, m12, m03;
2724 double mu20, mu11, mu02, mu30, mu21, mu12, mu03;
2725 double inv_sqrt_m00;
2730 typedef struct CvHuMoments
2732 double hu1, hu2, hu3, hu4, hu5, hu6, hu7;
2738 typedef struct CvConnectedComp
2752 typedef struct _CvContourScanner* CvContourScanner;
2753 # 99 "../../../cv/include/cvtypes.h"
2754 typedef struct CvChainPtReader
2756 int header_size; CvSeq* seq; CvSeqBlock* block; char* ptr; char* block_min; char* block_max; int delta_index; char* prev_elem;
2762 # 116 "../../../cv/include/cvtypes.h"
2763 typedef struct CvContourTree
2765 int flags; int header_size; struct CvSeq* h_prev; struct CvSeq* h_next; struct CvSeq* v_prev; struct CvSeq* v_next; int total; int elem_size; char* block_max; char* ptr; int delta_elems; CvMemStorage* storage; CvSeqBlock* free_blocks; CvSeqBlock* first;
2772 typedef struct CvConvexityDefect
2776 CvPoint* depth_point;
2783 typedef size_t CvSubdiv2DEdge;
2784 # 150 "../../../cv/include/cvtypes.h"
2785 typedef struct CvQuadEdge2D
2787 int flags; struct CvSubdiv2DPoint* pt[4]; CvSubdiv2DEdge next[4];
2791 typedef struct CvSubdiv2DPoint
2793 int flags; CvSubdiv2DEdge first; CvPoint2D32f pt;
2796 # 170 "../../../cv/include/cvtypes.h"
2797 typedef struct CvSubdiv2D
2799 int flags; int header_size; struct CvSeq* h_prev; struct CvSeq* h_next; struct CvSeq* v_prev; struct CvSeq* v_next; int total; int elem_size; char* block_max; char* ptr; int delta_elems; CvMemStorage* storage; CvSeqBlock* free_blocks; CvSeqBlock* first; CvSetElem* free_elems; int active_count; CvSet* edges; int quad_edges; int is_geometry_valid; CvSubdiv2DEdge recent_edge; CvPoint2D32f topleft; CvPoint2D32f bottomright;
2804 typedef enum CvSubdiv2DPointLocation
2806 CV_PTLOC_ERROR = -2,
2807 CV_PTLOC_OUTSIDE_RECT = -1,
2808 CV_PTLOC_INSIDE = 0,
2809 CV_PTLOC_VERTEX = 1,
2810 CV_PTLOC_ON_EDGE = 2
2812 CvSubdiv2DPointLocation;
2814 typedef enum CvNextEdgeType
2816 CV_NEXT_AROUND_ORG = 0x00,
2817 CV_NEXT_AROUND_DST = 0x22,
2818 CV_PREV_AROUND_ORG = 0x11,
2819 CV_PREV_AROUND_DST = 0x33,
2820 CV_NEXT_AROUND_LEFT = 0x13,
2821 CV_NEXT_AROUND_RIGHT = 0x31,
2822 CV_PREV_AROUND_LEFT = 0x20,
2823 CV_PREV_AROUND_RIGHT = 0x02
2826 # 216 "../../../cv/include/cvtypes.h"
2827 typedef enum CvFilter
2837 typedef float* CvVect32f;
2838 typedef float* CvMatr32f;
2839 typedef double* CvVect64d;
2840 typedef double* CvMatr64d;
2842 typedef struct CvMatrix3
2853 typedef float ( * CvDistanceFunction)( const float* a, const float* b, void* user_param );
2859 typedef struct CvConDensation
2867 float** flNewSamples;
2868 float* flConfidence;
2869 float* flCumulative;
2871 float* RandomSample;
2872 struct CvRandState* RandS;
2882 typedef struct CvKalman
2893 float* MeasurementMatr;
2894 float* MNCovariance;
2895 float* PNCovariance;
2896 float* KalmGainMatr;
2897 float* PriorErrorCovariance;
2898 float* PosterErrorCovariance;
2907 CvMat* transition_matrix;
2908 CvMat* control_matrix;
2910 CvMat* measurement_matrix;
2911 CvMat* process_noise_cov;
2912 CvMat* measurement_noise_cov;
2913 CvMat* error_cov_pre;
2917 CvMat* error_cov_post;
2926 # 327 "../../../cv/include/cvtypes.h"
2927 typedef struct CvHaarFeature
2938 typedef struct CvHaarClassifier
2941 CvHaarFeature* haar_feature;
2949 typedef struct CvHaarStageClassifier
2953 CvHaarClassifier* classifier;
2959 CvHaarStageClassifier;
2961 typedef struct CvHidHaarClassifierCascade CvHidHaarClassifierCascade;
2963 typedef struct CvHaarClassifierCascade
2967 CvSize orig_window_size;
2968 CvSize real_window_size;
2970 CvHaarStageClassifier* stage_classifier;
2971 CvHidHaarClassifierCascade* hid_cascade;
2973 CvHaarClassifierCascade;
2975 typedef struct CvAvgComp
2981 # 60 "../../../cv/include/cv.h" 2
2985 # 71 "../../../cv/include/cv.h"
2986 extern "C" void cvCopyMakeBorder( const CvArr* src, CvArr* dst, CvPoint offset,
2987 int bordertype, CvScalar value = cvScalarAll(0));
2988 # 81 "../../../cv/include/cv.h"
2989 extern "C" void cvSmooth( const CvArr* src, CvArr* dst,
2997 extern "C" void cvFilter2D( const CvArr* src, CvArr* dst, const CvMat* kernel,
2998 CvPoint anchor = cvPoint(-1,-1));
3001 extern "C" void cvIntegral( const CvArr* image, CvArr* sum,
3002 CvArr* sqsum = NULL,
3003 CvArr* tilted_sum = NULL);
3010 extern "C" void cvPyrDown( const CvArr* src, CvArr* dst,
3011 int filter = CV_GAUSSIAN_5x5 );
3018 extern "C" void cvPyrUp( const CvArr* src, CvArr* dst,
3019 int filter = CV_GAUSSIAN_5x5 );
3022 extern "C" CvMat** cvCreatePyramid( const CvArr* img, int extra_layers, double rate,
3023 const CvSize* layer_sizes = 0,
3026 int filter = CV_GAUSSIAN_5x5 );
3029 extern "C" void cvReleasePyramid( CvMat*** pyramid, int extra_layers );
3036 extern "C" void cvPyrSegmentation( IplImage* src, IplImage* dst,
3037 CvMemStorage* storage, CvSeq** comp,
3038 int level, double threshold1,
3039 double threshold2 );
3042 extern "C" void cvPyrMeanShiftFiltering( const CvArr* src, CvArr* dst,
3043 double sp, double sr, int max_level = 1,
3044 CvTermCriteria termcrit = cvTermCriteria(1 +2,5,1));
3047 extern "C" void cvWatershed( const CvArr* image, CvArr* markers );
3053 extern "C" void cvInpaint( const CvArr* src, const CvArr* inpaint_mask,
3054 CvArr* dst, double inpaintRange, int flags );
3062 extern "C" void cvSobel( const CvArr* src, CvArr* dst,
3063 int xorder, int yorder,
3064 int aperture_size = 3);
3067 extern "C" void cvLaplace( const CvArr* src, CvArr* dst,
3068 int aperture_size = 3 );
3069 # 258 "../../../cv/include/cv.h"
3070 extern "C" void cvCvtColor( const CvArr* src, CvArr* dst, int code );
3071 # 269 "../../../cv/include/cv.h"
3072 extern "C" void cvResize( const CvArr* src, CvArr* dst,
3073 int interpolation = 1);
3076 extern "C" void cvWarpAffine( const CvArr* src, CvArr* dst, const CvMat* map_matrix,
3078 CvScalar fillval = cvScalarAll(0) );
3081 extern "C" CvMat* cvGetAffineTransform( const CvPoint2D32f * src,
3082 const CvPoint2D32f * dst,
3083 CvMat * map_matrix );
3086 extern "C" CvMat* cv2DRotationMatrix( CvPoint2D32f center, double angle,
3087 double scale, CvMat* map_matrix );
3090 extern "C" void cvWarpPerspective( const CvArr* src, CvArr* dst, const CvMat* map_matrix,
3092 CvScalar fillval = cvScalarAll(0) );
3095 extern "C" CvMat* cvGetPerspectiveTransform( const CvPoint2D32f* src,
3096 const CvPoint2D32f* dst,
3097 CvMat* map_matrix );
3100 extern "C" void cvRemap( const CvArr* src, CvArr* dst,
3101 const CvArr* mapx, const CvArr* mapy,
3103 CvScalar fillval = cvScalarAll(0) );
3106 extern "C" void cvLogPolar( const CvArr* src, CvArr* dst,
3107 CvPoint2D32f center, double M,
3116 extern "C" IplConvKernel* cvCreateStructuringElementEx(
3117 int cols, int rows, int anchor_x, int anchor_y,
3118 int shape, int* values = NULL );
3121 extern "C" void cvReleaseStructuringElement( IplConvKernel** element );
3125 extern "C" void cvErode( const CvArr* src, CvArr* dst,
3126 IplConvKernel* element = NULL,
3127 int iterations = 1 );
3131 extern "C" void cvDilate( const CvArr* src, CvArr* dst,
3132 IplConvKernel* element = NULL,
3133 int iterations = 1 );
3134 # 339 "../../../cv/include/cv.h"
3135 extern "C" void cvMorphologyEx( const CvArr* src, CvArr* dst,
3136 CvArr* temp, IplConvKernel* element,
3137 int operation, int iterations = 1 );
3140 extern "C" void cvMoments( const CvArr* arr, CvMoments* moments, int binary = 0);
3143 extern "C" double cvGetSpatialMoment( CvMoments* moments, int x_order, int y_order );
3144 extern "C" double cvGetCentralMoment( CvMoments* moments, int x_order, int y_order );
3145 extern "C" double cvGetNormalizedCentralMoment( CvMoments* moments,
3146 int x_order, int y_order );
3149 extern "C" void cvGetHuMoments( CvMoments* moments, CvHuMoments* hu_moments );
3155 extern "C" int cvSampleLine( const CvArr* image, CvPoint pt1, CvPoint pt2, void* buffer,
3156 int connectivity = 8);
3161 extern "C" void cvGetRectSubPix( const CvArr* src, CvArr* dst, CvPoint2D32f center );
3169 extern "C" void cvGetQuadrangleSubPix( const CvArr* src, CvArr* dst,
3170 const CvMat* map_matrix );
3171 # 386 "../../../cv/include/cv.h"
3172 extern "C" void cvMatchTemplate( const CvArr* image, const CvArr* templ,
3173 CvArr* result, int method );
3177 extern "C" float cvCalcEMD2( const CvArr* signature1,
3178 const CvArr* signature2,
3180 CvDistanceFunction distance_func = NULL,
3181 const CvArr* cost_matrix = NULL,
3183 float* lower_bound = NULL,
3184 void* userdata = NULL);
3192 extern "C" int cvFindContours( CvArr* image, CvMemStorage* storage, CvSeq** first_contour,
3193 int header_size = sizeof(CvContour),
3196 CvPoint offset = cvPoint(0,0));
3204 extern "C" CvContourScanner cvStartFindContours( CvArr* image, CvMemStorage* storage,
3205 int header_size = sizeof(CvContour),
3208 CvPoint offset = cvPoint(0,0));
3211 extern "C" CvSeq* cvFindNextContour( CvContourScanner scanner );
3216 extern "C" void cvSubstituteContour( CvContourScanner scanner, CvSeq* new_contour );
3220 extern "C" CvSeq* cvEndFindContours( CvContourScanner* scanner );
3223 extern "C" CvSeq* cvApproxChains( CvSeq* src_seq, CvMemStorage* storage,
3225 double parameter = 0,
3226 int minimal_perimeter = 0,
3233 extern "C" void cvStartReadChainPoints( CvChain* chain, CvChainPtReader* reader );
3236 extern "C" CvPoint cvReadChainPoint( CvChainPtReader* reader );
3237 # 460 "../../../cv/include/cv.h"
3238 extern "C" void cvCalcOpticalFlowLK( const CvArr* prev, const CvArr* curr,
3239 CvSize win_size, CvArr* velx, CvArr* vely );
3242 extern "C" void cvCalcOpticalFlowBM( const CvArr* prev, const CvArr* curr,
3243 CvSize block_size, CvSize shift_size,
3244 CvSize max_range, int use_previous,
3245 CvArr* velx, CvArr* vely );
3248 extern "C" void cvCalcOpticalFlowHS( const CvArr* prev, const CvArr* curr,
3249 int use_previous, CvArr* velx, CvArr* vely,
3250 double lambda, CvTermCriteria criteria );
3251 # 483 "../../../cv/include/cv.h"
3252 extern "C" void cvCalcOpticalFlowPyrLK( const CvArr* prev, const CvArr* curr,
3253 CvArr* prev_pyr, CvArr* curr_pyr,
3254 const CvPoint2D32f* prev_features,
3255 CvPoint2D32f* curr_features,
3261 CvTermCriteria criteria,
3267 extern "C" void cvCalcAffineFlowPyrLK( const CvArr* prev, const CvArr* curr,
3268 CvArr* prev_pyr, CvArr* curr_pyr,
3269 const CvPoint2D32f* prev_features,
3270 CvPoint2D32f* curr_features,
3271 float* matrices, int count,
3272 CvSize win_size, int level,
3273 char* status, float* track_error,
3274 CvTermCriteria criteria, int flags );
3277 extern "C" int cvEstimateRigidTransform( const CvArr* A, const CvArr* B,
3278 CvMat* M, int full_affine );
3279 # 524 "../../../cv/include/cv.h"
3280 extern "C" void cvUpdateMotionHistory( const CvArr* silhouette, CvArr* mhi,
3281 double timestamp, double duration );
3285 extern "C" void cvCalcMotionGradient( const CvArr* mhi, CvArr* mask, CvArr* orientation,
3286 double delta1, double delta2,
3287 int aperture_size = 3);
3292 extern "C" double cvCalcGlobalOrientation( const CvArr* orientation, const CvArr* mask,
3293 const CvArr* mhi, double timestamp,
3298 extern "C" CvSeq* cvSegmentMotion( const CvArr* mhi, CvArr* seg_mask,
3299 CvMemStorage* storage,
3300 double timestamp, double seg_thresh );
3305 extern "C" void cvAcc( const CvArr* image, CvArr* sum,
3306 const CvArr* mask = NULL );
3309 extern "C" void cvSquareAcc( const CvArr* image, CvArr* sqsum,
3310 const CvArr* mask = NULL );
3313 extern "C" void cvMultiplyAcc( const CvArr* image1, const CvArr* image2, CvArr* acc,
3314 const CvArr* mask = NULL );
3317 extern "C" void cvRunningAvg( const CvArr* image, CvArr* acc, double alpha,
3318 const CvArr* mask = NULL );
3319 # 571 "../../../cv/include/cv.h"
3320 extern "C" int cvCamShift( const CvArr* prob_image, CvRect window,
3321 CvTermCriteria criteria, CvConnectedComp* comp,
3322 CvBox2D* box = NULL );
3326 extern "C" int cvMeanShift( const CvArr* prob_image, CvRect window,
3327 CvTermCriteria criteria, CvConnectedComp* comp );
3330 extern "C" CvConDensation* cvCreateConDensation( int dynam_params,
3335 extern "C" void cvReleaseConDensation( CvConDensation** condens );
3338 extern "C" void cvConDensUpdateByTime( CvConDensation* condens);
3341 extern "C" void cvConDensInitSampleSet( CvConDensation* condens, CvMat* lower_bound, CvMat* upper_bound );
3344 extern "C" CvKalman* cvCreateKalman( int dynam_params, int measure_params,
3345 int control_params = 0);
3348 extern "C" void cvReleaseKalman( CvKalman** kalman);
3351 extern "C" const CvMat* cvKalmanPredict( CvKalman* kalman,
3352 const CvMat* control = NULL);
3356 extern "C" const CvMat* cvKalmanCorrect( CvKalman* kalman, const CvMat* measurement );
3363 extern "C" void cvInitSubdivDelaunay2D( CvSubdiv2D* subdiv, CvRect rect );
3366 extern "C" CvSubdiv2D* cvCreateSubdiv2D( int subdiv_type, int header_size,
3367 int vtx_size, int quadedge_size,
3368 CvMemStorage* storage );
3373 inline CvSubdiv2D* cvCreateSubdivDelaunay2D( CvRect rect, CvMemStorage* storage )
3375 CvSubdiv2D* subdiv = cvCreateSubdiv2D( (4 << 9), sizeof(*subdiv),
3376 sizeof(CvSubdiv2DPoint), sizeof(CvQuadEdge2D), storage );
3378 cvInitSubdivDelaunay2D( subdiv, rect );
3384 extern "C" CvSubdiv2DPoint* cvSubdivDelaunay2DInsert( CvSubdiv2D* subdiv, CvPoint2D32f pt);
3389 extern "C" CvSubdiv2DPointLocation cvSubdiv2DLocate(
3390 CvSubdiv2D* subdiv, CvPoint2D32f pt,
3391 CvSubdiv2DEdge* edge,
3392 CvSubdiv2DPoint** vertex = NULL );
3395 extern "C" void cvCalcSubdivVoronoi2D( CvSubdiv2D* subdiv );
3399 extern "C" void cvClearSubdivVoronoi2D( CvSubdiv2D* subdiv );
3403 extern "C" CvSubdiv2DPoint* cvFindNearestPoint2D( CvSubdiv2D* subdiv, CvPoint2D32f pt );
3408 inline CvSubdiv2DEdge cvSubdiv2DNextEdge( CvSubdiv2DEdge edge )
3410 return (((CvQuadEdge2D*)((edge) & ~3))->next[(edge)&3]);
3414 inline CvSubdiv2DEdge cvSubdiv2DRotateEdge( CvSubdiv2DEdge edge, int rotate )
3416 return (edge & ~3) + ((edge + rotate) & 3);
3419 inline CvSubdiv2DEdge cvSubdiv2DSymEdge( CvSubdiv2DEdge edge )
3424 inline CvSubdiv2DEdge cvSubdiv2DGetEdge( CvSubdiv2DEdge edge, CvNextEdgeType type )
3426 CvQuadEdge2D* e = (CvQuadEdge2D*)(edge & ~3);
3427 edge = e->next[(edge + (int)type) & 3];
3428 return (edge & ~3) + ((edge + ((int)type >> 4)) & 3);
3432 inline CvSubdiv2DPoint* cvSubdiv2DEdgeOrg( CvSubdiv2DEdge edge )
3434 CvQuadEdge2D* e = (CvQuadEdge2D*)(edge & ~3);
3435 return (CvSubdiv2DPoint*)e->pt[edge & 3];
3439 inline CvSubdiv2DPoint* cvSubdiv2DEdgeDst( CvSubdiv2DEdge edge )
3441 CvQuadEdge2D* e = (CvQuadEdge2D*)(edge & ~3);
3442 return (CvSubdiv2DPoint*)e->pt[(edge + 2) & 3];
3446 inline double cvTriangleArea( CvPoint2D32f a, CvPoint2D32f b, CvPoint2D32f c )
3448 return (b.x - a.x) * (c.y - a.y) - (b.y - a.y) * (c.x - a.x);
3450 # 711 "../../../cv/include/cv.h"
3451 extern "C" CvSeq* cvApproxPoly( const void* src_seq,
3452 int header_size, CvMemStorage* storage,
3453 int method, double parameter,
3454 int parameter2 = 0);
3459 extern "C" CvSeq* cvFindDominantPoints( CvSeq* contour, CvMemStorage* storage,
3461 double parameter1 = 0,
3462 double parameter2 = 0,
3463 double parameter3 = 0,
3464 double parameter4 = 0);
3467 extern "C" double cvArcLength( const void* curve,
3468 CvSlice slice = cvSlice(0, 0x3fffffff),
3469 int is_closed = -1);
3474 extern "C" CvRect cvBoundingRect( CvArr* points, int update = 0 );
3477 extern "C" double cvContourArea( const CvArr* contour,
3478 CvSlice slice = cvSlice(0, 0x3fffffff));
3481 extern "C" CvBox2D cvMinAreaRect2( const CvArr* points,
3482 CvMemStorage* storage = NULL);
3485 extern "C" int cvMinEnclosingCircle( const CvArr* points,
3486 CvPoint2D32f* center, float* radius );
3493 extern "C" double cvMatchShapes( const void* object1, const void* object2,
3494 int method, double parameter = 0);
3497 extern "C" CvContourTree* cvCreateContourTree( const CvSeq* contour,
3498 CvMemStorage* storage,
3502 extern "C" CvSeq* cvContourFromContourTree( const CvContourTree* tree,
3503 CvMemStorage* storage,
3504 CvTermCriteria criteria );
3509 extern "C" double cvMatchContourTrees( const CvContourTree* tree1,
3510 const CvContourTree* tree2,
3511 int method, double threshold );
3514 extern "C" void cvCalcPGH( const CvSeq* contour, CvHistogram* hist );
3520 extern "C" CvSeq* cvConvexHull2( const CvArr* input,
3521 void* hull_storage = NULL,
3522 int orientation = 1,
3523 int return_points = 0);
3526 extern "C" int cvCheckContourConvexity( const CvArr* contour );
3529 extern "C" CvSeq* cvConvexityDefects( const CvArr* contour, const CvArr* convexhull,
3530 CvMemStorage* storage = NULL);
3533 extern "C" CvBox2D cvFitEllipse2( const CvArr* points );
3536 extern "C" CvRect cvMaxRect( const CvRect* rect1, const CvRect* rect2 );
3539 extern "C" void cvBoxPoints( CvBox2D box, CvPoint2D32f pt[4] );
3543 extern "C" CvSeq* cvPointSeqFromMat( int seq_kind, const CvArr* mat,
3544 CvContour* contour_header,
3545 CvSeqBlock* block );
3551 extern "C" double cvPointPolygonTest( const CvArr* contour,
3552 CvPoint2D32f pt, int measure_dist );
3559 extern "C" CvHistogram* cvCreateHist( int dims, int* sizes, int type,
3560 float** ranges = NULL,
3564 extern "C" void cvSetHistBinRanges( CvHistogram* hist, float** ranges,
3568 extern "C" CvHistogram* cvMakeHistHeaderForArray(
3569 int dims, int* sizes, CvHistogram* hist,
3570 float* data, float** ranges = NULL,
3574 extern "C" void cvReleaseHist( CvHistogram** hist );
3577 extern "C" void cvClearHist( CvHistogram* hist );
3580 extern "C" void cvGetMinMaxHistValue( const CvHistogram* hist,
3581 float* min_value, float* max_value,
3582 int* min_idx = NULL,
3583 int* max_idx = NULL);
3588 extern "C" void cvNormalizeHist( CvHistogram* hist, double factor );
3592 extern "C" void cvThreshHist( CvHistogram* hist, double threshold );
3600 extern "C" double cvCompareHist( const CvHistogram* hist1,
3601 const CvHistogram* hist2,
3606 extern "C" void cvCopyHist( const CvHistogram* src, CvHistogram** dst );
3611 extern "C" void cvCalcBayesianProb( CvHistogram** src, int number,
3615 extern "C" void cvCalcArrHist( CvArr** arr, CvHistogram* hist,
3617 const CvArr* mask = NULL );
3619 inline void cvCalcHist( IplImage** image, CvHistogram* hist,
3621 const CvArr* mask = NULL )
3623 cvCalcArrHist( (CvArr**)image, hist, accumulate, mask );
3627 extern "C" void cvCalcArrBackProject( CvArr** image, CvArr* dst,
3628 const CvHistogram* hist );
3634 extern "C" void cvCalcArrBackProjectPatch( CvArr** image, CvArr* dst, CvSize range,
3635 CvHistogram* hist, int method,
3642 extern "C" void cvCalcProbDensity( const CvHistogram* hist1, const CvHistogram* hist2,
3643 CvHistogram* dst_hist, double scale = 255 );
3646 extern "C" void cvEqualizeHist( const CvArr* src, CvArr* dst );
3653 extern "C" void cvSnakeImage( const IplImage* image, CvPoint* points,
3654 int length, float* alpha,
3655 float* beta, float* gamma,
3656 int coeff_usage, CvSize win,
3657 CvTermCriteria criteria, int calc_gradient = 1);
3660 extern "C" void cvCalcImageHomography( float* line, CvPoint3D32f* center,
3661 float* intrinsic, float* homography );
3668 extern "C" void cvDistTransform( const CvArr* src, CvArr* dst,
3669 int distance_type = 2,
3671 const float* mask = NULL,
3672 CvArr* labels = NULL);
3673 # 948 "../../../cv/include/cv.h"
3674 extern "C" double cvThreshold( const CvArr* src, CvArr* dst,
3675 double threshold, double max_value,
3676 int threshold_type );
3677 # 960 "../../../cv/include/cv.h"
3678 extern "C" void cvAdaptiveThreshold( const CvArr* src, CvArr* dst, double max_value,
3679 int adaptive_method = 0,
3680 int threshold_type = 0,
3688 extern "C" void cvFloodFill( CvArr* image, CvPoint seed_point,
3689 CvScalar new_val, CvScalar lo_diff = cvScalarAll(0),
3690 CvScalar up_diff = cvScalarAll(0),
3691 CvConnectedComp* comp = NULL,
3693 CvArr* mask = NULL);
3694 # 984 "../../../cv/include/cv.h"
3695 extern "C" void cvCanny( const CvArr* image, CvArr* edges, double threshold1,
3696 double threshold2, int aperture_size = 3 );
3701 extern "C" void cvPreCornerDetect( const CvArr* image, CvArr* corners,
3702 int aperture_size = 3 );
3706 extern "C" void cvCornerEigenValsAndVecs( const CvArr* image, CvArr* eigenvv,
3707 int block_size, int aperture_size = 3 );
3711 extern "C" void cvCornerMinEigenVal( const CvArr* image, CvArr* eigenval,
3712 int block_size, int aperture_size = 3 );
3716 extern "C" void cvCornerHarris( const CvArr* image, CvArr* harris_responce,
3717 int block_size, int aperture_size = 3,
3721 extern "C" void cvFindCornerSubPix( const CvArr* image, CvPoint2D32f* corners,
3722 int count, CvSize win, CvSize zero_zone,
3723 CvTermCriteria criteria );
3727 extern "C" void cvGoodFeaturesToTrack( const CvArr* image, CvArr* eig_image,
3728 CvArr* temp_image, CvPoint2D32f* corners,
3729 int* corner_count, double quality_level,
3730 double min_distance,
3731 const CvArr* mask = NULL,
3735 # 1037 "../../../cv/include/cv.h"
3736 extern "C" CvSeq* cvHoughLines2( CvArr* image, void* line_storage, int method,
3737 double rho, double theta, int threshold,
3738 double param1 = 0, double param2 = 0);
3741 extern "C" CvSeq* cvHoughCircles( CvArr* image, void* circle_storage,
3742 int method, double dp, double min_dist,
3743 double param1 = 100,
3744 double param2 = 100,
3746 int max_radius = 0);
3749 extern "C" void cvFitLine( const CvArr* points, int dist_type, double param,
3750 double reps, double aeps, float* line );
3758 extern "C" CvHaarClassifierCascade* cvLoadHaarClassifierCascade(
3759 const char* directory, CvSize orig_window_size);
3761 extern "C" void cvReleaseHaarClassifierCascade( CvHaarClassifierCascade** cascade );
3768 extern "C" CvSeq* cvHaarDetectObjects( const CvArr* image,
3769 CvHaarClassifierCascade* cascade,
3770 CvMemStorage* storage, double scale_factor = 1.1,
3771 int min_neighbors = 3, int flags = 0,
3772 CvSize min_size = cvSize(0,0));
3775 extern "C" void cvSetImagesForHaarClassifierCascade( CvHaarClassifierCascade* cascade,
3776 const CvArr* sum, const CvArr* sqsum,
3777 const CvArr* tilted_sum, double scale );
3780 extern "C" int cvRunHaarClassifierCascade( CvHaarClassifierCascade* cascade,
3781 CvPoint pt, int start_stage = 0);
3788 extern "C" void cvUndistort2( const CvArr* src, CvArr* dst,
3789 const CvMat* intrinsic_matrix,
3790 const CvMat* distortion_coeffs );
3794 extern "C" void cvInitUndistortMap( const CvMat* intrinsic_matrix,
3795 const CvMat* distortion_coeffs,
3796 CvArr* mapx, CvArr* mapy );
3799 extern "C" int cvRodrigues2( const CvMat* src, CvMat* dst,
3800 CvMat* jacobian = 0 );
3803 extern "C" void cvFindHomography( const CvMat* src_points,
3804 const CvMat* dst_points,
3805 CvMat* homography );
3809 extern "C" void cvProjectPoints2( const CvMat* object_points, const CvMat* rotation_vector,
3810 const CvMat* translation_vector, const CvMat* intrinsic_matrix,
3811 const CvMat* distortion_coeffs, CvMat* image_points,
3812 CvMat* dpdrot = NULL, CvMat* dpdt = NULL,
3813 CvMat* dpdf = NULL, CvMat* dpdc = NULL,
3814 CvMat* dpddist = NULL );
3818 extern "C" void cvFindExtrinsicCameraParams2( const CvMat* object_points,
3819 const CvMat* image_points,
3820 const CvMat* intrinsic_matrix,
3821 const CvMat* distortion_coeffs,
3822 CvMat* rotation_vector,
3823 CvMat* translation_vector );
3824 # 1133 "../../../cv/include/cv.h"
3825 extern "C" void cvCalibrateCamera2( const CvMat* object_points,
3826 const CvMat* image_points,
3827 const CvMat* point_counts,
3829 CvMat* intrinsic_matrix,
3830 CvMat* distortion_coeffs,
3831 CvMat* rotation_vectors = NULL,
3832 CvMat* translation_vectors = NULL,
3840 extern "C" int cvFindChessboardCorners( const void* image, CvSize pattern_size,
3841 CvPoint2D32f* corners,
3842 int* corner_count = NULL,
3846 extern "C" void cvDrawChessboardCorners( CvArr* image, CvSize pattern_size,
3847 CvPoint2D32f* corners,
3848 int count, int pattern_was_found );
3850 typedef struct CvPOSITObject CvPOSITObject;
3853 extern "C" CvPOSITObject* cvCreatePOSITObject( CvPoint3D32f* points, int point_count );
3858 extern "C" void cvPOSIT( CvPOSITObject* posit_object, CvPoint2D32f* image_points,
3859 double focal_length, CvTermCriteria criteria,
3860 CvMatr32f rotation_matrix, CvVect32f translation_vector);
3863 extern "C" void cvReleasePOSITObject( CvPOSITObject** posit_object );
3871 extern "C" int cvRANSACUpdateNumIters( double p, double err_prob,
3872 int model_points, int max_iters );
3874 extern "C" void cvConvertPointsHomogenious( const CvMat* src, CvMat* dst );
3875 # 1191 "../../../cv/include/cv.h"
3876 extern "C" int cvFindFundamentalMat( const CvMat* points1, const CvMat* points2,
3877 CvMat* fundamental_matrix,
3878 int method = (8 + 2),
3879 double param1 = 1., double param2 = 0.99,
3880 CvMat* status = NULL );
3885 extern "C" void cvComputeCorrespondEpilines( const CvMat* points,
3887 const CvMat* fundamental_matrix,
3888 CvMat* correspondent_lines );
3895 # 1 "../../../cv/include/cv.hpp" 1
3896 # 57 "../../../cv/include/cv.hpp"
3897 typedef void (*CvRowFilterFunc)( const uchar* src, uchar* dst, void* params );
3898 typedef void (*CvColumnFilterFunc)( uchar** src, uchar* dst, int dst_step, int count, void* params );
3900 class CvBaseImageFilter
3903 CvBaseImageFilter();
3905 CvBaseImageFilter( int _max_width, int _src_type, int _dst_type,
3906 bool _is_separable, CvSize _ksize,
3907 CvPoint _anchor=cvPoint(-1,-1),
3909 CvScalar _border_value=cvScalarAll(0) );
3910 virtual ~CvBaseImageFilter();
3911 # 82 "../../../cv/include/cv.hpp"
3912 virtual void init( int _max_width, int _src_type, int _dst_type,
3913 bool _is_separable, CvSize _ksize,
3914 CvPoint _anchor=cvPoint(-1,-1),
3916 CvScalar _border_value=cvScalarAll(0) );
3919 virtual void clear();
3920 # 105 "../../../cv/include/cv.hpp"
3921 virtual int process( const CvMat* _src, CvMat* _dst,
3922 CvRect _src_roi=cvRect(0,0,-1,-1),
3923 CvPoint _dst_origin=cvPoint(0,0), int _flags=0 );
3925 int get_src_type() const { return src_type; }
3926 int get_dst_type() const { return dst_type; }
3927 int get_work_type() const { return work_type; }
3928 CvSize get_kernel_size() const { return ksize; }
3929 CvPoint get_anchor() const { return anchor; }
3930 int get_width() const { return prev_x_range.end_index - prev_x_range.start_index; }
3931 CvRowFilterFunc get_x_filter_func() const { return x_func; }
3932 CvColumnFilterFunc get_y_filter_func() const { return y_func; }
3936 virtual void get_work_params();
3940 virtual void start_process( CvSlice x_range, int width );
3943 virtual void make_y_border( int row_count, int top_rows, int bottom_rows );
3945 virtual int fill_cyclic_buffer( const uchar* src, int src_step,
3946 int y, int y1, int y2 );
3952 int min_depth, src_type, dst_type, work_type;
3956 CvRowFilterFunc x_func;
3957 CvColumnFilterFunc y_func;
3961 int top_rows, bottom_rows, max_rows;
3962 uchar *buf_start, *buf_end, *buf_head, *buf_tail;
3963 int buf_size, buf_step, buf_count, buf_max_count;
3968 int max_ky, border_mode;
3969 CvScalar border_value;
3972 int border_tab_sz1, border_tab_sz;
3974 CvSlice prev_x_range;
3980 class CvSepFilter : public CvBaseImageFilter
3984 CvSepFilter( int _max_width, int _src_type, int _dst_type,
3985 const CvMat* _kx, const CvMat* _ky,
3986 CvPoint _anchor=cvPoint(-1,-1),
3988 CvScalar _border_value=cvScalarAll(0) );
3989 virtual ~CvSepFilter();
3991 virtual void init( int _max_width, int _src_type, int _dst_type,
3992 const CvMat* _kx, const CvMat* _ky,
3993 CvPoint _anchor=cvPoint(-1,-1),
3995 CvScalar _border_value=cvScalarAll(0) );
3996 virtual void init_deriv( int _max_width, int _src_type, int _dst_type,
3997 int dx, int dy, int aperture_size, int flags=0 );
3998 virtual void init_gaussian( int _max_width, int _src_type, int _dst_type,
3999 int gaussian_size, double sigma );
4002 virtual void init( int _max_width, int _src_type, int _dst_type,
4003 bool _is_separable, CvSize _ksize,
4004 CvPoint _anchor=cvPoint(-1,-1),
4006 CvScalar _border_value=cvScalarAll(0) );
4008 virtual void clear();
4009 const CvMat* get_x_kernel() const { return kx; }
4010 const CvMat* get_y_kernel() const { return ky; }
4011 int get_x_kernel_flags() const { return kx_flags; }
4012 int get_y_kernel_flags() const { return ky_flags; }
4014 enum { GENERIC=0, ASYMMETRICAL=1, SYMMETRICAL=2, POSITIVE=4, SUM_TO_1=8, INTEGER=16 };
4015 enum { NORMALIZE_KERNEL=1, FLIP_KERNEL=2 };
4017 static void init_gaussian_kernel( CvMat* kernel, double sigma=-1 );
4018 static void init_sobel_kernel( CvMat* _kx, CvMat* _ky, int dx, int dy, int flags=0 );
4019 static void init_scharr_kernel( CvMat* _kx, CvMat* _ky, int dx, int dy, int flags=0 );
4023 int kx_flags, ky_flags;
4028 class CvLinearFilter : public CvBaseImageFilter
4032 CvLinearFilter( int _max_width, int _src_type, int _dst_type,
4033 const CvMat* _kernel,
4034 CvPoint _anchor=cvPoint(-1,-1),
4036 CvScalar _border_value=cvScalarAll(0) );
4037 virtual ~CvLinearFilter();
4039 virtual void init( int _max_width, int _src_type, int _dst_type,
4040 const CvMat* _kernel,
4041 CvPoint _anchor=cvPoint(-1,-1),
4043 CvScalar _border_value=cvScalarAll(0) );
4046 virtual void init( int _max_width, int _src_type, int _dst_type,
4047 bool _is_separable, CvSize _ksize,
4048 CvPoint _anchor=cvPoint(-1,-1),
4050 CvScalar _border_value=cvScalarAll(0) );
4052 virtual void clear();
4053 const CvMat* get_kernel() const { return kernel; }
4054 uchar* get_kernel_sparse_buf() { return k_sparse; }
4055 int get_kernel_sparse_count() const { return k_sparse_count; }
4065 class CvBoxFilter : public CvBaseImageFilter
4069 CvBoxFilter( int _max_width, int _src_type, int _dst_type,
4070 bool _normalized, CvSize _ksize,
4071 CvPoint _anchor=cvPoint(-1,-1),
4073 CvScalar _border_value=cvScalarAll(0) );
4074 virtual void init( int _max_width, int _src_type, int _dst_type,
4075 bool _normalized, CvSize _ksize,
4076 CvPoint _anchor=cvPoint(-1,-1),
4078 CvScalar _border_value=cvScalarAll(0) );
4080 virtual ~CvBoxFilter();
4081 bool is_normalized() const { return normalized; }
4082 double get_scale() const { return scale; }
4083 uchar* get_sum_buf() { return sum; }
4084 int* get_sum_count_ptr() { return &sum_count; }
4087 virtual void start_process( CvSlice x_range, int width );
4097 class CvLaplaceFilter : public CvSepFilter
4101 CvLaplaceFilter( int _max_width, int _src_type, int _dst_type,
4102 bool _normalized, int _ksize,
4104 CvScalar _border_value=cvScalarAll(0) );
4105 virtual ~CvLaplaceFilter();
4106 virtual void init( int _max_width, int _src_type, int _dst_type,
4107 bool _normalized, int _ksize,
4109 CvScalar _border_value=cvScalarAll(0) );
4112 virtual void init( int _max_width, int _src_type, int _dst_type,
4113 bool _is_separable, CvSize _ksize,
4114 CvPoint _anchor=cvPoint(-1,-1),
4116 CvScalar _border_value=cvScalarAll(0) );
4118 virtual void init( int _max_width, int _src_type, int _dst_type,
4119 const CvMat* _kx, const CvMat* _ky,
4120 CvPoint _anchor=cvPoint(-1,-1),
4122 CvScalar _border_value=cvScalarAll(0) );
4124 bool is_normalized() const { return normalized; }
4125 bool is_basic_laplacian() const { return basic_laplacian; }
4127 void get_work_params();
4129 bool basic_laplacian;
4135 class CvMorphology : public CvBaseImageFilter
4139 CvMorphology( int _operation, int _max_width, int _src_dst_type,
4140 int _element_shape, CvMat* _element,
4141 CvSize _ksize=cvSize(0,0), CvPoint _anchor=cvPoint(-1,-1),
4143 CvScalar _border_value=cvScalarAll(0) );
4144 virtual ~CvMorphology();
4145 virtual void init( int _operation, int _max_width, int _src_dst_type,
4146 int _element_shape, CvMat* _element,
4147 CvSize _ksize=cvSize(0,0), CvPoint _anchor=cvPoint(-1,-1),
4149 CvScalar _border_value=cvScalarAll(0) );
4152 virtual void init( int _max_width, int _src_type, int _dst_type,
4153 bool _is_separable, CvSize _ksize,
4154 CvPoint _anchor=cvPoint(-1,-1),
4156 CvScalar _border_value=cvScalarAll(0) );
4158 virtual void clear();
4159 const CvMat* get_element() const { return element; }
4160 int get_element_shape() const { return el_shape; }
4161 int get_operation() const { return operation; }
4162 uchar* get_element_sparse_buf() { return el_sparse; }
4163 int get_element_sparse_count() const { return el_sparse_count; }
4165 enum { RECT=0, CROSS=1, ELLIPSE=2, CUSTOM=100, BINARY = 0, GRAYSCALE=256 };
4166 enum { ERODE=0, DILATE=1 };
4168 static void init_binary_element( CvMat* _element, int _element_shape,
4169 CvPoint _anchor=cvPoint(-1,-1) );
4172 void start_process( CvSlice x_range, int width );
4173 int fill_cyclic_buffer( const uchar* src, int src_step,
4174 int y0, int y1, int y2 );
4176 int el_sparse_count;
4182 # 1211 "../../../cv/include/cv.h" 2