You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
119 lines
4.7 KiB
119 lines
4.7 KiB
#pragma once
|
|
|
|
enum ERR_DOT_TYPE_ENUM
|
|
{
|
|
ERR_TYPE_1, //
|
|
ERR_TYPE_2, //
|
|
ERR_TYPE_3, //
|
|
ERR_TYPE_4, //
|
|
ERR_TYPE_COUNT,
|
|
};
|
|
|
|
//-----------------------sxg added
|
|
#define _MAX_ERROR_SCAN_LINE_PER_ROW 200
|
|
#define _MAX_ERROR_DOT_BLOB 200
|
|
#define _MAX_MACRO_COUNT 4
|
|
|
|
#define _MAX_ERR_CLASS ERR_TYPE_COUNT
|
|
|
|
typedef struct ERROR_DOTS_SCAN_DATA
|
|
{
|
|
unsigned short x, count;
|
|
unsigned short minx, miny;
|
|
unsigned short maxx, maxy;
|
|
int area, energy;
|
|
int xposSum, yposSum;
|
|
int macro;
|
|
int type;
|
|
int ErrClass[_MAX_ERR_CLASS];
|
|
} ERROR_DOTS_SCAN_DATA;
|
|
|
|
typedef struct ERROR_DOTS_SCAN_ROW
|
|
{
|
|
int scanCount;
|
|
ERROR_DOTS_SCAN_DATA errorScanLineTab[_MAX_ERROR_SCAN_LINE_PER_ROW];
|
|
int macro[_MAX_MACRO_COUNT];
|
|
int ErrClass[_MAX_ERR_CLASS];
|
|
} ERROR_DOTS_SCAN_ROW;
|
|
|
|
typedef struct ERROR_DOTS_BLOB_DATA
|
|
{
|
|
unsigned short x, y;
|
|
unsigned short minx, miny;
|
|
unsigned short maxx, maxy;
|
|
int area;
|
|
int energy;
|
|
float JudgArea;
|
|
float minMeanValue;
|
|
int whiteError;
|
|
int minValue;
|
|
int macro[_MAX_MACRO_COUNT];
|
|
int ErrClass[_MAX_ERR_CLASS];
|
|
int ErrDesc;
|
|
int ErrType;
|
|
int UserErrorType;
|
|
float grayDis;
|
|
float bigMeanValue;
|
|
} ERROR_DOTS_BLOB_DATA;
|
|
|
|
typedef struct ERROR_DOTS_BLOBS
|
|
{
|
|
int blobCount;
|
|
int totalArea;
|
|
int totalEnergy;
|
|
ERROR_DOTS_BLOB_DATA blobTab[_MAX_ERROR_DOT_BLOB];
|
|
int ErrClass[_MAX_ERR_CLASS];
|
|
int Pass[_MAX_ERROR_DOT_BLOB];
|
|
} ERROR_DOTS_BLOBS;
|
|
|
|
typedef struct ERROR_DOTS_BLOB_PARAM
|
|
{
|
|
int minArea; // ²ÐµãÇøÓòÃæ»ý×îСֵ£¬µ¥Î»ÎªÏñËØµã£¬Èç¹ûСÓÚ´ËÖµ£¬ÔòºöÂÔ
|
|
int minEnergy; // ²ÐµãÇøÓòÄÜÁ¿×îСֵ£¬Èç¹ûСÓÚ´ËÖµ£¬ÔòºöÂÔ
|
|
|
|
int maxErrorBlobCount; // ×î´óÔÊÐíµÄÂú×ãÉÏÊöÌõ¼þºóµÄ²ÐµãÇøÓòÊýÁ¿£¬Èç¹û´óÓÚ´ËÖµ£¬ Ôò±¨´í
|
|
int maxTotalArea; // ×î´óÔÊÐíµÄÂú×ãÉÏÊöÌõ¼þºóµÄ²ÐµãÇøÓò×ÜÃæ»ý£¬Èç¹û´óÓÚ´ËÖµ£¬ Ôò±¨´í
|
|
int maxTotalEnergy; // ×î´óÔÊÐíµÄÂú×ãÉÏÊöÌõ¼þºóµÄ²ÐµãÇøÓò×ÜÄÜÁ¿£¬Èç¹û´óÓÚ´ËÖµ£¬ Ôò±¨´í
|
|
|
|
int maxRegionArea; // ×î´óÔÊÐíµÄµ¥¸ö²ÐµãÇøÓòÃæ»ý£¬Èç¹û´óÓÚ´ËÖµ£¬ Ôò±¨´í
|
|
int maxRegionEnergy; // ×î´óÔÊÐíµÄµ¥¸ö²ÐµãÇøÓòÄÜÁ¿£¬Èç¹û´óÓÚ´ËÖµ£¬ Ôò±¨´í
|
|
int Hthold[4]; // ѧϰģ°æºóµÄÀ©Õ¹ãÐÖµ
|
|
int Lthold[4]; // ѧϰģ°æºóµÄÀ©Õ¹ãÐÖµ
|
|
int Level[2]; // ÑÏÖØµÈ¼¶
|
|
int mergeDistance; // ²ÐµãºÏ²¢×îС¾àÀë £¬¡¡ÈôÁ½¸ö²Ðµã¾àÀëСÓÚ´ËÖµÔòºÏ²¢ÎªÒ»¸ö
|
|
int isUseMacro;
|
|
} ERROR_DOTS_BLOB_PARAM;
|
|
|
|
typedef struct ERROR_BLOBS_PARAM
|
|
{
|
|
int id;
|
|
unsigned char *pb;
|
|
unsigned char *pr;
|
|
unsigned char *pc;
|
|
int width;
|
|
int height;
|
|
int obj;
|
|
ERROR_DOTS_BLOBS *blobs;
|
|
|
|
} ERROR_BLOBS_PARAM;
|
|
#ifdef __cplusplus
|
|
extern "C"
|
|
{
|
|
#endif
|
|
void pretest(double x);
|
|
extern void AddErrorScan(ERROR_DOTS_SCAN_ROW *curRow, ERROR_DOTS_SCAN_ROW *prevRow, int x, int len, int y, int difSum, int minArea, int minEng, int mdx, int *pErrClass);
|
|
extern void LinkScanLineToBlob(ERROR_DOTS_BLOBS *blobs, ERROR_DOTS_SCAN_ROW *prevRow, int sx, int sy, int minArea, int minEnergy, int mergeDistanceX, int mergeDistanceY, int width);
|
|
extern void SortBlob(ERROR_DOTS_BLOBS *blobs);
|
|
extern void MergeBlob(ERROR_DOTS_BLOBS *blobs, ERROR_DOTS_BLOB_PARAM *param);
|
|
extern void AddErrorScan_New(ERROR_DOTS_SCAN_ROW *curRow, ERROR_DOTS_SCAN_ROW *prevRow, int x, int len, int y, int difSum, int minArea, int minEng, int errorType);
|
|
extern void LinkScanLineToBlob_New(ERROR_DOTS_BLOBS *blobs, ERROR_DOTS_SCAN_ROW *prevRow, int sx, int sy, int minArea, int minEnergy, int mergeDistanceX, int mergeDistanceY, int width);
|
|
extern int CalminValue(ERROR_DOTS_BLOB_DATA *pblob, unsigned char *pcropdata, unsigned char *pcropConstructdata, unsigned char *pErrordata, unsigned char *pGrayMaskdata, int width, int height, int meanVale);
|
|
extern int GetBlobs_ALL_New(ERROR_DOTS_BLOBS *blobs, unsigned char *pcropdata, unsigned char *pcropConstructdata, unsigned char *pErrordata, unsigned char *pGrayMaskdata, int width, int height, int ndiffValueT);
|
|
extern int GetImg_MinDis(unsigned char *pimgdata_in, unsigned char *pimgdata_out, int width, int height, int HorW, int *pminDis, int *pxy, int *pminLocation_in, int *pminLocation_out);
|
|
extern int GetImg_Blob(ERROR_DOTS_BLOBS *blobs, unsigned char *pimgData, int width, int height);
|
|
extern int GetEdgePoint_ud_New(unsigned char *pImgData, int width, int height, int Tv, int startx, int strarty, int endy, int step, int *pOut_y);
|
|
extern int GetEdgePoint_lr_New(unsigned char *pImgData, int width, int height, int Tv, int starty, int strartx, int endx, int step, int *pOut_x);
|
|
extern int GetValueNum(unsigned char *pImgData, int width, int height,int Tv);
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif |