www.pudn.com > roadextr.rar > DefValue.h
/* For road extraction : road centre line , dual line */
#ifndef _ROAD_SEMI_DETECT
#define _ROAD_SEMI_DETECT
/* typedef unsigned char BYTE; */
typedef unsigned short WORD;
typedef unsigned long DWORD;
//#define FALSE 0
#define FAIL NULL
/* used to define ucResampleMethod */
#define BILINEAR 1
#define NEIGHBOR 2
#define MIN_MATCH_VALUE 0.5
#define NON_ROAD_GREYVALUE 0
#define ROAD_GREYVALUE 1
#define MAX_WIDTH_RATIO 50
#define SEGMENT_WIDTH_RATIO 8
#ifndef PI
#define PI 3.1415926
#endif
#define MAX_TILT_UNIT_NUM 10
#define TILT_ARC_UNIT PI/36
#define UNCERTAIN_MATCH_VALUE 0.75
#define GOOD_MATCH_VALUE 0.85
#define ROADWIDTH_0 4.0
#define ROADWIDTH_1 10.0
#define ROADWIDTH_2 15.0
#define ROADWIDTH_3 25.0
#define ROADWIDTH_4 36.0
///Add begin SJ
#define EXTR_NONE 0
#define EXTR_DBLINE 1
#define EXTR_CENTLINE 2
#define EXTR_EDGE 3
#define EXTR_EDGETODB 4
///Add end SJ
#define MIN_EXTEND_RATO 0.15
#define MAX_EXTEND_RATO 0.3
#define SET 1
#define NO_SET 0
#define SEG_OUT_BORDER 1
#define MAX_POINT_NUM 2000
/* used to define dfBluLimit in function BlunderDetect() */
#define MAX_BLUNDR_LIMIT 3.0
#define MIN_BLUNDR_LIMIT 2.0
#define BLUND_DET_INTEVAL 0.1
#define DOUBLE_LINE 0
#define EDGE_LINE 1
/* road line (based on Fourier transformation) filtering :
how many F coefficient be evaluated (roadlib.c) */
#define FILTER_COEF_NUM 50
#define EDGE_MCHFG_UP 1
#define EDGE_MCHFG_DOWN 0
#define MCH_FRISTFG_Y 0
#define MCH_FRISTFG_N 1
#define DLINE_PROCES_RW 12.0
#define MULTI_MCH_THR1 0.6
#define MULTI_MCH_THR2 0.7
#define ROAD_GYDIF_THR 40
#define MULTI_MCH_NUM 3
#define REAL_POINT_RATIO 0.75
#define DLTA_THRESH 5.0
#define DO_DIFFG_Y 1
#define DO_DIFFG_N 0
#define ROAD_POINT_INTERVAL 6.0
#define EDGE_POINT_INTERVAL 2.0
#define MAX_ROAD_CONNT_POINT_NUM 1000
#define MAX_ROAD_POINT_NUM 1000
#define MAX_EDGE_POINT_NUM 1000
#define MAX_SEGMENT_PTNUM 500
#define TOTAL_ROAD_LINE_NUM 3000
#define TOTAL_ROAD_CONTR_NUM 400
#define ROAD_DET 0
#define EDGE_DET 1
#define SANP_SCALE 6
#define STRAIGHT 100
#define BSP_LINE 101
#define ARC_LINE 102
#define WIDTH_CHANG 103
/* template width for edge trace. */
#define EDGE_TEMP_WIDTH 10
#define EDGE_MCH_INTERVAL 5
#define OPEN 0
#define CLOSE 1
#define DISP_POINT 1
#define DISP_CENTRLINE 0
#define DISP_DOUBLELINE 3
#define DISP_CONTROLPOINT 2
#define LINE2PT 10
#define LINE1PT 11
typedef struct EndPt{
DWORD dwRoadID;
double dfStCenX;
double dfStCenY;
double dfEndCenX;
double dfEndCenY;
double dfStLX;
double dfStLY;
double dfEndLX;
double dfEndLY;
double dfStRX;
double dfStRY;
double dfEndRX;
double dfEndRY;
}EDN_PT_STRUCT;
typedef struct RoadDetectRetStru{
DWORD dwRoadCentPtNum;
double *pdfRoadCent_X;
double *pdfRoadCent_Y;
double *pdfRoadL_X;
double *pdfRoadL_Y;
double *pdfRoadR_X;
double *pdfRoadR_Y;
double *pdfContrX;
double *pdfContrY;
DWORD dwContPt;
double dfRoadWi;
double *pdfC2;
WORD wFalseFg;
//EDN_PT_STRUCT roadEndPointStr;
}ROAD_DETECT_STRU;
/* About multi_possible point */
typedef struct MultiMaxMch{
DWORD dwMultiValNum;
double pdfMultiMaxMchVal[7];
double pdfMultiVal_X[7];
double pdfMultiVal_Y[7];
BYTE pucGray[7];
BYTE pucContra[7];
double pdfMultiGrDir[7];
/* for edge tracing, get the gradient direction of every point */
}strMultiMaxMch;
/* Data structure about multi_possibable road point in a columm block */
typedef struct strColumBlkMch{
double dfColMchVal;
double dfVal_X;
double dfVal_Y;
BYTE ucContrast;
BYTE ucGyDiff;
}strColumBlkMch;
typedef struct RoadWi_Contrast{
double dfRoadWidth;
BYTE ucRoadContrast;
BYTE ucNonRoadGy;
}strRoadWi_Contr;
typedef struct HouseLineRet{
double dfX1;
double dfY1;
double dfX2;
double dfY2;
double dfA;
DWORD dwRoadCentPtNum;
double *pdfRoadCent_X;
double *pdfRoadCent_Y;
}STR_HLINE_RET;
/*
gray gradient:magnitiude and direction
*/
typedef struct GradientStr{
double dfGrMag;
double dfA;
}Gradient;
/*
result of Hough transform for straight line detection .
*/
typedef struct HuoghLineOutStr{
double dfK; /* tg A */
double dfB;
}HoughLineRet;
typedef struct strRoadTemp{
int nTempWidth;
int nWholeTempW;
float fUpMVMatcPos;
float fDownMVMatcPos;
}STRU_TEMP;
#define DILATE_EROSE 0
#define EROSE_DILATE 1
#endif