?? cxcore.h
字號:
CVAPI(void) cvCartToPolar( const CvArr* x, const CvArr* y, CvArr* magnitude, CvArr* angle CV_DEFAULT(NULL), int angle_in_degrees CV_DEFAULT(0));/* Does polar->cartesian coordinates conversion. Either of output components (magnitude or angle) is optional. If magnitude is missing it is assumed to be all 1's */CVAPI(void) cvPolarToCart( const CvArr* magnitude, const CvArr* angle, CvArr* x, CvArr* y, int angle_in_degrees CV_DEFAULT(0));/* Does powering: dst(idx) = src(idx)^power */CVAPI(void) cvPow( const CvArr* src, CvArr* dst, double power );/* Does exponention: dst(idx) = exp(src(idx)). Overflow is not handled yet. Underflow is handled. Maximal relative error is ~7e-6 for single-precision input */CVAPI(void) cvExp( const CvArr* src, CvArr* dst );/* Calculates natural logarithms: dst(idx) = log(abs(src(idx))). Logarithm of 0 gives large negative number(~-700) Maximal relative error is ~3e-7 for single-precision output*/CVAPI(void) cvLog( const CvArr* src, CvArr* dst );/* Fast arctangent calculation */CVAPI(float) cvFastArctan( float y, float x );/* Fast cubic root calculation */CVAPI(float) cvCbrt( float value );/* Checks array values for NaNs, Infs or simply for too large numbers (if CV_CHECK_RANGE is set). If CV_CHECK_QUIET is set, no runtime errors is raised (function returns zero value in case of "bad" values). Otherwise cvError is called */ #define CV_CHECK_RANGE 1#define CV_CHECK_QUIET 2CVAPI(int) cvCheckArr( const CvArr* arr, int flags CV_DEFAULT(0), double min_val CV_DEFAULT(0), double max_val CV_DEFAULT(0));#define cvCheckArray cvCheckArr/* Finds real roots of a cubic equation */CVAPI(int) cvSolveCubic( const CvMat* coeffs, CvMat* roots );/****************************************************************************************\* Matrix operations *\****************************************************************************************//* Calculates cross product of two 3d vectors */CVAPI(void) cvCrossProduct( const CvArr* src1, const CvArr* src2, CvArr* dst );/* Matrix transform: dst = A*B + C, C is optional */#define cvMatMulAdd( src1, src2, src3, dst ) cvGEMM( (src1), (src2), 1., (src3), 1., (dst), 0 )#define cvMatMul( src1, src2, dst ) cvMatMulAdd( (src1), (src2), NULL, (dst))#define CV_GEMM_A_T 1#define CV_GEMM_B_T 2#define CV_GEMM_C_T 4/* Extended matrix transform: dst = alpha*op(A)*op(B) + beta*op(C), where op(X) is X or X^T */CVAPI(void) cvGEMM( const CvArr* src1, const CvArr* src2, double alpha, const CvArr* src3, double beta, CvArr* dst, int tABC CV_DEFAULT(0));#define cvMatMulAddEx cvGEMM/* Transforms each element of source array and stores resultant vectors in destination array */CVAPI(void) cvTransform( const CvArr* src, CvArr* dst, const CvMat* transmat, const CvMat* shiftvec CV_DEFAULT(NULL));#define cvMatMulAddS cvTransform/* Does perspective transform on every element of input array */CVAPI(void) cvPerspectiveTransform( const CvArr* src, CvArr* dst, const CvMat* mat );/* Calculates (A-delta)*(A-delta)^T (order=0) or (A-delta)^T*(A-delta) (order=1) */CVAPI(void) cvMulTransposed( const CvArr* src, CvArr* dst, int order, const CvArr* delta CV_DEFAULT(NULL), double scale CV_DEFAULT(1.) );/* Tranposes matrix. Square matrices can be transposed in-place */CVAPI(void) cvTranspose( const CvArr* src, CvArr* dst );#define cvT cvTranspose/* Mirror array data around horizontal (flip=0), vertical (flip=1) or both(flip=-1) axises: cvFlip(src) flips images vertically and sequences horizontally (inplace) */CVAPI(void) cvFlip( const CvArr* src, CvArr* dst CV_DEFAULT(NULL), int flip_mode CV_DEFAULT(0));#define cvMirror cvFlip#define CV_SVD_MODIFY_A 1#define CV_SVD_U_T 2#define CV_SVD_V_T 4/* Performs Singular Value Decomposition of a matrix */CVAPI(void) cvSVD( CvArr* A, CvArr* W, CvArr* U CV_DEFAULT(NULL), CvArr* V CV_DEFAULT(NULL), int flags CV_DEFAULT(0));/* Performs Singular Value Back Substitution (solves A*X = B): flags must be the same as in cvSVD */CVAPI(void) cvSVBkSb( const CvArr* W, const CvArr* U, const CvArr* V, const CvArr* B, CvArr* X, int flags );#define CV_LU 0#define CV_SVD 1#define CV_SVD_SYM 2/* Inverts matrix */CVAPI(double) cvInvert( const CvArr* src, CvArr* dst, int method CV_DEFAULT(CV_LU));#define cvInv cvInvert/* Solves linear system (src1)*(dst) = (src2) (returns 0 if src1 is a singular and CV_LU method is used) */CVAPI(int) cvSolve( const CvArr* src1, const CvArr* src2, CvArr* dst, int method CV_DEFAULT(CV_LU));/* Calculates determinant of input matrix */CVAPI(double) cvDet( const CvArr* mat );/* Calculates trace of the matrix (sum of elements on the main diagonal) */CVAPI(CvScalar) cvTrace( const CvArr* mat );/* Finds eigen values and vectors of a symmetric matrix */CVAPI(void) cvEigenVV( CvArr* mat, CvArr* evects, CvArr* evals, double eps CV_DEFAULT(0));/* Makes an identity matrix (mat_ij = i == j) */CVAPI(void) cvSetIdentity( CvArr* mat, CvScalar value CV_DEFAULT(cvRealScalar(1)) );/* Fills matrix with given range of numbers */CVAPI(CvArr*) cvRange( CvArr* mat, double start, double end );/* Calculates covariation matrix for a set of vectors *//* transpose([v1-avg, v2-avg,...]) * [v1-avg,v2-avg,...] */#define CV_COVAR_SCRAMBLED 0/* [v1-avg, v2-avg,...] * transpose([v1-avg,v2-avg,...]) */#define CV_COVAR_NORMAL 1/* do not calc average (i.e. mean vector) - use the input vector instead (useful for calculating covariance matrix by parts) */#define CV_COVAR_USE_AVG 2/* scale the covariance matrix coefficients by number of the vectors */#define CV_COVAR_SCALE 4/* all the input vectors are stored in a single matrix, as its rows */#define CV_COVAR_ROWS 8/* all the input vectors are stored in a single matrix, as its columns */#define CV_COVAR_COLS 16CVAPI(void) cvCalcCovarMatrix( const CvArr** vects, int count, CvArr* cov_mat, CvArr* avg, int flags );#define CV_PCA_DATA_AS_ROW 0 #define CV_PCA_DATA_AS_COL 1#define CV_PCA_USE_AVG 2CVAPI(void) cvCalcPCA( const CvArr* data, CvArr* mean, CvArr* eigenvals, CvArr* eigenvects, int flags );CVAPI(void) cvProjectPCA( const CvArr* data, const CvArr* mean, const CvArr* eigenvects, CvArr* result );CVAPI(void) cvBackProjectPCA( const CvArr* proj, const CvArr* mean, const CvArr* eigenvects, CvArr* result );/* Calculates Mahalanobis(weighted) distance */CVAPI(double) cvMahalanobis( const CvArr* vec1, const CvArr* vec2, CvArr* mat );#define cvMahalonobis cvMahalanobis/****************************************************************************************\* Array Statistics *\****************************************************************************************//* Finds sum of array elements */CVAPI(CvScalar) cvSum( const CvArr* arr );/* Calculates number of non-zero pixels */CVAPI(int) cvCountNonZero( const CvArr* arr );/* Calculates mean value of array elements */CVAPI(CvScalar) cvAvg( const CvArr* arr, const CvArr* mask CV_DEFAULT(NULL) );/* Calculates mean and standard deviation of pixel values */CVAPI(void) cvAvgSdv( const CvArr* arr, CvScalar* mean, CvScalar* std_dev, const CvArr* mask CV_DEFAULT(NULL) );/* Finds global minimum, maximum and their positions */CVAPI(void) cvMinMaxLoc( const CvArr* arr, double* min_val, double* max_val, CvPoint* min_loc CV_DEFAULT(NULL), CvPoint* max_loc CV_DEFAULT(NULL), const CvArr* mask CV_DEFAULT(NULL) );/* types of array norm */#define CV_C 1#define CV_L1 2#define CV_L2 4#define CV_NORM_MASK 7#define CV_RELATIVE 8#define CV_DIFF 16#define CV_MINMAX 32#define CV_DIFF_C (CV_DIFF | CV_C)#define CV_DIFF_L1 (CV_DIFF | CV_L1)#define CV_DIFF_L2 (CV_DIFF | CV_L2)#define CV_RELATIVE_C (CV_RELATIVE | CV_C)#define CV_RELATIVE_L1 (CV_RELATIVE | CV_L1)#define CV_RELATIVE_L2 (CV_RELATIVE | CV_L2)/* Finds norm, difference norm or relative difference norm for an array (or two arrays) */CVAPI(double) cvNorm( const CvArr* arr1, const CvArr* arr2 CV_DEFAULT(NULL), int norm_type CV_DEFAULT(CV_L2), const CvArr* mask CV_DEFAULT(NULL) );CVAPI(void) cvNormalize( const CvArr* src, CvArr* dst, double a CV_DEFAULT(1.), double b CV_DEFAULT(0.), int norm_type CV_DEFAULT(CV_L2), const CvArr* mask CV_DEFAULT(NULL) );#define CV_REDUCE_SUM 0#define CV_REDUCE_AVG 1#define CV_REDUCE_MAX 2#define CV_REDUCE_MIN 3CVAPI(void) cvReduce( const CvArr* src, CvArr* dst, int dim CV_DEFAULT(-1), int op CV_DEFAULT(CV_REDUCE_SUM) );/****************************************************************************************\* Discrete Linear Transforms and Related Functions *\****************************************************************************************/#define CV_DXT_FORWARD 0#define CV_DXT_INVERSE 1#define CV_DXT_SCALE 2 /* divide result by size of array */#define CV_DXT_INV_SCALE (CV_DXT_INVERSE + CV_DXT_SCALE)#define CV_DXT_INVERSE_SCALE CV_DXT_INV_SCALE#define CV_DXT_ROWS 4 /* transform each row individually */#define CV_DXT_MUL_CONJ 8 /* conjugate the second argument of cvMulSpectrums *//* Discrete Fourier Transform: complex->complex, real->ccs (forward), ccs->real (inverse) */CVAPI(void) cvDFT( const CvArr* src, CvArr* dst, int flags, int nonzero_rows CV_DEFAULT(0) );#define cvFFT cvDFT/* Multiply results of DFTs: DFT(X)*DFT(Y) or DFT(X)*conj(DFT(Y)) */CVAPI(void) cvMulSpectrums( const CvArr* src1, const CvArr* src2, CvArr* dst, int flags );/* Finds optimal DFT vector size >= size0 */CVAPI(int) cvGetOptimalDFTSize( int size0 );/* Discrete Cosine Transform */CVAPI(void) cvDCT( const CvArr* src, CvArr* dst, int flags );/****************************************************************************************\* Dynamic data structures *\****************************************************************************************//* Calculates length of sequence slice (with support of negative indices). */CVAPI(int) cvSliceLength( CvSlice slice, const CvSeq* seq );/* Creates new memory storage. block_size == 0 means that default, somewhat optimal size, is used (currently, it is 64K) */CVAPI(CvMemStorage*) cvCreateMemStorage( int block_size CV_DEFAULT(0));/* Creates a memory storage that will borrow memory blocks from parent storage */CVAPI(CvMemStorage*) cvCreateChildMemStorage( CvMemStorage* parent );/* Releases memory storage. All the children of a parent must be released before the parent. A child storage returns all the blocks to parent when it is released */CVAPI(void) cvReleaseMemStorage( CvMemStorage** storage );/* Clears memory storage. This is the only way(!!!) (besides cvRestoreMemStoragePos) to reuse memory allocated for the storage - cvClearSeq,cvClearSet ... do not free any memory. A child storage returns all the blocks to the parent when it is cleared */CVAPI(void) cvClearMemStorage( CvMemStorage* storage );/* Remember a storage "free memory" position */CVAPI(void) cvSaveMemStoragePos( const CvMemStorage* storage, CvMemStoragePos* pos );/* Restore a storage "free memory" position */CVAPI(void) cvRestoreMemStoragePos( CvMemStorage* storage, CvMemStoragePos* pos );/* Allocates continuous buffer of the specified size in the storage */CVAPI(void*) cvMemStorageAlloc( CvMemStorage* storage, size_t size );/* Allocates string in memory storage */CVAPI(CvString) cvMemStorageAllocString( CvMemStorage* storage, const char* ptr, int len CV_DEFAULT(-1) );/* Creates new empty sequence that will reside in the specified storage */CVAPI(CvSeq*) cvCreateSeq( int seq_flags, int header_size, int elem_size, CvMemStorage* storage );
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -