ats.h

来自「微软的基于HMM的人脸识别原代码, 非常经典的说」· C头文件 代码 · 共 532 行 · 第 1/2 页

H
532
字号
/*M///////////////////////////////////////////////////////////////////////////////////////
//
//                      INTEL CORPORATION PROPRIETARY INFORMATION
//         This software is supplied under the terms of a license agreement or
//         nondisclosure agreement with Intel Corporation and may not be copied
//         or disclosed except in accordance with the terms of that agreement.
//               Copyright (c) 1999 Intel Corporation. All Rights Reserved.
//
//    RCS:
//       $Source:   ats.h$
//       $Revision: 00.00.05$
//      Purpose:
//      Contents:
//      Authors:
//        Sergey Oblomov
//        Vadim Pisarevsky
//
//M*/

#ifndef _ATS_H_
#define _ATS_H_

#include <stdlib.h>
#include <stdio.h>
#include <time.h>
#include <math.h>
#include <string.h>

#include "trsapi.h"
#include "assert.h"

#include "cv.h"

/*#include "ippdefs.h"*/
/*#include "optcv.h"*/

#ifdef __cplusplus
extern "C"{
#endif

typedef unsigned char       uchar;
typedef unsigned short      ushort;

/* define 64-bit integers */
#if _MSC_VER > 1000
    typedef __int64 int64;
#else
    typedef long long int64;
#endif


/****************************************************************************************/
/*                              Warnings Disabling                                      */
/****************************************************************************************/
#pragma warning(disable : 4514) /* unreferenced inline function has been */
                                /* removed                               */
#pragma warning(disable : 4127) /* conditional expression is constant    */
                                /* for no warnings in _ASSERT            */

/****************************************************************************************/
/*                              Finctions declaration                                   */
/****************************************************************************************/


/*F-------------------------------------------------------------------------------------*/
/*    Name:    atsInitRandom                                                            */
/*    Purpose:                                                                          */
/*      Initialazing by randomize value                                                 */
/*    Context:                                                                          */
/*    Parameters:                                                                       */
/*      Min - minimal bound                                                             */
/*      Max - maximum bound                                                             */
/*    Returns:                                                                          */
/*    Notes:                                                                            */
/*F-------------------------------------------------------------------------------------*/
double atsInitRandom( double Min, double Max );


/*F///////////////////////////////////////////////////////////////////////////////////////
//    Name:    ats1bInitRandom
//    Purpose:
//      Initialazing unsigned char array by randomize value
//    Context:
//    Parameters:
//      Min  - minimal bound
//      Max  - maximum bound
//      pDst - destination array
//      lLen - size of array
//    Returns:
//    Notes:
//F*/
void ats1bInitRandom( double Min, double Max, unsigned char* pDst, long lLen );


/*F///////////////////////////////////////////////////////////////////////////////////////
//    Name:    ats1cInitRandom
//    Purpose:
//      Initialazing unsigned char array by randomize value
//    Context:
//    Parameters:
//      Min  - minimal bound
//      Max  - maximum bound
//      pDst - destination array
//      lLen - size of array
//    Returns:
//    Notes:
//F*/
void ats1cInitRandom( double Min, double Max, char* pDst, long lLen );


/*F///////////////////////////////////////////////////////////////////////////////////////
//    Name:    ats1iInitRandom
//    Purpose:
//      Initialazing unsigned char array by randomize value
//    Context:
//    Parameters:
//      Min  - minimal bound
//      Max  - maximum bound
//      pDst - destination array
//      lLen - size of array
//    Returns:
//    Notes:
//F*/
void ats1iInitRandom( double Min, double Max, int* pDst, long lLen );


/*F///////////////////////////////////////////////////////////////////////////////////////
//    Name:    ats1flInitRandom
//    Purpose:
//      Initialazing unsigned char array by randomize value
//    Context:
//    Parameters:
//      Min  - minimal bound
//      Max  - maximum bound
//      pDst - destination array
//      lLen - size of array
//    Returns:
//    Notes:
//F*/
void ats1flInitRandom( double Min, double Max, float* pDst, long lLen );


/*F///////////////////////////////////////////////////////////////////////////////////////
//    Name:    ats1flInitGradRandom
//    Purpose:
//      Initialazing unsigned char array by randomize value
//    Context:
//    Parameters:
//      Min  - minimal bound
//      Max  - maximum bound
//      pDst - destination array
//      lLen - size of array
//    Returns:
//    Notes:
//F*/
void ats1flInitGradRandom( double Min, double Max, float* pDst, long lLen );


/*F///////////////////////////////////////////////////////////////////////////////////////
//    Name:    atsbInitEllipse
//    Purpose: filling the source 2D array by constant value
//    Context:
//    Parameters:
//      Src - source array
//      width - width of source array
//      height - height of source array
//      step - width step
//      x, y - center of ellipse
//      major - major axis of ellipse
//      minor - minor axis of ellipse
//      orientation - orientation of ellipse
//      value - the constant value which will be set within elipse
//    Returns:
//    Notes:
//      orientation is the angle from horisontal clockwise
//F*/
void atsbInitEllipse( uchar* Src,
                      int    width,
                      int    height,
                      int    step,
                      int    x,
                      int    y,
                      int    major,
                      int    minor,
                      float  orientation,
                      uchar  value );


/*F///////////////////////////////////////////////////////////////////////////////////////
//    Name:    atsfInitEllipse
//    Purpose: filling the source 2D array by constant value
//    Context:
//    Parameters:
//      Src - source array
//      width - width of source array
//      height - height of source array
//      step - width step
//      x, y - center of ellipse
//      major - major axis of ellipse
//      minor - minor axis of ellipse
//      orientation - orientation of ellipse
//      value - the constant value which will be set within elipse
//    Returns:
//    Notes:
//      orientation is the angle from horisontal clockwise
//F*/
void atsfInitEllipse( float* Src,
                      int    width,
                      int    height,
                      int    step,
                      int    x,
                      int    y,
                      int    major,
                      int    minor,
                      float  orientation,
                      float  value );

/*F///////////////////////////////////////////////////////////////////////////////////////
//    Name:    atsCompSingle
//    Purpose:                                                                  
//      Detailed Comparing two float values      
//    Context:                                                                  
//    Parameters:                                                               
//      flFirst - first value                                               
//      flSecond- second value                                             
//      dbAcc - accuracy                                     
//                                                 
//    Returns:                                                                  
//      1 if not equal 
//      0 if equal                                           
//    Notes:                                                                    
//F*/
long atsCompSingle(float flFirst,
                   float flSecond,
                   double dbAcc);
/*F///////////////////////////////////////////////////////////////////////////////////////
//    Name:    atsCompSinglePrec
//    Purpose:
//      Detailed Comparing two float arrays
//    Context:
//    Parameters:
//      flFirstArray - first array
//      flSecondArray - second array
//      lLen       - lenght of this arrays
//      dbAcc      - precision
//    Returns:
//      Number of nonequal elements
//    Notes:
//F*/
long atsCompSinglePrec(float* flFirstArray, float* flSecondArray, long lLen, double dbAcc);
/*F///////////////////////////////////////////////////////////////////////////////////////
//    Name:    atsCompDoublePrec
//    Purpose:                                                                  
//      Detailed Comparing two double arrays      
//    Context:                                                                  
//    Parameters:                                                               
//      flFirstArray - first array                                               
//      flSecondArray - second array                                             
//      lLen       - lenght of this arrays                                      
//                                                 
//    Returns:                                                                  
//      Number of nonequal elements                                           
//    Notes:                                                                    
//F*/
long atsCompDoublePrec(double* flFirstArray,
                       double* flSecondArray,

⌨️ 快捷键说明

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