Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
O
opencv
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
opencv
Commits
4aaaef59
Commit
4aaaef59
authored
May 28, 2012
by
Andrey Kamaev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remaining C-style planar subdivisions data structures are moved to legacy
parent
5c13b870
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
94 additions
and
100 deletions
+94
-100
types_c.h
modules/imgproc/include/opencv2/imgproc/types_c.h
+0
-73
_geom.h
modules/imgproc/src/_geom.h
+0
-2
legacy.hpp
modules/legacy/include/opencv2/legacy/legacy.hpp
+94
-25
No files found.
modules/imgproc/include/opencv2/imgproc/types_c.h
View file @
4aaaef59
...
...
@@ -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
{
...
...
modules/imgproc/src/_geom.h
View file @
4aaaef59
...
...
@@ -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
);
...
...
modules/legacy/include/opencv2/legacy/legacy.hpp
View file @
4aaaef59
...
...
@@ -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
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment