www.pudn.com > roadextr.rar > roadnet.h


 
//int	ExtractCollinearSegs(unsigned char *pucImg,int	nRow,int nCol, 
//						 mmOBJECT	*pobjTotalObj, 
//					  int	nRDW,int nMaxW,int	nRoadGray,int nMinL, 
//					  dfPOINT	*pptJunction,int	*pnJunctionC, 
//					  CurSegNo	*pCurSegNo,int	*pnCurSegC); 
// 
///////检测亮线特征 
//BOOL	RoadSegDetect(unsigned char *pucImg,int	nRow,int nCol, 
//						  int	nRDW,int	nRoadGray, 
//						  RD_CentPt	*prdCent); 
// 
//int	MultiLevRoadSegExtract(unsigned char *pucOrigImg,unsigned char *pucImg,int	nRow,int nCol, 
//					  int	nRDW,int	nRoadGray,RoadSeg		*pRoadSeg, 
//					  int	nLongSegLength); 
// 
//int	RecordSegAtribute(mmOBJECT	*pobjTotalObj,unsigned char *pucOrigImg, 
//					  unsigned char *pucImg,int	nRow,int nCol, 
//					  RoadSeg		*pRoadSeg,int	nLongSegCount, 
//					  int	nRDW); 
// 
//int	CreateLinkMatrix(RoadSeg		*pRoadSeg,int	nLongSegCount, 
//				  double	*pdfLinkMatrix,int	*pnLinkModeMatrix); 
 
double	Compute2SegsLinkProbbyGeoInfo(double		dfSegL1,double	dfSegL2, 
									double		dfEndDltAngle, 
									double		dfGapL,double	dfGapT, 
									double		dfGap, 
									double		dfThta1,double	dfThta2/*, 
									double		dfWeiGap,double	dfWeiThta, 
									double		dfGapLimt,double	dfThtaLimt*/); 
 
int		ReturnCollinearDeviationof2Segs(RoadSeg		RoadSeg1,RoadSeg		RoadSeg2, 
										double		*pdfEndDltAngle, 
										double		*pdfGapL,double		*pdfGapT, 
										double		*pdfGap, 
										double		*pdfThta1,double	*pdfThta2); 
int	ComptueCollinearDeviationof2Segs(dfPOINT	*pptLin1,dfPOINT	*pptLin2, 
										double		*pdfEndDltAngle, 
										double		*pdfGap, /// 输入 
										double		*pdfGapL,double		*pdfGapT, 
										double		*pdfThta1,double	*pdfThta2); 
 
int	ExtractCollinearChainsfromLinkMarix(CollinearChain	*pChains, 
										double	*pdfLinkMatrix, 
										int		*pnLinkModeMatrix, 
										RoadSeg		*pRoadSeg, 
										double	dfProbThre,	//// 连接概率门限 
										int	nLongSegCount); 
 
int	MergeSegmensbyChianNo(int	*pnNo,int	*pnLinkModeMatrix,int	nTotalSegC, 
						  int	nSegCount, //// 链中的线段数 
						  RoadSeg	*pRoadSeg, 
						  RoadSeg	*pRoadSegment); 
 
//void	RoadSegtommOBJECT(RoadSeg	RoadSegment,mmOBJECT	*pObject); 
 
//void	SaveSegsToObject(RoadSeg	*pRoadSegment,mmOBJECT	*pobjTotalObj, 
//						 int	nTotalSegC); 
 
void	DeleteRoadSegMem(RoadSeg	*pRoadSegment,int	nTotalSegC); 
 
//int		TraceSingleWidthVector(mmOBJECT		*pobjTotalObj, 
//							   unsigned char *pucImg,int	nRow,int nCol); 
 
//void	CompressAllLinePt(mmOBJECT		*pobjTotalObj,int	nTotalLineC,float	fSimuError); 
 
//double	RoadDetectMatch_New(BYTE *pucImgBlkData,DWORD dwRoadWidth, 
//						DWORD dwDataSize,WORD wFristFg, 
//						DWORD *pdwSum,DWORD *pdwSum2, 
//						DWORD *pdwLRSum); 
// 
//double	ReturnVectorAngle_2D(dfPOINT	dfptSt,dfPOINT	dfptEnd); 
 
 
double	ReturnAngleBetween2Line(dfPOINT	*pptLin1,dfPOINT	*pptLin2); 
 
void	CopyDataBetween2RoadSegsMem(RoadSeg *pRoadSegment,int	nLongSegsCount,RoadSeg *pRoadSeg); 
 
bool	JudgeNewLinkFrmMatrix(double	*pdfLinkMatrix,int	nLongSegsCount, 
							  double	dfLinkProbThre); 
 
//bool	IsLineSegmentCrossRoadSeg(dfPOINT	dfptSt,dfPOINT	dfptEnd,int	nSeg1No,int	nSeg2No, 
//								  RoadSeg	*pRoadSeg,int	nLongSegsCount); 
 
void	GetEndPtof2Segs(dfPOINT	*pdfptSt,dfPOINT	*pdfptEnd, 
						RoadSeg *pRoadSeg,int	nSegNo1,int	nSegNo2,int	nLinkMode); 
 
//void	ImgBorderSetWhite(unsigned char	*pucI,int	nRow,int	nCol); 
 
//int	SetShortSegDeletedInObjecrtList(mmOBJECT	*pobjTotalObj, 
//						 int	nTotalSegC,double	dfLenLimit); 
// 
//int	ExterminateShortBranchOnSegEnd(mmOBJECT	objTotal); 
 
//int		UpdateLinkProbInChain(CollinearChain	*pChain,int	nChainCount, 
//							RoadSeg	*pRoadSeg,int	nLongSegsCount, 
//							double	*pdfLinkMatrix,int	*pnLinkModeMatrix, 
//							unsigned char	*pucOriginImg, 
//							unsigned char	*pucDetectedImg,int	nRow,int	nCol, 
//							double	dfProbLimt, int	*pnBreakMatrix, 
//							CollinearChain	*pnewChain); 
// 
//void	SetLinkProbMatrixByBraekInfo(double	*pdfLinkMatrix,int	nTotalSegC, 
//									 int	*pnBreakMatrix); 
 
//bool	UpdateChainProb_byCondiMdl(CollinearChain	OneChain,int	nOneChainSegC, 
//							RoadSeg	*pRoadSeg,int	nLongSegsCount, 
//							double	*pdfLinkMatrix,int	*pnLinkModeMatrix, 
//							double	*pdfOutChainProb); 
// 
//////// 更新所有共线链的连接概率, 由此更新连接矩阵 
//bool	UpdateAllChainProb(CollinearChain	*pChains,int	nChainsC, 
//							RoadSeg	*pRoadSeg,int	nLongSegsCount, 
//							double	*pdfLinkMatrix,int	*pnLinkModeMatrix); 
// 
//bool	IdentifyRDSegFromOrgiImg(BYTE	*pucImg,int	nRow,int	nCol,int	nNN, 
//								 RoadSeg	*pRoadSegment,int	nSegsCount, 
//								 float	fRdWid); 
// 
//float	GetRoadStrSegProb_OrgiImg(dfPOINT	*pptCenPt,BYTE	*pucImg,int	nRow,int	nCol, 
//								  float	fRdWid); 
// 
//void	ResampleRec(dfPOINT	*pptCenPt,BYTE	*pucImg,int	nRow,int	nCol, 
//					 int	nHeight,BYTE	*pucD); 
 
//float	HoughT_DetParaLinPair(BYTE	*pucD,int	nIHei,int	nIWid, 
//							  int	nDge,int	nRdWid); 
// 
// 
//int	RoadNetExtr_MultiRes(unsigned char *pucImg,int	nRow,int nCol, 
//						 mmOBJECT	*pobjTotalObj, 
//					  int	nRDW,int	nRoadGray, 
//					  dfPOINT	*pptJunction,int	*pnJunctionC, 
//					  CurSegNo	*pCurSegNo,int	*pnCurSegC); 
// 
//void	ScaleLinearObj(mmOBJECT	*pobjTotalObj,int	nObjC,float	fN); 
// 
//BOOL	RoadSegDetect_GauFilt(unsigned char *pucImg,int	nRow,int nCol, 
//					  int	nRDW,int	nRoadGray, 
//					  RD_CentPt	*prdCent); 
 
int	StrRdNetExtr(unsigned char *pucImg,int	nRow,int nCol, 
				mmOBJECT	*pobjTotal,int	nRDW,int	nRDWidMax,int	nRoadGray, 
				dfPOINT	*pptJunction,int	*pnJunctionC, 
				float	fStartGpLen,float fOutLen); 
 
//int	StrLinGrp(StraightLineSeg	*pstrlLin,int	nLNum, 
//			  StraightLineSeg	*pstrlGpedLines,float	fStartGpLen,float fOutLen); 
// 
//double	SetCombineLine(StraightLineSeg	*pstrlLin, 
//						int	*pnCoLineNo,int	nCoLineNo, 
//						StraightLineSeg	*strLns); 
 
//void	ExchangeLineSeg(StraightLineSeg	*pstrlLin0,StraightLineSeg	*pstrlLin1); 
 
int	GroupMostColinearLines(RoadSeg	*pRoadSeg,int	nSegsN, 
						   BYTE	*pucCluesI,int	nRow,int	nCol, 
						   StraightLineSeg	*pstrlLin,int	nLNum, 
							StraightLineSeg	*pstrlGpedLines,mmOBJECT	*pobjTotal, 
							float	fStartGpLen,float fOutLen,float	fMinProb, 
							dfPOINT	*pptJunction,int	*pnJunctionC); 
 
void	CopyStrLineToRoadSegs(StraightLineSeg *pstrlLin,int nLNum,RoadSeg	*pRoadSeg); 
 
//void	CopyRoadSegsToStrLine(StraightLineSeg *pstrlLin,int nLNum,RoadSeg	*pRoadSeg); 
 
int	CreateLinkMatrix_StrSeg(BYTE	*pucCluesI,int	nRow,int	nCol, 
							RoadSeg		*pRoadSeg,int	nLongSegCount, 
							double	*pdfLinkMatrix,int	*pnLinkModeMatrix,int	nUsedClue); 
 
//float	GetLineCluein2Pts(dfPOINT	*pdfptPT0,dfPOINT	*pdfptPT1, 
//						  BYTE	*pucImg,int	nRow,int	nCol,int	nUseClus); 
 
 
double	Compu2LinsLinkProbSTR_COLLINEAR(BYTE	*pucCluesI,int	nRow,int	nCol, 
									dfPOINT	*pdfptPT0,dfPOINT	*pdfptPT1, 
									double		dfSegL1,double	dfSegL2, 
									double		dfEndDltAngle,double		dfGapL,double	dfGapT, 
									double		dfGap,double		dfThta1,double	dfThta2); 
 
 
int	GroupRoadSegs(BYTE	*pucCluesI,int	nRow,int	nCol, 
				  RoadSeg *pRoadSeg,int	nLongSegsCount,double *pdfLinkMatrix, 
				  int	*pnLinkModeMatrix,int	nUseClus,float	fMinProb, 
				  RoadSeg *pRoadSegment,CollinearChain *pChains); 
 
//void	RmvLinesInBinImg(RoadSeg *pRoadSeg,int	nLongSegsCount, 
//						  BYTE	*pucImg,int	nRow,int	nCol); 
 
//int	SetRoadTemp(BYTE *pucTem,int	nTempW,int	nLineW); 
 
double	Compu2LinsLinkProbSTR_LINK(BYTE	*pucCluesI,int	nRow,int	nCol, 
									 dfPOINT	*pdfptPT0,dfPOINT	*pdfptPT1, 
									double		dfSegL1,double	dfSegL2, 
									double		dfEndDltAngle,double		dfGapL,double	dfGapT, 
									double		dfGap,double		dfThta1,double	dfThta2); 
 
double	Compu2LinsLinkProbSTR_LINK_LONG_SEG(BYTE	*pucCluesI,int	nRow,int	nCol, 
									dfPOINT	*pdfptPT0,dfPOINT	*pdfptPT1, 
									double		dfSegL1,double	dfSegL2, 
									double		dfEndDltAngle,double		dfGapL,double	dfGapT, 
									double		dfGap,double		dfThta1,double	dfThta2); 
 
int	SetInitialRdProfTemp(BYTE *pTem,int	nRdW); 
 
BOOL	RoadSegDetect_MultiWid(unsigned char *pucImg,int	nRow,int nCol, 
					  int	nRDW,int	nMinRW,int	nMaxRW, 
					  int	nRoadGray,RD_CentPt	*prdCent); 
 
//void	FillSegEndPtAreas(BYTE	*pucImg,int	nRow,int	nCol, 
//						  RoadSeg	*pSeg,int	nSegN,float	nLongSegLim); 
 
//bool	IsInBlackArea_SegEndPt(BYTE	*pucImg,int	nRow,int	nCol, 
//						  RoadSeg	*pSeg,int	nNo); 
 
//int	RemoveShortSegs(RoadSeg	*pRoadSeg,int	nSegsN,float	fLenLimt); 
 
//double	HalfAng2Lines(dfPOINT	*pptLin,double	*pdfSina,double	*pdfCosa); 
 
//double	LineAngle(dfPOINT	*pptLin); 
 
//int	RePosEdgePtAlHalfAngDir(BYTE	*pucI,int	nRow,int	nCol, 
//							int		nSchRg,dfPOINT	*pptLin,dfPOINT	*ppt); 
// 
//double	Dis2Pts(dfPOINT	*pptLin); 
// 
//BOOL	RoadSegDetect_MultiWid_BinTemp(unsigned char *pucImg,int	nRow,int nCol, 
//					  int	nRDW,int	nMinRW,int	nMaxRW, 
//					  int	nRoadGray,RD_CentPt	*prdCent); 
 
//double	RetPixelGrdAng_Soble(BYTE	*pucI,int	nX,int	nY,int	nCol,int	nRow); 
// 
//BOOL	RoadSegDetect_MultiWid_BinTemp_2(unsigned char *pucImg,int	nRow,int nCol, 
//					  int	nRDW,int	nMinRW,int	nMaxRW, 
//					  int	nRoadGray,RD_CentPt	*prdCent); 
/* 
int	Highway_ExtrCentrMarks(unsigned char *pucImg,int	nRow,int nCol, 
				mmOBJECT	*pobjTotal,int	nRDW,int	nRDWidMax, 
				int	nRoadGray,float	fStartGpLen,float fOutLen); 
*/ 
//int	Highway_IndetifyShortCentMarks(StraightLineSeg	*pstrlLin,int	nLinesC, 
//								   strCMChain	*pCMChains); 
// 
///////double	Simi2Segs(double	dfDisDltItm,double	dfThtaItm, double	dfDisItm); 
///////double	Simi2Segs(double	dfDisItm,double	dfThtaItm); 
//double	Simi2Segs(double	dfDisItm,double	dfThtaItm,double	df2SegDisItm); 
// 
//void	SetCharactCentMarkSeg(StraightLineSeg	*pstrlLin,strCMChain	CMChains); 
// 
//void	RetIntensity_StrSeg(StraightLineSeg	*pstrSeg,BYTE *pucImg,int	nRow,int nCol); 
// 
//double	RetCurvature(dfPOINT	*ppt3Pts); 
// 
//bool	LaneMarkerDetector(BYTE *pucImg,int	nRow,int nCol,int	nRoadGray); 
// 
//int	PreGrp_ShortCentMarks(StraightLineSeg	*pstrlLin,int	nLinesC, 
//						  strCMChain	*pCMChains, 
//						  double	*pdfLinkMatrix, 
//						  int	*pnLinkModeMatrix,float	*pfGapMatrix); 
 
double	Compu2LinsLinkProbSTR_COLLINEAR_2(dfPOINT	*pdfptPT0,dfPOINT	*pdfptPT1, 
									double		dfSegL1,double	dfSegL2, 
									double		dfEndDltAngle,double		dfGapL,double	dfGapT, 
									double		dfGap,double		dfThta1,double	dfThta2); 
 
 
//int		TraceSingleWidthVector_Long(mmOBJECT		*pobjTotalObj, 
//							   unsigned char *pucImg,int	nRow,int nCol,float	fLmt);