remaining C-style planar subdivisions data structures are moved to legacy
This commit is contained in:
parent
5c13b8706f
commit
4aaaef5967
@ -422,79 +422,6 @@ CvChainPtReader;
|
||||
(deltas)[6] = (step), (deltas)[7] = (step) + (nch))
|
||||
|
||||
|
||||
/****************************************************************************************\
|
||||
* Planar subdivisions *
|
||||
\****************************************************************************************/
|
||||
|
||||
typedef size_t CvSubdiv2DEdge;
|
||||
|
||||
#define CV_QUADEDGE2D_FIELDS() \
|
||||
int flags; \
|
||||
struct CvSubdiv2DPoint* pt[4]; \
|
||||
CvSubdiv2DEdge next[4];
|
||||
|
||||
#define CV_SUBDIV2D_POINT_FIELDS()\
|
||||
int flags; \
|
||||
CvSubdiv2DEdge first; \
|
||||
CvPoint2D32f pt; \
|
||||
int id;
|
||||
|
||||
#define CV_SUBDIV2D_VIRTUAL_POINT_FLAG (1 << 30)
|
||||
|
||||
typedef struct CvQuadEdge2D
|
||||
{
|
||||
CV_QUADEDGE2D_FIELDS()
|
||||
}
|
||||
CvQuadEdge2D;
|
||||
|
||||
typedef struct CvSubdiv2DPoint
|
||||
{
|
||||
CV_SUBDIV2D_POINT_FIELDS()
|
||||
}
|
||||
CvSubdiv2DPoint;
|
||||
|
||||
#define CV_SUBDIV2D_FIELDS() \
|
||||
CV_GRAPH_FIELDS() \
|
||||
int quad_edges; \
|
||||
int is_geometry_valid; \
|
||||
CvSubdiv2DEdge recent_edge; \
|
||||
CvPoint2D32f topleft; \
|
||||
CvPoint2D32f bottomright;
|
||||
|
||||
typedef struct CvSubdiv2D
|
||||
{
|
||||
CV_SUBDIV2D_FIELDS()
|
||||
}
|
||||
CvSubdiv2D;
|
||||
|
||||
|
||||
typedef enum CvSubdiv2DPointLocation
|
||||
{
|
||||
CV_PTLOC_ERROR = -2,
|
||||
CV_PTLOC_OUTSIDE_RECT = -1,
|
||||
CV_PTLOC_INSIDE = 0,
|
||||
CV_PTLOC_VERTEX = 1,
|
||||
CV_PTLOC_ON_EDGE = 2
|
||||
}
|
||||
CvSubdiv2DPointLocation;
|
||||
|
||||
typedef enum CvNextEdgeType
|
||||
{
|
||||
CV_NEXT_AROUND_ORG = 0x00,
|
||||
CV_NEXT_AROUND_DST = 0x22,
|
||||
CV_PREV_AROUND_ORG = 0x11,
|
||||
CV_PREV_AROUND_DST = 0x33,
|
||||
CV_NEXT_AROUND_LEFT = 0x13,
|
||||
CV_NEXT_AROUND_RIGHT = 0x31,
|
||||
CV_PREV_AROUND_LEFT = 0x20,
|
||||
CV_PREV_AROUND_RIGHT = 0x02
|
||||
}
|
||||
CvNextEdgeType;
|
||||
|
||||
/* get the next edge with the same origin point (counterwise) */
|
||||
#define CV_SUBDIV2D_NEXT_EDGE( edge ) (((CvQuadEdge2D*)((edge) & ~3))->next[(edge)&3])
|
||||
|
||||
|
||||
/* Contour approximation algorithms */
|
||||
enum
|
||||
{
|
||||
|
@ -57,8 +57,6 @@ int icvIntersectLines( double x1, double dx1, double y1, double dy1,
|
||||
double* t2 );
|
||||
|
||||
|
||||
void icvCreateCenterNormalLine( CvSubdiv2DEdge edge, double* a, double* b, double* c );
|
||||
|
||||
void icvIntersectLines3( double* a0, double* b0, double* c0,
|
||||
double* a1, double* b1, double* c1,
|
||||
CvPoint2D32f* point );
|
||||
|
@ -251,27 +251,6 @@ CVAPI(void) cvFindHandRegionA( CvPoint3D32f* points, int count,
|
||||
CVAPI(void) cvCalcImageHomography( float* line, CvPoint3D32f* center,
|
||||
float* intrinsic, float* homography );
|
||||
|
||||
/****************************************************************************************\
|
||||
* Additional operations on Subdivisions *
|
||||
\****************************************************************************************/
|
||||
|
||||
// paints voronoi diagram: just demo function
|
||||
CVAPI(void) icvDrawMosaic( CvSubdiv2D* subdiv, IplImage* src, IplImage* dst );
|
||||
|
||||
// checks planar subdivision for correctness. It is not an absolute check,
|
||||
// but it verifies some relations between quad-edges
|
||||
CVAPI(int) icvSubdiv2DCheck( CvSubdiv2D* subdiv );
|
||||
|
||||
// returns squared distance between two 2D points with floating-point coordinates.
|
||||
CV_INLINE double icvSqDist2D32f( CvPoint2D32f pt1, CvPoint2D32f pt2 )
|
||||
{
|
||||
double dx = pt1.x - pt2.x;
|
||||
double dy = pt1.y - pt2.y;
|
||||
|
||||
return dx*dx + dy*dy;
|
||||
}
|
||||
|
||||
|
||||
/****************************************************************************************\
|
||||
* More operations on sequences *
|
||||
\****************************************************************************************/
|
||||
@ -910,7 +889,7 @@ CvSeq * cvPostBoostingFindFace(IplImage * Image,CvMemStorage* storage);
|
||||
|
||||
typedef unsigned char CvBool;
|
||||
|
||||
typedef struct
|
||||
typedef struct Cv3dTracker2dTrackedObject
|
||||
{
|
||||
int id;
|
||||
CvPoint2D32f p; // pgruebele: So we do not loose precision, this needs to be float
|
||||
@ -924,7 +903,7 @@ CV_INLINE Cv3dTracker2dTrackedObject cv3dTracker2dTrackedObject(int id, CvPoint2
|
||||
return r;
|
||||
}
|
||||
|
||||
typedef struct
|
||||
typedef struct Cv3dTrackerTrackedObject
|
||||
{
|
||||
int id;
|
||||
CvPoint3D32f p; // location of the tracked object
|
||||
@ -938,7 +917,7 @@ CV_INLINE Cv3dTrackerTrackedObject cv3dTrackerTrackedObject(int id, CvPoint3D32f
|
||||
return r;
|
||||
}
|
||||
|
||||
typedef struct
|
||||
typedef struct Cv3dTrackerCameraInfo
|
||||
{
|
||||
CvBool valid;
|
||||
float mat[4][4]; /* maps camera coordinates to world coordinates */
|
||||
@ -946,7 +925,7 @@ typedef struct
|
||||
/* has all the info we need */
|
||||
} Cv3dTrackerCameraInfo;
|
||||
|
||||
typedef struct
|
||||
typedef struct Cv3dTrackerCameraIntrinsics
|
||||
{
|
||||
CvPoint2D32f principal_point;
|
||||
float focal_length[2];
|
||||
@ -2946,6 +2925,74 @@ CVAPI(void) cvPyrSegmentation( IplImage* src, IplImage* dst,
|
||||
* Planar subdivisions *
|
||||
\****************************************************************************************/
|
||||
|
||||
typedef size_t CvSubdiv2DEdge;
|
||||
|
||||
#define CV_QUADEDGE2D_FIELDS() \
|
||||
int flags; \
|
||||
struct CvSubdiv2DPoint* pt[4]; \
|
||||
CvSubdiv2DEdge next[4];
|
||||
|
||||
#define CV_SUBDIV2D_POINT_FIELDS()\
|
||||
int flags; \
|
||||
CvSubdiv2DEdge first; \
|
||||
CvPoint2D32f pt; \
|
||||
int id;
|
||||
|
||||
#define CV_SUBDIV2D_VIRTUAL_POINT_FLAG (1 << 30)
|
||||
|
||||
typedef struct CvQuadEdge2D
|
||||
{
|
||||
CV_QUADEDGE2D_FIELDS()
|
||||
}
|
||||
CvQuadEdge2D;
|
||||
|
||||
typedef struct CvSubdiv2DPoint
|
||||
{
|
||||
CV_SUBDIV2D_POINT_FIELDS()
|
||||
}
|
||||
CvSubdiv2DPoint;
|
||||
|
||||
#define CV_SUBDIV2D_FIELDS() \
|
||||
CV_GRAPH_FIELDS() \
|
||||
int quad_edges; \
|
||||
int is_geometry_valid; \
|
||||
CvSubdiv2DEdge recent_edge; \
|
||||
CvPoint2D32f topleft; \
|
||||
CvPoint2D32f bottomright;
|
||||
|
||||
typedef struct CvSubdiv2D
|
||||
{
|
||||
CV_SUBDIV2D_FIELDS()
|
||||
}
|
||||
CvSubdiv2D;
|
||||
|
||||
typedef enum CvSubdiv2DPointLocation
|
||||
{
|
||||
CV_PTLOC_ERROR = -2,
|
||||
CV_PTLOC_OUTSIDE_RECT = -1,
|
||||
CV_PTLOC_INSIDE = 0,
|
||||
CV_PTLOC_VERTEX = 1,
|
||||
CV_PTLOC_ON_EDGE = 2
|
||||
}
|
||||
CvSubdiv2DPointLocation;
|
||||
|
||||
typedef enum CvNextEdgeType
|
||||
{
|
||||
CV_NEXT_AROUND_ORG = 0x00,
|
||||
CV_NEXT_AROUND_DST = 0x22,
|
||||
CV_PREV_AROUND_ORG = 0x11,
|
||||
CV_PREV_AROUND_DST = 0x33,
|
||||
CV_NEXT_AROUND_LEFT = 0x13,
|
||||
CV_NEXT_AROUND_RIGHT = 0x31,
|
||||
CV_PREV_AROUND_LEFT = 0x20,
|
||||
CV_PREV_AROUND_RIGHT = 0x02
|
||||
}
|
||||
CvNextEdgeType;
|
||||
|
||||
/* get the next edge with the same origin point (counterwise) */
|
||||
#define CV_SUBDIV2D_NEXT_EDGE( edge ) (((CvQuadEdge2D*)((edge) & ~3))->next[(edge)&3])
|
||||
|
||||
|
||||
/* Initializes Delaunay triangulation */
|
||||
CVAPI(void) cvInitSubdivDelaunay2D( CvSubdiv2D* subdiv, CvRect rect );
|
||||
|
||||
@ -3029,6 +3076,28 @@ CV_INLINE CvSubdiv2DPoint* cvSubdiv2DEdgeDst( CvSubdiv2DEdge edge )
|
||||
return (CvSubdiv2DPoint*)e->pt[(edge + 2) & 3];
|
||||
}
|
||||
|
||||
/****************************************************************************************\
|
||||
* Additional operations on Subdivisions *
|
||||
\****************************************************************************************/
|
||||
|
||||
// paints voronoi diagram: just demo function
|
||||
CVAPI(void) icvDrawMosaic( CvSubdiv2D* subdiv, IplImage* src, IplImage* dst );
|
||||
|
||||
// checks planar subdivision for correctness. It is not an absolute check,
|
||||
// but it verifies some relations between quad-edges
|
||||
CVAPI(int) icvSubdiv2DCheck( CvSubdiv2D* subdiv );
|
||||
|
||||
// returns squared distance between two 2D points with floating-point coordinates.
|
||||
CV_INLINE double icvSqDist2D32f( CvPoint2D32f pt1, CvPoint2D32f pt2 )
|
||||
{
|
||||
double dx = pt1.x - pt2.x;
|
||||
double dy = pt1.y - pt2.y;
|
||||
|
||||
return dx*dx + dy*dy;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
CV_INLINE double cvTriangleArea( CvPoint2D32f a, CvPoint2D32f b, CvPoint2D32f c )
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user