www.pudn.com > roadextr.rar > valdef.h
//define the extraction type value
#ifndef DFPOINT_H__
#define DFPOINT_H__
#define PI 3.1415926
#define MAN_SLINE 100
#define MAN_BSPLINE 101
#define AUTO_EDGE 102
#define AUTO_CENTLINE 103
#define AUTO_DBLINE 104
#define AUTO_CUBE 105
#define AUTO_TRACE 106
#define POLYGON 107
#define POLYGON_OUT 110
#define CORNERPT 108
#define HOU_PDZJ 109
#define NOT_USE 0
#define TOTAL_OBJ_COUNT 20000
#define MAPINFOHEADSIZE 128
#define UNDELETED 9
#define DELETED 10
#define MERGD 11
#define SELECTED 12
#define START_PT 200
#define END_PT 201
#define NO_CORNER_PT -1
#define SEED_PT_COLOR RGB(0,255,0)
#define DRAW_PEN_COLOR RGB(255,0,0)
#define XOR_PEN_COLOR RGB(255,255,255)//(200,120,60)
#define RECO_DIG_COLOR RGB(0,0,255)
#define LEFT_RD_EG (signed char)1
#define RIGHT_RD_EG (signed char)-1
#define UP_RD_EG (signed char)2
#define DOWN_RD_EG (signed char)-2
#define RD_PIXEL (signed char)-3
#define RD_CENT_PIXEL (signed char)4
#define SS 500
#define SE 501
#define ES 502
#define EE 503
#define STPT 504
#define ENDPT 505
///// define collinear grouping type
#define PURE_GEO_CLUE 550
#define STR_COLLINEAR 551
#define STR_LINK 552
#define CURVE_ADD_LINK 553
#define STR_LINK_LONG_SEG 554
#define STR_COLLINEAR_2 555
#define PT_TO_CURPT 600
#define PT_TO_NEXTPT 601
#define PT_TO_LINE 602
#define LINE_TO_LINE 603
#define LINEGP_PROCED 650
#define LINEGP_NON_PROCED 651
///////// highway mark detection from high resolution image
#define SINGLE_CENT_MARK 1000 ///// the mark in the central
#define MULTI_TRACK_MARK 1001 ///// belongs to multi track mark
#define SIDE_MARK 1002 ///// belongs to dual side
#define NON_HIGHWAY_MARK 1003 ///// is not highway mark
#define NOT_PROSESSED -1 ///// is not highway mark
#define PROSESSED 1 ///// is not highway mark
typedef struct dfPointNew
{
double dfX;
double dfY;
}dfPOINT;
typedef struct doublePointNew
{
double x;
double y;
}fPoint;
typedef struct intPoint
{
int nX;
int nY;
}nPOINT;
typedef struct stripe
{
dfPOINT pptSeg[2];
float fRo;
float fTh;
double dfLen;
float fWid;
int nUnitV;
}strStrip;
/////直线段
typedef struct LineSegment
{ nPOINT *pnptPxy;///点
int nPtC; ///点数
double dfThta; ////斜率
double dfDist; /// 两点的距离
}LineSeg;
/////直线段
typedef struct StraightLineSegment
{
dfPOINT nptSt;///起点
dfPOINT nptEnd;///终点
nPOINT *pnptPt;
dfPOINT *pdfptP;////直线上的点
double *pdfGrad;////直线点的梯度大小
double *pdfGradDir;///直线点的梯度方向
int nPtC; ///点数
int nTotalPtC;
int nIntensity; ///// intensity of the line
double dfThta; ////斜率
double dfDist; /// 两点的距离
int nFlag; ///处理标记
int nProc_Flag;
float fRo; //// define straight line equation
float fThta;
}StraightLineSeg;
////// for grouping highway centermarks :
////// a collinear chain of the mark segments
typedef struct CenterMarkChain
{
dfPOINT pptCM_MidPts[300]; //// each middle point of the segments
int nSegC; //////// segment number
dfPOINT pptCM_Pts[300]; //// each middle point of the segments
float pfInterV[300]; //// the intervals among the segments
int nPtC; ///// point count
int pnIndex[300]; /////
int nIntensity; ///// (average) intensity of the lines
double dfConsc_Len; ////// consistency of segment length
double dfConsc_Intv; ////// consistency of segment interval
double dfCurv; ////// curveature of the chain
double dfLen; ////// length of the chain
bool bProce; ////// processing flag
unsigned char ucGrd; //// mean of the gradients
float fCurv; //// curvature
unsigned char pucDirNm[300];
}strCMChain;
/////// node structrue
typedef struct Node
{ strCMChain *pNodeChain;
int nFormerOptNo;
double fMiniEnergy;
int nChainC;
int nChianNo;
int pnChainN[300];
int pnFormerChN[30]; /////
int nFormerChC; ///// former chain count
int nLinkMode; //// link mode to sequential node
double dfRouteLen;
}strNode;
///// corner point
typedef struct CornerPoint
{ dfPOINT dfptCorner;
dfPOINT dfptInterSect1;
dfPOINT dfptInterSect2;
int nNo;
double dfWei;
}CornerPt;
typedef struct HouPDZJ
{ dfPOINT *pdfptHouPt;
int nPtC;
}HouPDZJPt;
typedef struct mmObject
{
int nObjType;
int nObjSetNum;
int nObjPtCount;
int nExtrState;
int nLen;////length of the line
double dfLength;
dfPOINT *pnptObjPtCen;
dfPOINT *pnptObjPtR;
dfPOINT *pnptObjPtL;
nPOINT pnptCrossPt[1];
int nScore;
}mmOBJECT;
//// struct to save Fourier Descriptor Mag
typedef struct FDM_Curves
{
int nCoefC;
float *pfFDM;
}strCurves_FDM;
typedef struct mmObjectRec
{ int nWidth;
int nHeight;
int nX;
int nY;
}mmOBJECTRec;
typedef struct mapHeader
{ char m;
char a;
char p;
unsigned long dwImgWidth;
unsigned long dwImgHeight;
unsigned long dwTotalObjNum;
unsigned long dwDataSize;
int nHeaderSize;
}mapHEADER;
typedef struct objHeader
{ int nObjID;
int nExtrState;
int nPtCount;
unsigned long dwObjDataSize;
}objHEADER;
typedef struct DigInfo
{ int nx1;
int ny1;
int nx2;
int ny2;
int nDigCount;
LPCTSTR pstr;
int pnDigPos[100];
}digINFO;
////自动提取的道路中心点结构
typedef struct RdCentPt
{ unsigned char ucMchValue; ////模板匹配的匹配值
signed char scMchWid; ////匹配处的模板(道路)宽度, +为行方向,-为列方向
}RD_CentPt;
typedef struct BORDER
{
int min_x;
int min_y; ////////////// 段数
int max_x;
int max_y;
}Str_Border;
typedef struct strAttrbSeg
{ float fGeo; ///// geomatric
float fPho; ///// photometric
float fTopo; //// topology
}AttrbSeg;
//// 道路候选段
typedef struct RoadCandiSeg
{
dfPOINT *pptCenPt; //// 中心矢量点列
int nCenPtC; ////////////// 点数
bool bSelected; //// is selected
float dfAvwidth; //// 段的平均宽度
float dfAvCorr; //// 平均相关系数
float dfAvGray; ///// 中心点的平均亮度
float dfStAngle; /// 起始端的朝向
float dfEdAngle; /// 末端的朝向
float dfSegLength; //// 段长度
int nStLinkSegNo; //// 起始点连接的段号。若为 -1: 无连接
int nEdLinkSegNo; //// 起始点连接的段号。若为 -1: 无连接
int nLinkMode; //// 连接点是起点还是终点: STPT or ENDPT
Str_Border str_border;
float fInitProb; //// initial probility of being road segment
float fProb; //// Updated probility of being road segment
}RoadSeg;
//////// 共线链
typedef struct COLLINEAR_CHAIN
{
int pnSegNo[300];
int nSegCount; ////////////// 段数
float fpLinkProb[100];
}CollinearChain;
///// 几何偏移参数
typedef struct DEVIATION
{ double dfEndDltAngle;
double dfGap;
double dfGapL;
double dfGapT;
double dfThta1;
double dfThta2;
}CeoDeviation;
/////// 网络连接端点
typedef struct SegEndPtLink
{
bool bLink; ///// 标志
double dfLinkProb; /// 连接概率
double dfDist;
int nLinkedSegNo; /// 被连接的段号
int nLinkedPtNo; /// 被连接的段中的点号
dfPOINT ptLinkPt;
}SegEndPtLinker;
////// 网络连接
typedef struct NetLink
{
SegEndPtLinker pstPtLinker[3];
SegEndPtLinker pendPtLinker[3];
}NetLinker;
/////// 网络连接端点参数
typedef struct EndPtLinkPara
{ bool bLink;
// double dfProbLink; /// 连接概率
double dfDist; /// 连接距离
int nNetLinkMode; //// PT_TO_PT; PT_TO_LINE; LINE_TO_LINE
dfPOINT ptLinkPt;
double dfProb; /// 连接距离
}EndPtLinkPara;
////// 记录每段的中心点位置,段号
typedef struct SegmentNo
{
int nSegNo;
double dfX,dfY;
}CurSegNo;
///// road extraction parameters
typedef struct RdExtrInParametrers
{
float fRoadWidth;
float fPeakMinCorr;
float fLnkProMin;
float fDelLenMin;
float fLenOptMin;
}RdExtrInPara;
//// for segmentation by spliting and merging
typedef struct strSegNodes
{
int nI;
int nJ;
int nLayerN;
int nSubBlkN1;
int nSubBlkN2;
float *pfFeature;
float pfGryHist[256];
float pfHueHist[480];
float pfInensity[5];//pf..[0]=sum,pf..[1]=mean,pf..[2]=sigma ...
float pfSaturation[5];///pf.[0]=sum,pf.[0]=mean,pf.[2] = sigma
float pfColor[6];////[0,1,2]=sum_R,G,B;[3,4,5]=mean_R,G,B
float I2; //// for color feature
float I3; //// for color feature
nPOINT pnptPolyGon[256];
int nPolyPtC;
int nAreaSize;
int nX0;
int nY0;
int nWinW;
}SegNode;
typedef struct strRegion
{
int nGridC;
float *pfFeature; ///// texture
float pfInensity[5];//pf..[0]=sum,pf..[1]=mean,pf..[2]=sigma ...
float pfSaturation[5];///pf.[0]=sum,pf.[0]=mean,pf.[2] = sigma
float pfColor[6]; ////[0,1,2]=sum_R,G,B;[3,4,5]=mean_R,G,B
float pfGryHist[256];
float pfHueHist[480];
float I2; //// for color feature
float I3; //// for color feature
int nAreaSize;
nPOINT *pnptXY0;
int *pnWinW;
}Region;
typedef struct strStringChro
{
bool isCent;
short int I1;
short int I2;
short int I3;
}StringElm;
typedef struct strChro
{
StringElm pstr[100];
}Chro;
#define EXIST_RD_PT 1
#define NO_RD_PT 0
#define ROW_RD_PT 2
#define COL_RD_PT 3
#define ROAD_PT 4
#define LEFT_PT 5
#define RIGHT_PT 6
#define UP_PT 7
#define DOWN_PT 8
#define MAX_CURVE_POINT_COUNT 10000
#define MAX_CURVE_SEG_COUNT 10000
#define BROARD_PT 128
#define INFO_EMBD_UNIT 4
#endif