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
c9ed7fee
Commit
c9ed7fee
authored
Aug 10, 2011
by
Vadim Pisarevsky
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed C++ implementation of Delaunay triangulation and moved it from sample to imgproc.
parent
edcfa64d
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
95 additions
and
1 deletion
+95
-1
imgproc.hpp
modules/imgproc/include/opencv2/imgproc/imgproc.hpp
+92
-0
subdivision2d.cpp
modules/imgproc/src/subdivision2d.cpp
+0
-0
cv2.cpp
modules/python/src2/cv2.cpp
+2
-0
gen2.py
modules/python/src2/gen2.py
+1
-1
delaunay2.cpp
samples/cpp/delaunay2.cpp
+0
-0
No files found.
modules/imgproc/include/opencv2/imgproc/imgproc.hpp
View file @
c9ed7fee
...
...
@@ -1017,6 +1017,98 @@ CV_EXPORTS_W void fitLine( InputArray points, OutputArray line, int distType,
//! checks if the point is inside the contour. Optionally computes the signed distance from the point to the contour boundary
CV_EXPORTS_W
double
pointPolygonTest
(
InputArray
contour
,
Point2f
pt
,
bool
measureDist
);
class
CV_EXPORTS_W
Subdiv2D
{
public
:
enum
{
PTLOC_ERROR
=
-
2
,
PTLOC_OUTSIDE_RECT
=
-
1
,
PTLOC_INSIDE
=
0
,
PTLOC_VERTEX
=
1
,
PTLOC_ON_EDGE
=
2
};
enum
{
NEXT_AROUND_ORG
=
0x00
,
NEXT_AROUND_DST
=
0x22
,
PREV_AROUND_ORG
=
0x11
,
PREV_AROUND_DST
=
0x33
,
NEXT_AROUND_LEFT
=
0x13
,
NEXT_AROUND_RIGHT
=
0x31
,
PREV_AROUND_LEFT
=
0x20
,
PREV_AROUND_RIGHT
=
0x02
};
CV_WRAP
Subdiv2D
();
CV_WRAP
Subdiv2D
(
Rect
rect
);
CV_WRAP
void
initDelaunay
(
Rect
rect
);
CV_WRAP
int
insert
(
Point2f
pt
);
CV_WRAP
void
insert
(
const
vector
<
Point2f
>&
ptvec
);
CV_WRAP
int
locate
(
Point2f
pt
,
CV_OUT
int
&
edge
,
CV_OUT
int
&
vertex
);
CV_WRAP
int
findNearest
(
Point2f
pt
,
CV_OUT
Point2f
*
nearestPt
=
0
);
CV_WRAP
void
getEdgeList
(
CV_OUT
vector
<
Vec4f
>&
edgeList
)
const
;
CV_WRAP
void
getTriangleList
(
CV_OUT
vector
<
Vec6f
>&
triangleList
)
const
;
CV_WRAP
void
getVoronoiFacetList
(
const
vector
<
int
>&
idx
,
CV_OUT
vector
<
vector
<
Point2f
>
>&
facetList
,
CV_OUT
vector
<
Point2f
>&
facetCenters
);
CV_WRAP
Point2f
getVertex
(
int
vertex
,
CV_OUT
int
*
firstEdge
=
0
)
const
;
CV_WRAP
int
getEdge
(
int
edge
,
int
nextEdgeType
)
const
;
CV_WRAP
int
nextEdge
(
int
edge
)
const
;
CV_WRAP
int
rotateEdge
(
int
edge
,
int
rotate
)
const
;
CV_WRAP
int
symEdge
(
int
edge
)
const
;
CV_WRAP
int
edgeOrg
(
int
edge
,
CV_OUT
Point2f
*
orgpt
=
0
)
const
;
CV_WRAP
int
edgeDst
(
int
edge
,
CV_OUT
Point2f
*
dstpt
=
0
)
const
;
protected
:
int
newEdge
();
void
deleteEdge
(
int
edge
);
int
newPoint
(
Point2f
pt
,
bool
isvirtual
,
int
firstEdge
=
0
);
void
deletePoint
(
int
vtx
);
void
setEdgePoints
(
int
edge
,
int
orgPt
,
int
dstPt
);
void
splice
(
int
edgeA
,
int
edgeB
);
int
connectEdges
(
int
edgeA
,
int
edgeB
);
void
swapEdges
(
int
edge
);
int
isRightOf
(
Point2f
pt
,
int
edge
)
const
;
void
calcVoronoi
();
void
clearVoronoi
();
void
check
()
const
;
struct
CV_EXPORTS
Vertex
{
Vertex
();
Vertex
(
Point2f
pt
,
bool
_isvirtual
,
int
_firstEdge
=
0
);
bool
isvirtual
()
const
;
bool
isfree
()
const
;
int
firstEdge
;
int
type
;
Point2f
pt
;
};
struct
CV_EXPORTS
QuadEdge
{
QuadEdge
();
QuadEdge
(
int
edgeidx
);
bool
isfree
()
const
;
int
next
[
4
];
int
pt
[
4
];
};
vector
<
Vertex
>
vtx
;
vector
<
QuadEdge
>
qedges
;
int
freeQEdge
;
int
freePoint
;
bool
validGeometry
;
int
recentEdge
;
Point2f
topLeft
;
Point2f
bottomRight
;
};
}
// 2009-01-12, Xavier Delacour <xavier.delacour@gmail.com>
...
...
modules/imgproc/src/subdivision2d.cpp
View file @
c9ed7fee
This diff is collapsed.
Click to expand it.
modules/python/src2/cv2.cpp
View file @
c9ed7fee
...
...
@@ -58,6 +58,8 @@ typedef vector<Point> vector_Point;
typedef
vector
<
Point2f
>
vector_Point2f
;
typedef
vector
<
Vec2f
>
vector_Vec2f
;
typedef
vector
<
Vec3f
>
vector_Vec3f
;
typedef
vector
<
Vec4f
>
vector_Vec4f
;
typedef
vector
<
Vec6f
>
vector_Vec6f
;
typedef
vector
<
Vec4i
>
vector_Vec4i
;
typedef
vector
<
Rect
>
vector_Rect
;
typedef
vector
<
KeyPoint
>
vector_KeyPoint
;
...
...
modules/python/src2/gen2.py
View file @
c9ed7fee
...
...
@@ -566,7 +566,7 @@ class FuncInfo(object):
amapping
=
simple_argtype_mapping
.
get
(
tp
,
(
tp
,
"O"
,
"0"
))
all_cargs
.
append
(
amapping
)
if
v
.
args
:
if
v
.
args
and
v
.
py_arglist
:
# form the format spec for PyArg_ParseTupleAndKeywords
fmtspec
=
""
.
join
([
all_cargs
[
argno
][
0
][
1
]
for
aname
,
argno
in
v
.
py_arglist
])
if
v
.
py_noptargs
>
0
:
...
...
samples/cpp/delaunay2.cpp
View file @
c9ed7fee
This diff is collapsed.
Click to expand it.
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