⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 cvtest.h

📁 微软的基于HMM的人脸识别原代码, 非常经典的说
💻 H
📖 第 1 页 / 共 2 页
字号:
                    double* _min_val, double* _max_val,
                    CvPoint* _min_loc, CvPoint* _max_loc,
                    int* _non_zero, double* _sum,
                    double* _mean, double* _sdv,
                    double* _c_norm, double* _l1_norm, double* _l2_norm,
                    int* _mask_pix );

int       atsCannyStatistics(uchar* src,
                             CvSize roi,
                             int srcStep,
                             uchar* dst,
                             int dstStep,
                             int Sobord,
                             float lowThreshold,
                             float highThreshold,
                             int* zero_mag,
                             int* under_low,
                             int* above_high,
                             int* edges_in_nms,
                             int* components,
                             int* in_edges);


typedef struct
{
    /* spatial moments */
    double  m00;
    double  m10, m01;
    double  m20, m11, m02;
    double  m30, m21, m12, m03;

    /* central moments */
    double  mu20, mu11, mu02;
    double  mu30, mu21, mu12, mu03;

    /* normalized central moments */
    double  nu20, nu11, nu02;
    double  nu30, nu21, nu12, nu03;
}
AtsMomentState;


/*
  Function calculates spatial and central moments up to third order.
  <binary> mode means that pixels values treated as 1 if they are non zero and 0 if zero.
*/
void    atsCalcMoments( IplImage* img, AtsMomentState* state, int binary );

/*
  Convert internal representation to explicit form
*/
void  atsGetMoments( CvMoments* istate, AtsMomentState* astate );

/* calculates  sum (imgA(x,y) - deltaA)*(imgB(x,y) - deltaB) */
double atsCrossCorr( IplImage* imgA, IplImage* imgB, double deltaA, double deltaB );

/* creates contour which consist of convex hull vertices */
/* hull is CvSeq<CvPoint*>                               */
CvSeq* atsCvtHullToContour( CvSeq* hull, CvMemStorage* storage );


/******************************************************************************/
/*                                 Drawing                                    */
/******************************************************************************/

/* The function draws line in 8uC1/C3 image */
void  atsDrawLine( IplImage* img, float x1, float y1, float x2, float y2, int color );

/* The function draws ellipse arc in 8uC1/C3 image */
void  atsDrawEllipse( IplImage* img, float xc, float yc, float a, float b,
                      float angle, float arc0, float arc1, int color );

/* The function draws conic arc in 8uC1/C3 image */
void  atsDrawConic( IplImage* img, float xc, float yc, float mag, float e,
                    float angle, float arc0, float arc1, int color );

int   atsCalcQuadricCoeffs( double xc, double yc, double mag, double e,
                            double angle, double arc0, double arc1,
                            double* A, double* B, double* C, double* D, double* E,
                            CvPoint* pt1, CvPoint* pt2 );

/* make zero border in the image */
void  atsClearBorder( IplImage* img );

/* fills an 8uC1 image with blobs - rotated ellipses */
void  atsGenerateBlobImage( IplImage* img, int min_blob_size, int max_blob_size,
                            int blob_count, int min_brightness, int max_brightness,
                            AtsRandState* rng_state );

/******************************************************************************/
/*                             Display routines                               */ 
/******************************************************************************/

int   atsCreateWindow( const char* name, CvPoint wnd_org, CvSize wnd_size );
void  atsDisplayImage( IplImage* img, int window, CvPoint dst_org, CvSize dst_size );
void  atsDestroyWindow( int window );

/******************************************************************************/
/*                     Reading images from file                               */
/******************************************************************************/

/* Reads image from the disk and creates IplImage from it */  
IplImage* atsCreateImageFromFile( const char* filename );


/******************************************************************************/
/*                     Helper contour processing functions                    */
/******************************************************************************/

CvSeq* atsCreateRandomContours( IplImage* img, CvMemStorage* storage,
                                CvContourRetrievalMode mode,
                                CvChainApproxMethod approx,
                                AtsRandState* rng_state );

/******************************************************************************/
/*                                 Set of contours                            */
/******************************************************************************/

typedef CvSeq* ( *Contour )( CvMemStorage* storage );

/******************************************************************************/
/*                                 Defines                                    */
/******************************************************************************/

#define ATS_SWAP( a, b, temp )  ((temp) = (a), (a) = (b), (b) = temp)
#define ATS_RANGE( x, a, b )  ((a) <= (x) && (x) < (b))

/* min & max without jumps */
#define ATS_MIN(a, b)  ((a) ^ (((a)^(b)) & (((a) < (b)) - 1)))
#define ATS_MAX(a, b)  ((a) ^ (((a)^(b)) & (((a) > (b)) - 1)))

/* Converts float to 2-complement representation for integer comparing */
#define ATS_TOGGLE_FLT(x)  (((x)&0x7fffffff)^(((int)(x))>>31))

#define ATS_DIM(a)         (sizeof(a)/sizeof((a)[0]))


/* Increases the <value> by adding or multiplying by the <delta> */
#define ATS_INCREASE( value, delta_type, delta ) \
    ((value) = (delta_type) == 0 ? (value)+(delta) : (value)*(delta))


#ifdef WIN32
#define ATS_TIC_MAX  0x7fffffffffffffffI64
#else
#define ATS_TIC_MAX  0x7fffffffffffffffLL
#endif

#define ATS_START_TIMING() int64 temp = atsGetTickCount();
#define ATS_END_TIMING()   temp = atsGetTickCount() - temp; tics = ATS_MIN( tics, temp );

#define ATS_MEASURE( act ) \
    ATS_START_TIMING()     \
    (act);                 \
    ATS_END_TIMING()


/* patch */
typedef enum {
   cv1u,
   cv8u, cv8s,
   cv16u, cv16s, cv16sc,
   cv32u, cv32s, cv32sc,
   cv32f, cv32fc,
   cv64u, cv64s, cv64sc,
   cv64f, cv64fc
} CvDataType;

#define _CV_C            1
#define _CV_L1           2
#define _CV_L2           4
#define _CV_RELATIVE     8

#define _CV_RELATIVE_C   (_CV_RELATIVE | _CV_C)
#define _CV_RELATIVE_L1  (_CV_RELATIVE | _CV_L1)
#define _CV_RELATIVE_L2  (_CV_RELATIVE | _CV_L2)

#define _CV_DIFF        16

#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_ORIGIN_TL  0
#define CV_ORIGIN_BL  1

void* icvAlloc_( int lSize );
void  icvFree_( void** ptr );

void* _dbgAlloc_( int size, const char* file, int line);
void  _dbgFree_( void** pptr,const char* file, int line);

#define icvAlloc( size ) icvAlloc_( size )
#define icvFree( ptr ) icvFree_( (void**)(ptr) )


#ifdef __cplusplus
}
#endif



/* End of file. */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -