45
#ifndef OPENCV_CORE_C_H
46
#define OPENCV_CORE_C_H
48
#include "opencv2/core/types_c.h"
58
# pragma warning(disable:4190)
59
# elif defined __clang__ && __clang_major__ >= 3
60
# pragma GCC diagnostic ignored "-Wreturn-type-c-linkage"
80
CVAPI(
void*) cvAlloc(
size_t
size );
88
CVAPI(
void) cvFree_(
void* ptr );
89
#define cvFree(ptr) (cvFree_(*(ptr)), *(ptr)=0)
110
int
channels,
int
origin CV_DEFAULT(0),
111
int
align CV_DEFAULT(4));
218
CVAPI(
CvMat*) cvCreateMatHeader(
int
rows,
int
cols,
int
type );
220
#define CV_AUTOSTEP 0x7fffffff
255
int
type,
void* data CV_DEFAULT(NULL),
256
int
step CV_DEFAULT(CV_AUTOSTEP) );
272
CVAPI(
CvMat*) cvCreateMat(
int
rows,
int
cols,
int
type );
300
if( CV_IS_MAT( arr ))
303
mat->data.ptr = NULL;
304
if( mat->refcount != NULL && --*mat->refcount == 0 )
305
cvFree( &mat->refcount );
306
mat->refcount = NULL;
308
else
if( CV_IS_MATND( arr ))
311
mat->data.ptr = NULL;
312
if( mat->refcount != NULL && --*mat->refcount == 0 )
313
cvFree( &mat->refcount );
314
mat->refcount = NULL;
327
if( CV_IS_MAT( arr ))
330
if( mat->refcount != NULL )
331
refcount = ++*mat->refcount;
333
else
if( CV_IS_MATND( arr ))
336
if( mat->refcount != NULL )
337
refcount = ++*mat->refcount;
358
#define cvGetSubArr cvGetSubRect
372
int
start_row,
int
end_row,
373
int
delta_row CV_DEFAULT(1));
382
return
cvGetRows( arr, submat, row, row + 1, 1 );
399
int
start_col,
int
end_col );
408
return
cvGetCols( arr, submat, col, col + 1 );
421
int
diag CV_DEFAULT(0));
424
CVAPI(
void) cvScalarToRawData(
const
CvScalar* scalar,
void* data,
int
type,
425
int
extend_to_12 CV_DEFAULT(0) );
427
CVAPI(
void) cvRawDataToScalar(
const
void* data,
int
type,
CvScalar* scalar );
437
CVAPI(
CvMatND*) cvCreateMatNDHeader(
int
dims,
const
int* sizes,
int
type );
451
CVAPI(
CvMatND*) cvCreateMatND(
int
dims,
const
int* sizes,
int
type );
462
int
type,
void* data CV_DEFAULT(NULL) );
477
cvReleaseMat( (
CvMat**)mat );
544
if( mat_iterator->node->next )
545
return
mat_iterator->node = mat_iterator->node->next;
549
for( idx = ++mat_iterator->curidx; idx < mat_iterator->mat->hashsize; idx++ )
554
mat_iterator->curidx = idx;
555
return
mat_iterator->node = node;
563
#define CV_MAX_ARR 10
578
#define CV_NO_DEPTH_CHECK 1
579
#define CV_NO_CN_CHECK 2
580
#define CV_NO_SIZE_CHECK 4
585
CVAPI(
int) cvInitNArrayIterator(
int
count,
CvArr** arrs,
588
int
flags CV_DEFAULT(0) );
622
CVAPI(
int) cvGetDims(
const
CvArr* arr,
int* sizes CV_DEFAULT(NULL) );
631
CVAPI(
int) cvGetDimSize(
const
CvArr* arr,
int
index );
649
CVAPI(uchar*) cvPtr1D(
const
CvArr* arr,
int
idx0,
int* type CV_DEFAULT(NULL));
651
CVAPI(uchar*) cvPtr2D(
const
CvArr* arr,
int
idx0,
int
idx1,
int* type CV_DEFAULT(NULL) );
653
CVAPI(uchar*) cvPtr3D(
const
CvArr* arr,
int
idx0,
int
idx1,
int
idx2,
654
int* type CV_DEFAULT(NULL));
665
CVAPI(uchar*) cvPtrND(
const
CvArr* arr,
const
int* idx,
int* type CV_DEFAULT(NULL),
666
int
create_node CV_DEFAULT(1),
667
unsigned* precalc_hashval CV_DEFAULT(NULL));
700
CVAPI(
double) cvGetReal2D(
const
CvArr* arr,
int
idx0,
int
idx1 );
702
CVAPI(
double) cvGetReal3D(
const
CvArr* arr,
int
idx0,
int
idx1,
int
idx2 );
707
CVAPI(
double) cvGetRealND(
const
CvArr* arr,
const
int* idx );
740
CVAPI(
void) cvSetReal1D(
CvArr* arr,
int
idx0,
double
value );
742
CVAPI(
void) cvSetReal2D(
CvArr* arr,
int
idx0,
int
idx1,
double
value );
744
CVAPI(
void) cvSetReal3D(
CvArr* arr,
int
idx0,
745
int
idx1,
int
idx2,
double
value );
751
CVAPI(
void) cvSetRealND(
CvArr* arr,
const
int* idx,
double
value );
755
CVAPI(
void) cvClearND(
CvArr* arr,
const
int* idx );
780
int* coi CV_DEFAULT(NULL),
781
int
allowND CV_DEFAULT(0));
833
int
sizeof_header,
CvArr* header,
834
int
new_cn,
int
new_dims,
int* new_sizes );
836
#define cvReshapeND( arr, header, new_cn, new_dims, new_sizes ) \
837
cvReshapeMatND( (arr), sizeof(*(header)), (header), \
838
(new_cn), (new_dims), (new_sizes))
868
int
new_cn,
int
new_rows CV_DEFAULT(0) );
902
CVAPI(
void) cvSetData(
CvArr* arr,
void* data,
int
step );
930
CVAPI(
void) cvGetRawData(
const
CvArr* arr, uchar** data,
931
int* step CV_DEFAULT(NULL),
932
CvSize* roi_size CV_DEFAULT(NULL));
957
const
CvArr* mask CV_DEFAULT(NULL) );
970
const
CvArr* mask CV_DEFAULT(NULL) );
980
#define cvZero cvSetZero
996
CVAPI(
void) cvMixChannels(
const
CvArr** src,
int
src_count,
997
CvArr** dst,
int
dst_count,
998
const
int* from_to,
int
pair_count );
1019
double
scale CV_DEFAULT(1),
1020
double
shift CV_DEFAULT(0) );
1021
#define cvCvtScale cvConvertScale
1022
#define cvScale cvConvertScale
1023
#define cvConvert( src, dst ) cvConvertScale( (src), (dst), 1, 0 )
1032
double
scale CV_DEFAULT(1),
1033
double
shift CV_DEFAULT(0) );
1034
#define cvCvtScaleAbs cvConvertScaleAbs
1043
int
default_max_iters );
1051
const
CvArr* mask CV_DEFAULT(NULL));
1055
const
CvArr* mask CV_DEFAULT(NULL));
1059
const
CvArr* mask CV_DEFAULT(NULL));
1063
const
CvArr* mask CV_DEFAULT(NULL))
1065
cvAddS( src, cvScalar( -value.val[0], -value.val[1], -value.val[2], -value.val[3]),
1071
const
CvArr* mask CV_DEFAULT(NULL));
1076
CvArr* dst,
double
scale CV_DEFAULT(1) );
1082
CvArr* dst,
double
scale CV_DEFAULT(1));
1087
#define cvAXPY( A, real_scalar, B, C ) cvScaleAdd(A, cvRealScalar(real_scalar), B, C)
1090
CVAPI(
void) cvAddWeighted(
const
CvArr* src1,
double
alpha,
1091
const
CvArr* src2,
double
beta,
1092
double
gamma,
CvArr* dst );
1110
CvArr* dst,
const
CvArr* mask CV_DEFAULT(NULL));
1114
CvArr* dst,
const
CvArr* mask CV_DEFAULT(NULL));
1118
CvArr* dst,
const
CvArr* mask CV_DEFAULT(NULL));
1122
CvArr* dst,
const
CvArr* mask CV_DEFAULT(NULL));
1126
CvArr* dst,
const
CvArr* mask CV_DEFAULT(NULL));
1130
CvArr* dst,
const
CvArr* mask CV_DEFAULT(NULL));
1157
CVAPI(
void) cvCmpS(
const
CvArr* src,
double
value,
CvArr* dst,
int
cmp_op );
1176
#define cvAbs( src, dst ) cvAbsDiffS( (src), (dst), cvScalarAll(0))
1185
CvArr* magnitude,
CvArr* angle CV_DEFAULT(NULL),
1186
int
angle_in_degrees CV_DEFAULT(0));
1191
CVAPI(
void) cvPolarToCart(
const
CvArr* magnitude,
const
CvArr* angle,
1193
int
angle_in_degrees CV_DEFAULT(0));
1210
CVAPI(
float) cvFastArctan(
float
y,
float
x );
1213
CVAPI(
float) cvCbrt(
float
value );
1215
#define CV_CHECK_RANGE 1
1216
#define CV_CHECK_QUIET 2
1221
CVAPI(
int) cvCheckArr(
const
CvArr* arr,
int
flags CV_DEFAULT(0),
1222
double
min_val CV_DEFAULT(0),
double
max_val CV_DEFAULT(0));
1223
#define cvCheckArray cvCheckArr
1225
#define CV_RAND_UNI 0
1226
#define CV_RAND_NORMAL 1
1244
CVAPI(
void) cvRandArr( CvRNG* rng,
CvArr* arr,
int
dist_type,
1247
CVAPI(
void) cvRandShuffle(
CvArr* mat, CvRNG* rng,
1248
double
iter_factor CV_DEFAULT(1.));
1250
#define CV_SORT_EVERY_ROW 0
1251
#define CV_SORT_EVERY_COLUMN 1
1252
#define CV_SORT_ASCENDING 0
1253
#define CV_SORT_DESCENDING 16
1256
CvArr* idxmat CV_DEFAULT(NULL),
1257
int
flags CV_DEFAULT(0));
1264
int
maxiter CV_DEFAULT(20),
int
fig CV_DEFAULT(100));
1283
#define cvMatMulAdd( src1, src2, src3, dst ) cvGEMM( (src1), (src2), 1., (src3), 1., (dst), 0 )
1284
#define cvMatMul( src1, src2, dst ) cvMatMulAdd( (src1), (src2), NULL, (dst))
1286
#define CV_GEMM_A_T 1
1287
#define CV_GEMM_B_T 2
1288
#define CV_GEMM_C_T 4
1291
CVAPI(
void) cvGEMM(
const
CvArr* src1,
const
CvArr* src2,
double
alpha,
1293
int
tABC CV_DEFAULT(0));
1294
#define cvMatMulAddEx cvGEMM
1299
const
CvMat* transmat,
1300
const
CvMat* shiftvec CV_DEFAULT(NULL));
1301
#define cvMatMulAddS cvTransform
1309
const
CvArr* delta CV_DEFAULT(NULL),
1310
double
scale CV_DEFAULT(1.) );
1314
#define cvT cvTranspose
1317
CVAPI(
void) cvCompleteSymm(
CvMat* matrix,
int
LtoR CV_DEFAULT(0) );
1323
int
flip_mode CV_DEFAULT(0));
1324
#define cvMirror cvFlip
1327
#define CV_SVD_MODIFY_A 1
1328
#define CV_SVD_U_T 2
1329
#define CV_SVD_V_T 4
1333
CvArr* V CV_DEFAULT(NULL),
int
flags CV_DEFAULT(0));
1339
CvArr* X,
int
flags );
1343
#define CV_SVD_SYM 2
1344
#define CV_CHOLESKY 3
1346
#define CV_NORMAL 16
1350
int
method CV_DEFAULT(CV_LU));
1351
#define cvInv cvInvert
1356
int
method CV_DEFAULT(CV_LU));
1366
double
eps CV_DEFAULT(0),
1367
int
lowindex CV_DEFAULT(-1),
1368
int
highindex CV_DEFAULT(-1));
1387
#define CV_COVAR_SCRAMBLED 0
1390
#define CV_COVAR_NORMAL 1
1394
#define CV_COVAR_USE_AVG 2
1397
#define CV_COVAR_SCALE 4
1400
#define CV_COVAR_ROWS 8
1403
#define CV_COVAR_COLS 16
1410
CVAPI(
void) cvCalcCovarMatrix(
const
CvArr** vects,
int
count,
1413
#define CV_PCA_DATA_AS_ROW 0
1414
#define CV_PCA_DATA_AS_COL 1
1415
#define CV_PCA_USE_AVG 2
1417
CvArr* eigenvals,
CvArr* eigenvects,
int
flags );
1427
#define cvMahalonobis cvMahalanobis
1437
CVAPI(
int) cvCountNonZero(
const
CvArr* arr );
1444
const
CvArr* mask CV_DEFAULT(NULL) );
1447
CVAPI(
void) cvMinMaxLoc(
const
CvArr* arr,
double* min_val,
double* max_val,
1448
CvPoint* min_loc CV_DEFAULT(NULL),
1449
CvPoint* max_loc CV_DEFAULT(NULL),
1450
const
CvArr* mask CV_DEFAULT(NULL) );
1459
#define CV_NORM_MASK 7
1460
#define CV_RELATIVE 8
1462
#define CV_MINMAX 32
1464
#define CV_DIFF_C (CV_DIFF | CV_C)
1465
#define CV_DIFF_L1 (CV_DIFF | CV_L1)
1466
#define CV_DIFF_L2 (CV_DIFF | CV_L2)
1467
#define CV_RELATIVE_C (CV_RELATIVE | CV_C)
1468
#define CV_RELATIVE_L1 (CV_RELATIVE | CV_L1)
1469
#define CV_RELATIVE_L2 (CV_RELATIVE | CV_L2)
1475
CVAPI(
double) cvNorm(
const
CvArr* arr1,
const
CvArr* arr2 CV_DEFAULT(NULL),
1476
int
norm_type CV_DEFAULT(CV_L2),
1477
const
CvArr* mask CV_DEFAULT(NULL) );
1481
double
a CV_DEFAULT(1.),
double
b CV_DEFAULT(0.),
1482
int
norm_type CV_DEFAULT(CV_L2),
1483
const
CvArr* mask CV_DEFAULT(NULL) );
1489
#define CV_REDUCE_SUM 0
1490
#define CV_REDUCE_AVG 1
1491
#define CV_REDUCE_MAX 2
1492
#define CV_REDUCE_MIN 3
1496
CVAPI(
void) cvReduce(
const
CvArr* src,
CvArr* dst,
int
dim CV_DEFAULT(-1),
1497
int
op CV_DEFAULT(CV_REDUCE_SUM) );
1507
#define CV_DXT_FORWARD 0
1508
#define CV_DXT_INVERSE 1
1509
#define CV_DXT_SCALE 2
1510
#define CV_DXT_INV_SCALE (CV_DXT_INVERSE + CV_DXT_SCALE)
1511
#define CV_DXT_INVERSE_SCALE CV_DXT_INV_SCALE
1512
#define CV_DXT_ROWS 4
1513
#define CV_DXT_MUL_CONJ 8
1523
int
nonzero_rows CV_DEFAULT(0) );
1530
CvArr* dst,
int
flags );
1533
CVAPI(
int) cvGetOptimalDFTSize(
int
size0 );
1588
CVAPI(
void) cvSetSeqBlockSize(
CvSeq* seq,
int
delta_elems );
1592
CVAPI(schar*) cvSeqPush(
CvSeq* seq,
const
void* element CV_DEFAULT(NULL));
1596
CVAPI(schar*) cvSeqPushFront(
CvSeq* seq,
const
void* element CV_DEFAULT(NULL));
1600
CVAPI(
void) cvSeqPop(
CvSeq* seq,
void* element CV_DEFAULT(NULL));
1604
CVAPI(
void) cvSeqPopFront(
CvSeq* seq,
void* element CV_DEFAULT(NULL));
1610
CVAPI(
void) cvSeqPushMulti(
CvSeq* seq,
const
void* elements,
1611
int
count,
int
in_front CV_DEFAULT(0) );
1614
CVAPI(
void) cvSeqPopMulti(
CvSeq* seq,
void* elements,
1615
int
count,
int
in_front CV_DEFAULT(0) );
1619
CVAPI(schar*) cvSeqInsert(
CvSeq* seq,
int
before_index,
1620
const
void* element CV_DEFAULT(NULL));
1623
CVAPI(
void) cvSeqRemove(
CvSeq* seq,
int
index );
1635
CVAPI(schar*) cvGetSeqElem(
const
CvSeq* seq,
int
index );
1639
CVAPI(
int) cvSeqElemIdx(
const
CvSeq* seq,
const
void* element,
1647
CVAPI(
void) cvStartWriteSeq(
int
seq_flags,
int
header_size,
1666
int
reverse CV_DEFAULT(0) );
1676
int
is_relative CV_DEFAULT(0));
1679
CVAPI(
void*) cvCvtSeqToArray(
const
CvSeq* seq,
void* elements,
1680
CvSlice
slice CV_DEFAULT(CV_WHOLE_SEQ) );
1685
CVAPI(
CvSeq*) cvMakeSeqHeaderForArray(
int
seq_type,
int
header_size,
1686
int
elem_size,
void* elements,
int
total,
1692
int
copy_data CV_DEFAULT(0));
1696
return
cvSeqSlice( seq, CV_WHOLE_SEQ, storage, 1 );
1703
CVAPI(
void) cvSeqInsertSlice(
CvSeq* seq,
int
before_index,
const
CvArr* from_arr );
1706
typedef
int (CV_CDECL*
CvCmpFunc)(
const
void* a,
const
void* b,
void* userdata );
1713
int
is_sorted,
int* elem_idx,
1714
void* userdata CV_DEFAULT(NULL) );
1724
CVAPI(
void) cvChangeSeqBlock(
void* reader,
int
direction );
1734
CvSetElem** inserted_elem CV_DEFAULT(NULL) );
1739
CvSetElem* elem = set_header->free_elems;
1742
set_header->free_elems = elem->next_free;
1743
elem->flags = elem->flags & CV_SET_ELEM_IDX_MASK;
1744
set_header->active_count++;
1747
cvSetAdd( set_header, NULL, &elem );
1755
assert( _elem->flags >= 0
);
1756
_elem->next_free = set_header->free_elems;
1757
_elem->flags = (_elem->flags & CV_SET_ELEM_IDX_MASK) | CV_SET_ELEM_FREE_FLAG;
1758
set_header->free_elems = _elem;
1759
set_header->active_count--;
1763
CVAPI(
void) cvSetRemove(
CvSet* set_header,
int
index );
1778
int
vtx_size,
int
edge_size,
1783
CvGraphVtx** inserted_vtx CV_DEFAULT(NULL) );
1787
CVAPI(
int) cvGraphRemoveVtx(
CvGraph* graph,
int
index );
1796
int
start_idx,
int
end_idx,
1806
CVAPI(
void) cvGraphRemoveEdge(
CvGraph* graph,
int
start_idx,
int
end_idx );
1815
#define cvGraphFindEdge cvFindGraphEdge
1816
#define cvGraphFindEdgeByPtr cvFindGraphEdgeByPtr
1823
CVAPI(
int) cvGraphVtxDegree(
const
CvGraph* graph,
int
vtx_idx );
1828
#define cvGetGraphVtx( graph, idx ) (CvGraphVtx*)cvGetSetElem((CvSet*)(graph), (idx))
1831
#define cvGraphVtxIdx( graph, vtx ) ((vtx)->flags & CV_SET_ELEM_IDX_MASK)
1834
#define cvGraphEdgeIdx( graph, edge ) ((edge)->flags & CV_SET_ELEM_IDX_MASK)
1836
#define cvGraphGetVtxCount( graph ) ((graph)->active_count)
1837
#define cvGraphGetEdgeCount( graph ) ((graph)->edges->active_count)
1839
#define CV_GRAPH_VERTEX 1
1840
#define CV_GRAPH_TREE_EDGE 2
1841
#define CV_GRAPH_BACK_EDGE 4
1842
#define CV_GRAPH_FORWARD_EDGE 8
1843
#define CV_GRAPH_CROSS_EDGE 16
1844
#define CV_GRAPH_ANY_EDGE 30
1845
#define CV_GRAPH_NEW_TREE 32
1846
#define CV_GRAPH_BACKTRACKING 64
1847
#define CV_GRAPH_OVER -1
1849
#define CV_GRAPH_ALL_ITEMS -1
1852
#define CV_GRAPH_ITEM_VISITED_FLAG (1 << 30)
1853
#define CV_IS_GRAPH_VERTEX_VISITED(vtx) \
1854
(((CvGraphVtx*)(vtx))->flags & CV_GRAPH_ITEM_VISITED_FLAG)
1855
#define CV_IS_GRAPH_EDGE_VISITED(edge) \
1856
(((CvGraphEdge*)(edge))->flags & CV_GRAPH_ITEM_VISITED_FLAG)
1857
#define CV_GRAPH_SEARCH_TREE_NODE_FLAG (1 << 29)
1858
#define CV_GRAPH_FORWARD_EDGE_FLAG (1 << 28)
1876
int
mask CV_DEFAULT(CV_GRAPH_ALL_ITEMS));
1903
const
void* first,
int
max_level );
1910
CVAPI(
void) cvInsertNodeIntoTree(
void* node,
void* parent,
void* frame );
1913
CVAPI(
void) cvRemoveNodeFromTree(
void* node,
void* frame );
1917
CVAPI(
CvSeq*) cvTreeToNodeSeq(
const
void* first,
int
header_size,
1922
#define CV_KMEANS_USE_INITIAL_LABELS 1
1923
CVAPI(
int) cvKMeans2(
const
CvArr* samples,
int
cluster_count,
CvArr* labels,
1925
CvRNG* rng CV_DEFAULT(0),
int
flags CV_DEFAULT(0),
1926
CvArr* _centers CV_DEFAULT(0),
double* compactness CV_DEFAULT(0) );
1933
CVAPI(
int) cvUseOptimized(
int
on_off );
1935
typedef
IplImage* (CV_STDCALL* Cv_iplCreateImageHeader)
1936
(
int,
int,
int,
char*,
char*,
int,
int,
int,
int,
int,
1938
typedef
void (CV_STDCALL* Cv_iplAllocateImageData)(
IplImage*,int,int);
1939
typedef
void (CV_STDCALL* Cv_iplDeallocate)(
IplImage*,int);
1940
typedef
IplROI* (CV_STDCALL* Cv_iplCreateROI)(
int,
int,
int,
int,
int);
1959
CVAPI(
void) cvSetIPLAllocators( Cv_iplCreateImageHeader create_header,
1960
Cv_iplAllocateImageData allocate_data,
1961
Cv_iplDeallocate deallocate,
1962
Cv_iplCreateROI create_roi,
1963
Cv_iplCloneImage clone_image );
1965
#define CV_TURN_ON_IPL_COMPATIBILITY() \
1966
cvSetIPLAllocators( iplCreateImageHeader, iplAllocateImage, \
1967
iplDeallocate, iplCreateROI, iplCloneImage )
1996
CVAPI(CvFileStorage*) cvOpenFileStorage(
const
char* filename,
CvMemStorage* memstorage,
1997
int
flags,
const
char* encoding CV_DEFAULT(NULL) );
2005
CVAPI(
void) cvReleaseFileStorage( CvFileStorage** fs );
2008
CVAPI(
const
char*) cvAttrValue(
const
CvAttrList* attr,
const
char* attr_name );
2036
CVAPI(
void) cvStartWriteStruct( CvFileStorage* fs,
const
char* name,
2037
int
struct_flags,
const
char* type_name CV_DEFAULT(NULL),
2038
CvAttrList attributes CV_DEFAULT(cvAttrList()));
2044
CVAPI(
void) cvEndWriteStruct( CvFileStorage* fs );
2054
CVAPI(
void) cvWriteInt( CvFileStorage* fs,
const
char* name,
int
value );
2081
CVAPI(
void) cvWriteReal( CvFileStorage* fs,
const
char* name,
double
value );
2094
CVAPI(
void) cvWriteString( CvFileStorage* fs,
const
char* name,
2095
const
char* str,
int
quote CV_DEFAULT(0) );
2106
CVAPI(
void) cvWriteComment( CvFileStorage* fs,
const
char* comment,
2154
CVAPI(
void) cvWrite( CvFileStorage* fs,
const
char* name,
const
void* ptr,
2155
CvAttrList attributes CV_DEFAULT(cvAttrList()));
2181
CVAPI(
void) cvStartNextStream( CvFileStorage* fs );
2194
CVAPI(
void) cvWriteRawData( CvFileStorage* fs,
const
void* src,
2195
int
len,
const
char* dt );
2211
CVAPI(
void) cvWriteRawDataBase64( CvFileStorage* fs,
const
void* src,
2212
int
len,
const
char* dt );
2282
CVAPI(CvStringHashNode*) cvGetHashedKey( CvFileStorage* fs,
const
char* name,
2283
int
len CV_DEFAULT(-1),
2284
int
create_missing CV_DEFAULT(0));
2297
CVAPI(CvFileNode*) cvGetRootFileNode(
const
CvFileStorage* fs,
2298
int
stream_index CV_DEFAULT(0) );
2310
CVAPI(CvFileNode*) cvGetFileNode( CvFileStorage* fs, CvFileNode* map,
2311
const
CvStringHashNode* key,
2312
int
create_missing CV_DEFAULT(0) );
2326
CVAPI(CvFileNode*) cvGetFileNodeByName(
const
CvFileStorage* fs,
2327
const
CvFileNode* map,
2340CV_INLINE
int
cvReadInt(
const
CvFileNode* node,
int
default_value CV_DEFAULT(0) )
2342
return
!node ? default_value :
2343
CV_NODE_IS_INT(node->tag) ? node->data.i :
2344
CV_NODE_IS_REAL(node->tag) ?
cvRound(node->data.f) : 0x7fffffff;
2355CV_INLINE
int
cvReadIntByName(
const
CvFileStorage* fs,
const
CvFileNode* map,
2356
const
char* name,
int
default_value CV_DEFAULT(0) )
2358
return
cvReadInt( cvGetFileNodeByName( fs, map, name ), default_value );
2371CV_INLINE
double
cvReadReal(
const
CvFileNode* node,
double
default_value CV_DEFAULT(0.) )
2373
return
!node ? default_value :
2374
CV_NODE_IS_INT(node->tag) ? (double)node->data.i :
2375
CV_NODE_IS_REAL(node->tag) ? node->data.f : 1e300;
2386CV_INLINE
double
cvReadRealByName(
const
CvFileStorage* fs,
const
CvFileNode* map,
2387
const
char* name,
double
default_value CV_DEFAULT(0.) )
2389
return
cvReadReal( cvGetFileNodeByName( fs, map, name ), default_value );
2401CV_INLINE
const
char* cvReadString(
const
CvFileNode* node,
2402
const
char* default_value CV_DEFAULT(NULL) )
2404
return
!node ? default_value : CV_NODE_IS_STRING(node->tag) ? node->data.str.ptr : 0;
2415CV_INLINE
const
char* cvReadStringByName(
const
CvFileStorage* fs,
const
CvFileNode* map,
2416
const
char* name,
const
char* default_value CV_DEFAULT(NULL) )
2418
return
cvReadString( cvGetFileNodeByName( fs, map, name ), default_value );
2436
CVAPI(
void*) cvRead( CvFileStorage* fs, CvFileNode* node,
2437
CvAttrList* attributes CV_DEFAULT(NULL));
2447CV_INLINE
void* cvReadByName( CvFileStorage* fs,
const
CvFileNode* map,
2448
const
char* name, CvAttrList* attributes CV_DEFAULT(NULL) )
2450
return
cvRead( fs, cvGetFileNodeByName( fs, map, name ), attributes );
2462
CVAPI(
void) cvStartReadRawData(
const
CvFileStorage* fs,
const
CvFileNode* src,
2478
CVAPI(
void) cvReadRawDataSlice(
const
CvFileStorage* fs,
CvSeqReader* reader,
2479
int
count,
void* dst,
const
char* dt );
2489
CVAPI(
void) cvReadRawData(
const
CvFileStorage* fs,
const
CvFileNode* src,
2490
void* dst,
const
char* dt );
2505
CVAPI(
void) cvWriteFileNode( CvFileStorage* fs,
const
char* new_node_name,
2506
const
CvFileNode* node,
int
embed );
2514
CVAPI(
const
char*) cvGetFileNodeName(
const
CvFileNode* node );
2524
CVAPI(
void) cvRegisterType(
const
CvTypeInfo* info );
2533
CVAPI(
void) cvUnregisterType(
const
char* type_name );
2540
CVAPI(CvTypeInfo*) cvFirstType(
void);
2548
CVAPI(CvTypeInfo*) cvFindType(
const
char* type_name );
2558
CVAPI(CvTypeInfo*) cvTypeOf(
const
void* struct_ptr );
2567
CVAPI(
void) cvRelease(
void** struct_ptr );
2576
CVAPI(
void*) cvClone(
const
void* struct_ptr );
2583
CVAPI(
double) cvGetTickFrequency(
void
);
2587
CVAPI(
int) cvCheckHardwareSupport(
int
feature);
2592
CVAPI(
int) cvGetNumThreads(
void
);
2593
CVAPI(
void) cvSetNumThreads(
int
threads CV_DEFAULT(0) );
2595
CVAPI(
int) cvGetThreadNum(
void
);
2601
CVAPI(
int) cvGetErrStatus(
void
);
2604
CVAPI(
void) cvSetErrStatus(
int
status );
2606
#define CV_ErrModeLeaf 0
2607
#define CV_ErrModeParent 1
2608
#define CV_ErrModeSilent 2
2611
CVAPI(
int) cvGetErrMode(
void
);
2614
CVAPI(
int) cvSetErrMode(
int
mode );
2619
CVAPI(
void) cvError(
int
status,
const
char* func_name,
2620
const
char* err_msg,
const
char* file_name,
int
line );
2623
CVAPI(
const
char*) cvErrorStr(
int
status );
2626
CVAPI(
int) cvGetErrInfo(
const
char** errcode_desc,
const
char** description,
2627
const
char** filename,
int* line );
2630
CVAPI(
int) cvErrorFromIppStatus(
int
ipp_status );
2632
typedef
int (CV_CDECL *CvErrorCallback)(
int
status,
const
char* func_name,
2633
const
char* err_msg,
const
char* file_name,
int
line,
void* userdata );
2636
CVAPI(CvErrorCallback) cvRedirectError( CvErrorCallback error_handler,
2637
void* userdata CV_DEFAULT(NULL),
2638
void** prev_userdata CV_DEFAULT(NULL) );
2641
CVAPI(
int) cvNulDevReport(
int
status,
const
char* func_name,
const
char* err_msg,
2642
const
char* file_name,
int
line,
void* userdata );
2645
CVAPI(
int) cvStdErrReport(
int
status,
const
char* func_name,
const
char* err_msg,
2646
const
char* file_name,
int
line,
void* userdata );
2649
CVAPI(
int) cvGuiBoxReport(
int
status,
const
char* func_name,
const
char* err_msg,
2650
const
char* file_name,
int
line,
void* userdata );
2652
#define OPENCV_ERROR(status,func,context) \
2653
cvError((status),(func),(context),__FILE__,__LINE__)
2655
#define OPENCV_ASSERT(expr,func,context) \
2657
{OPENCV_ERROR(CV_StsInternal,(func),(context));}}
2659
#define OPENCV_CALL( Func ) \
2666
#ifdef CV_NO_FUNC_NAMES
2667
#define CV_FUNCNAME( Name )
2668
#define cvFuncName ""
2670
#define CV_FUNCNAME( Name ) \
2671
static char cvFuncName[] = Name
2679
#define CV_ERROR( Code, Msg ) \
2681
cvError( (Code), cvFuncName, Msg, __FILE__, __LINE__ ); \
2690
#define CV_CHECK() \
2692
if( cvGetErrStatus() < 0 ) \
2693
CV_ERROR( CV_StsBackTrace, "Inner function failed."
); \
2702
#define CV_CALL( Func ) \
2710
#define CV_ASSERT( Condition ) \
2712
if( !(Condition) ) \
2713
CV_ERROR( CV_StsInternal, "Assertion: "
#Condition " failed" ); \
2716
#define __CV_BEGIN__ {
2717
#define __CV_END__ goto exit; exit: ; }
2718
#define __CV_EXIT__ goto exit
2728
#include "opencv2/core/utility.hpp"
2739CV_EXPORTS Mat cvarrToMat(
const
CvArr* arr,
bool
copyData=
false,
2740
bool
allowND=
true,
int
coiMode=0,
2741
AutoBuffer<double>* buf=0);
2743
static
inline
Mat cvarrToMatND(
const
CvArr* arr,
bool
copyData=
false,
int
coiMode=0)
2745
return
cvarrToMat(arr, copyData,
true, coiMode);
2750CV_EXPORTS
void
extractImageCOI(
const
CvArr* arr, OutputArray coiimg,
int
coi=-1);
2752CV_EXPORTS
void
insertImageCOI(InputArray coiimg,
CvArr* arr,
int
coi=-1);
2758
template<>
struct
DefaultDeleter<
CvMat>{ CV_EXPORTS
void
operator ()(
CvMat* obj)
const; };
2759
template<>
struct
DefaultDeleter<
IplImage>{ CV_EXPORTS
void
operator ()(
IplImage* obj)
const; };
2760
template<>
struct
DefaultDeleter<
CvMatND>{ CV_EXPORTS
void
operator ()(
CvMatND* obj)
const; };
2766
template<
typename
_Tp>
class
SeqIterator;
2768
typedef
Ptr<CvMemStorage> MemStorage;
2780
template<
typename
_Tp>
class
Seq
2783
typedef
SeqIterator<_Tp> iterator;
2784
typedef
SeqIterator<_Tp> const_iterator;
2789
Seq(
const
CvSeq* seq);
2791
Seq(MemStorage& storage,
int
headerSize =
sizeof(
CvSeq));
2793
_Tp& operator [](
int
idx);
2795
const
_Tp& operator[](
int
idx)
const;
2797
SeqIterator<_Tp> begin()
const;
2799
SeqIterator<_Tp> end()
const;
2801
size_t
size()
const;
2807
int
channels()
const;
2809
size_t
elemSize()
const;
2811
size_t
index(
const
_Tp& elem)
const;
2813
void
push_back(
const
_Tp& elem);
2815
void
push_front(
const
_Tp& elem);
2817
void
push_back(
const
_Tp* elems,
size_t
count);
2819
void
push_front(
const
_Tp* elems,
size_t
count);
2821
void
insert(
int
idx,
const
_Tp& elem);
2823
void
insert(
int
idx,
const
_Tp* elems,
size_t
count);
2825
void
remove(
int
idx);
2827
void
remove(
const
Range& r);
2832
const
_Tp& front()
const;
2836
const
_Tp& back()
const;
2847
void
pop_front(_Tp* elems,
size_t
count);
2849
void
pop_back(_Tp* elems,
size_t
count);
2852
void
copyTo(std::vector<_Tp>& vec,
const
Range& range=Range::all())
const;
2854
operator
std::vector<_Tp>()
const;
2863
template<
typename
_Tp>
class
SeqIterator :
public
CvSeqReader
2869
SeqIterator(
const
Seq<_Tp>& seq,
bool
seekEnd=
false);
2871
void
seek(
size_t
pos);
2873
size_t
tell()
const;
2877
const
_Tp& operator *()
const;
2879
SeqIterator& operator ++();
2881
SeqIterator operator ++(
int)
const;
2883
SeqIterator& operator --();
2885
SeqIterator operator --(
int)
const;
2888
SeqIterator& operator +=(
int);
2890
SeqIterator& operator -=(
int);
2900CV_EXPORTS schar* seqPush(
CvSeq* seq,
const
void* element=0);
2901CV_EXPORTS schar* seqPushFront(
CvSeq* seq,
const
void* element=0);
2902CV_EXPORTS
void
seqPop(
CvSeq* seq,
void* element=0);
2903CV_EXPORTS
void
seqPopFront(
CvSeq* seq,
void* element=0);
2904CV_EXPORTS
void
seqPopMulti(
CvSeq* seq,
void* elements,
2905
int
count,
int
in_front=0 );
2906CV_EXPORTS
void
seqRemove(
CvSeq* seq,
int
index );
2907CV_EXPORTS
void
clearSeq(
CvSeq* seq );
2908CV_EXPORTS schar* getSeqElem(
const
CvSeq* seq,
int
index );
2909CV_EXPORTS
void
seqRemoveSlice(
CvSeq* seq,
CvSlice
slice );
2910CV_EXPORTS
void
seqInsertSlice(
CvSeq* seq,
int
before_index,
const
CvArr* from_arr );
2912
template<
typename
_Tp>
inline
Seq<_Tp>::Seq() : seq(0) {}
2913
template<
typename
_Tp>
inline
Seq<_Tp>::Seq(
const
CvSeq* _seq ) : seq((
CvSeq*)_seq)
2915
CV_Assert(!_seq || _seq->elem_size ==
sizeof(_Tp));
2918
template<
typename
_Tp>
inline
Seq<_Tp>::Seq( MemStorage& storage,
2922
seq = cvCreateSeq(DataType<_Tp>::type, headerSize,
sizeof(_Tp), storage);
2925
template<
typename
_Tp>
inline
_Tp& Seq<_Tp>::operator [](
int
idx)
2926{
return
*(_Tp*)getSeqElem(seq, idx); }
2928
template<
typename
_Tp>
inline
const
_Tp& Seq<_Tp>::operator [](
int
idx)
const
2929
{
return
*(_Tp*)getSeqElem(seq, idx); }
2931
template<
typename
_Tp>
inline
SeqIterator<_Tp> Seq<_Tp>::begin()
const
2932
{
return
SeqIterator<_Tp>(*
this); }
2934
template<
typename
_Tp>
inline
SeqIterator<_Tp> Seq<_Tp>::end()
const
2935
{
return
SeqIterator<_Tp>(*
this,
true); }
2937
template<
typename
_Tp>
inline
size_t
Seq<_Tp>::size()
const
2938
{
return
seq ? seq->total : 0; }
2940
template<
typename
_Tp>
inline
int
Seq<_Tp>::type()
const
2941
{
return
seq ? CV_MAT_TYPE(seq->flags) : 0; }
2943
template<
typename
_Tp>
inline
int
Seq<_Tp>::depth()
const
2944
{
return
seq ? CV_MAT_DEPTH(seq->flags) : 0; }
2946
template<
typename
_Tp>
inline
int
Seq<_Tp>::channels()
const
2947
{
return
seq ? CV_MAT_CN(seq->flags) : 0; }
2949
template<
typename
_Tp>
inline
size_t
Seq<_Tp>::elemSize()
const
2950
{
return
seq ? seq->elem_size : 0; }
2952
template<
typename
_Tp>
inline
size_t
Seq<_Tp>::index(
const
_Tp& elem)
const
2953
{
return
cvSeqElemIdx(seq, &elem); }
2955
template<
typename
_Tp>
inline
void
Seq<_Tp>::push_back(
const
_Tp& elem)
2956{ cvSeqPush(seq, &elem); }
2958
template<
typename
_Tp>
inline
void
Seq<_Tp>::push_front(
const
_Tp& elem)
2959{ cvSeqPushFront(seq, &elem); }
2961
template<
typename
_Tp>
inline
void
Seq<_Tp>::push_back(
const
_Tp* elem,
size_t
count)
2962{ cvSeqPushMulti(seq, elem, (
int)count, 0); }
2964
template<
typename
_Tp>
inline
void
Seq<_Tp>::push_front(
const
_Tp* elem,
size_t
count)
2965{ cvSeqPushMulti(seq, elem, (
int)count, 1); }
2967
template<
typename
_Tp>
inline
_Tp& Seq<_Tp>::back()
2968{
return
*(_Tp*)getSeqElem(seq, -1); }
2970
template<
typename
_Tp>
inline
const
_Tp& Seq<_Tp>::back()
const
2971
{
return
*(
const
_Tp*)getSeqElem(seq, -1); }
2973
template<
typename
_Tp>
inline
_Tp& Seq<_Tp>::front()
2974{
return
*(_Tp*)getSeqElem(seq, 0); }
2976
template<
typename
_Tp>
inline
const
_Tp& Seq<_Tp>::front()
const
2977
{
return
*(
const
_Tp*)getSeqElem(seq, 0); }
2979
template<
typename
_Tp>
inline
bool
Seq<_Tp>::empty()
const
2980
{
return
!seq || seq->total == 0; }
2982
template<
typename
_Tp>
inline
void
Seq<_Tp>::clear()
2983{
if(seq) clearSeq(seq); }
2985
template<
typename
_Tp>
inline
void
Seq<_Tp>::pop_back()
2988
template<
typename
_Tp>
inline
void
Seq<_Tp>::pop_front()
2989{ seqPopFront(seq); }
2991
template<
typename
_Tp>
inline
void
Seq<_Tp>::pop_back(_Tp* elem,
size_t
count)
2992{ seqPopMulti(seq, elem, (
int)count, 0); }
2994
template<
typename
_Tp>
inline
void
Seq<_Tp>::pop_front(_Tp* elem,
size_t
count)
2995{ seqPopMulti(seq, elem, (
int)count, 1); }
2997
template<
typename
_Tp>
inline
void
Seq<_Tp>::insert(
int
idx,
const
_Tp& elem)
2998{ seqInsert(seq, idx, &elem); }
3000
template<
typename
_Tp>
inline
void
Seq<_Tp>::insert(
int
idx,
const
_Tp* elems,
size_t
count)
3002
CvMat
m =
cvMat(1, count, DataType<_Tp>::type, elems);
3003
seqInsertSlice(seq, idx, &m);
3006
template<
typename
_Tp>
inline
void
Seq<_Tp>::remove(
int
idx)
3007{ seqRemove(seq, idx); }
3009
template<
typename
_Tp>
inline
void
Seq<_Tp>::remove(
const
Range& r)
3010{ seqRemoveSlice(seq, cvSlice(r.start, r.end)); }
3012
template<
typename
_Tp>
inline
void
Seq<_Tp>::copyTo(std::vector<_Tp>& vec,
const
Range& range)
const
3014
size_t
len = !seq ? 0 : range == Range::all() ? seq->total : range.end - range.start;
3017
cvCvtSeqToArray(seq, &vec[0], cvSlice(range));
3020
template<
typename
_Tp>
inline
Seq<_Tp>::operator std::vector<_Tp>()
const
3022
std::vector<_Tp> vec;
3027
template<
typename
_Tp>
inline
SeqIterator<_Tp>::SeqIterator()
3028{ memset(
this, 0,
sizeof(*
this)); }
3030
template<
typename
_Tp>
inline
SeqIterator<_Tp>::SeqIterator(
const
Seq<_Tp>& _seq,
bool
seekEnd)
3032
cvStartReadSeq(_seq.seq,
this);
3033
index = seekEnd ? _seq.seq->total : 0;
3036
template<
typename
_Tp>
inline
void
SeqIterator<_Tp>::seek(
size_t
pos)
3038
cvSetSeqReaderPos(
this, (
int)pos,
false);
3042
template<
typename
_Tp>
inline
size_t
SeqIterator<_Tp>::tell()
const
3046{
return
*(_Tp*)ptr; }
3049
{
return
*(
const
_Tp*)ptr; }
3051
template<
typename
_Tp>
inline
SeqIterator<_Tp>& SeqIterator<_Tp>::operator ++()
3054
if( ++index >= seq->total*2 )
3059
template<
typename
_Tp>
inline
SeqIterator<_Tp> SeqIterator<_Tp>::operator ++(
int)
const
3061
SeqIterator<_Tp> it = *
this;
3066
template<
typename
_Tp>
inline
SeqIterator<_Tp>& SeqIterator<_Tp>::operator --()
3070
index = seq->total*2-1;
3074
template<
typename
_Tp>
inline
SeqIterator<_Tp> SeqIterator<_Tp>::operator --(
int)
const
3076
SeqIterator<_Tp> it = *
this;
3081
template<
typename
_Tp>
inline
SeqIterator<_Tp>& SeqIterator<_Tp>::operator +=(
int
delta)
3083
cvSetSeqReaderPos(
this, delta, 1);
3085
int
n = seq->total*2;
3093
template<
typename
_Tp>
inline
SeqIterator<_Tp>& SeqIterator<_Tp>::operator -=(
int
delta)
3095
return
(*
this
+= -delta);
3098
template<
typename
_Tp>
inline
ptrdiff_t
operator -
(
const
SeqIterator<_Tp>& a,
3099
const
SeqIterator<_Tp>& b)
3101
ptrdiff_t delta = a.index - b.index, n = a.seq->total;
3102
if( delta > n || delta < -n )
3103
delta += delta < 0 ? n : -n;
3107
template<
typename
_Tp>
inline
bool
operator == (
const
SeqIterator<_Tp>& a,
3108
const
SeqIterator<_Tp>& b)
3110
return
a.seq == b.seq && a.index == b.index;
3113
template<
typename
_Tp>
inline
bool
operator != (
const
SeqIterator<_Tp>& a,
3114
const
SeqIterator<_Tp>& b)
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...
CV_INLINE CvMat cvMat(int rows, int cols, int type, void *data CV_DEFAULT(NULL))
Definition:
core/types_c.h:551
int(CV_CDECL * CvCmpFunc)(const void *a, const void *b, void *userdata)
Definition:
core_c.h:1706
CV_INLINE void cvSetRemoveByPtr(CvSet *set_header, void *elem)
Definition:
core_c.h:1752
CV_INLINE void cvSubS(const CvArr *src, CvScalar value, CvArr *dst, const CvArr *mask CV_DEFAULT(NULL))
Definition:
core_c.h:1062
CV_INLINE CvSetElem * cvGetSetElem(const CvSet *set_header, int idx)
Definition:
core_c.h:1767
CV_INLINE int cvIncRefData(CvArr *arr)
Increments array data reference counter.
Definition:
core_c.h:324
CV_INLINE CvMat * cvGetCol(const CvArr *arr, CvMat *submat, int col)
Definition:
core_c.h:406
CV_INLINE void cvReleaseMatND(CvMatND **mat)
Deallocates a multi-dimensional array.
Definition:
core_c.h:475
CVAPI(void *) cvAlloc(size_t size)
Changes the shape of a multi-dimensional array without copying the data.
CV_INLINE void cvDecRefData(CvArr *arr)
Decrements an array data reference counter.
Definition:
core_c.h:298
CV_INLINE CvSparseNode * cvGetNextSparseNode(CvSparseMatIterator *mat_iterator)
Returns the next sparse matrix element
Definition:
core_c.h:542
CV_INLINE CvMat * cvGetRow(const CvArr *arr, CvMat *submat, int row)
Definition:
core_c.h:380
#define CV_PREV_SEQ_ELEM(elem_size, reader)
Definition:
core/types_c.h:1931
struct CvNArrayIterator CvNArrayIterator
#define CV_NEXT_SEQ_ELEM(elem_size, reader)
Definition:
core/types_c.h:1921
void CvArr
This is the "metatype" used only as a function parameter.
Definition:
core/types_c.h:139
CV_INLINE CvSetElem * cvSetNew(CvSet *set_header)
Definition:
core_c.h:1737
#define CV_IS_SET_ELEM(ptr)
Definition:
core/types_c.h:1614
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-(const v_reg< _Tp, n > &a, const v_reg< _Tp, n > &b)
Subtract values
CV_INLINE int cvRound(double value)
Rounds floating-point number to the nearest integer
Definition:
fast_math.hpp:200
#define CV_Assert(expr)
Checks a condition at runtime and throws exception if it fails
Definition:
base.hpp:342
"black box" representation of the file storage associated with a file on disk.
Definition:
aruco.hpp:75
Definition:
core/types_c.h:328
Definition:
core/types_c.h:383
Definition:
core/types_c.h:1651
Definition:
core/types_c.h:1678
Definition:
core_c.h:1861
Definition:
core/types_c.h:1657
Definition:
core/types_c.h:469
Definition:
core/types_c.h:690
Definition:
core/types_c.h:1498
Definition:
core/types_c.h:1514
int stack[CV_MAX_DIM]
Definition:
core_c.h:572
CvSize size
Definition:
core_c.h:570
int count
Definition:
core_c.h:568
int dims
Definition:
core_c.h:569
CvMatND * hdr[CV_MAX_ARR]
Definition:
core_c.h:573
uchar * ptr[CV_MAX_ARR]
Definition:
core_c.h:571
Definition:
core/types_c.h:951
Definition:
core/types_c.h:848
Definition:
core/types_c.h:1383
Definition:
core/types_c.h:1524
Definition:
core/types_c.h:1574
Definition:
core/types_c.h:1877
Definition:
core/types_c.h:1852
Definition:
core/types_c.h:1593
Definition:
core/types_c.h:1604
Definition:
core/types_c.h:1174
Definition:
core/types_c.h:1337
Definition:
core/types_c.h:747
Definition:
core/types_c.h:787
Definition:
core/types_c.h:780
Definition:
core/types_c.h:918
Definition:
core_c.h:1895