@Namespace(value="cv") @NoOffset @Properties(inherit=opencv_imgproc.class) public class Subdiv2D extends Pointer
\addtogroup imgproc_subdiv2d \{
Pointer.CustomDeallocator, Pointer.Deallocator, Pointer.NativeDeallocator, Pointer.ReferenceCounter
Modifier and Type | Field and Description |
---|---|
static int |
NEXT_AROUND_DST
enum cv::Subdiv2D::
|
static int |
NEXT_AROUND_LEFT
enum cv::Subdiv2D::
|
static int |
NEXT_AROUND_ORG
enum cv::Subdiv2D::
|
static int |
NEXT_AROUND_RIGHT
enum cv::Subdiv2D::
|
static int |
PREV_AROUND_DST
enum cv::Subdiv2D::
|
static int |
PREV_AROUND_LEFT
enum cv::Subdiv2D::
|
static int |
PREV_AROUND_ORG
enum cv::Subdiv2D::
|
static int |
PREV_AROUND_RIGHT
enum cv::Subdiv2D::
|
static int |
PTLOC_ERROR
enum cv::Subdiv2D::
|
static int |
PTLOC_INSIDE
enum cv::Subdiv2D::
|
static int |
PTLOC_ON_EDGE
enum cv::Subdiv2D::
|
static int |
PTLOC_OUTSIDE_RECT
enum cv::Subdiv2D::
|
static int |
PTLOC_VERTEX
enum cv::Subdiv2D::
|
Constructor and Description |
---|
Subdiv2D()
creates an empty Subdiv2D object.
|
Subdiv2D(long size)
Native array allocator.
|
Subdiv2D(Pointer p)
Pointer cast constructor.
|
Subdiv2D(Rect rect)
\overload
|
Modifier and Type | Method and Description |
---|---|
int |
edgeDst(int edge) |
int |
edgeDst(int edge,
Point2f dstpt)
\brief Returns the edge destination.
|
int |
edgeOrg(int edge) |
int |
edgeOrg(int edge,
Point2f orgpt)
\brief Returns the edge origin.
|
int |
findNearest(Point2f pt) |
int |
findNearest(Point2f pt,
Point2f nearestPt)
\brief Finds the subdivision vertex closest to the given point.
|
int |
getEdge(int edge,
int nextEdgeType)
\brief Returns one of the edges related to the given edge.
|
void |
getEdgeList(Vec4fVector edgeList)
\brief Returns a list of all edges.
|
void |
getLeadingEdgeList(int[] leadingEdgeList) |
void |
getLeadingEdgeList(IntBuffer leadingEdgeList) |
void |
getLeadingEdgeList(IntPointer leadingEdgeList)
\brief Returns a list of the leading edge ID connected to each triangle.
|
void |
getTriangleList(Vec6fVector triangleList)
\brief Returns a list of all triangles.
|
Point2f |
getVertex(int vertex) |
Point2f |
getVertex(int vertex,
int[] firstEdge) |
Point2f |
getVertex(int vertex,
IntBuffer firstEdge) |
Point2f |
getVertex(int vertex,
IntPointer firstEdge)
\brief Returns vertex location from vertex ID.
|
void |
getVoronoiFacetList(int[] idx,
Point2fVectorVector facetList,
Point2fVector facetCenters) |
void |
getVoronoiFacetList(IntBuffer idx,
Point2fVectorVector facetList,
Point2fVector facetCenters) |
void |
getVoronoiFacetList(IntPointer idx,
Point2fVectorVector facetList,
Point2fVector facetCenters)
\brief Returns a list of all Voronoi facets.
|
void |
initDelaunay(Rect rect)
\brief Creates a new empty Delaunay subdivision
|
int |
insert(Point2f pt)
\brief Insert a single point into a Delaunay triangulation.
|
void |
insert(Point2fVector ptvec)
\brief Insert multiple points into a Delaunay triangulation.
|
int |
locate(Point2f pt,
int[] edge,
int[] vertex) |
int |
locate(Point2f pt,
IntBuffer edge,
IntBuffer vertex) |
int |
locate(Point2f pt,
IntPointer edge,
IntPointer vertex)
\brief Returns the location of a point within a Delaunay triangulation.
|
int |
nextEdge(int edge)
\brief Returns next edge around the edge origin.
|
Subdiv2D |
position(long position) |
int |
rotateEdge(int edge,
int rotate)
\brief Returns another edge of the same quad-edge.
|
int |
symEdge(int edge) |
address, asBuffer, asByteBuffer, availablePhysicalBytes, calloc, capacity, capacity, close, deallocate, deallocate, deallocateReferences, deallocator, deallocator, equals, fill, formatBytes, free, hashCode, isNull, isNull, limit, limit, malloc, maxBytes, maxPhysicalBytes, memchr, memcmp, memcpy, memmove, memset, offsetof, parseBytes, physicalBytes, position, put, realloc, referenceCount, releaseReference, retainReference, setNull, sizeof, toString, totalBytes, totalPhysicalBytes, withDeallocator, zero
public static final int PTLOC_ERROR
public static final int PTLOC_OUTSIDE_RECT
public static final int PTLOC_INSIDE
public static final int PTLOC_VERTEX
public static final int PTLOC_ON_EDGE
public static final int NEXT_AROUND_ORG
public static final int NEXT_AROUND_DST
public static final int PREV_AROUND_ORG
public static final int PREV_AROUND_DST
public static final int NEXT_AROUND_LEFT
public static final int NEXT_AROUND_RIGHT
public static final int PREV_AROUND_LEFT
public static final int PREV_AROUND_RIGHT
public Subdiv2D(Pointer p)
Pointer.Pointer(Pointer)
.public Subdiv2D(long size)
Pointer.position(long)
.public Subdiv2D()
public Subdiv2D(@ByVal Rect rect)
rect
- Rectangle that includes all of the 2D points that are to be added to the subdivision.
The function creates an empty Delaunay subdivision where 2D points can be added using the function insert() . All of the points to be added must be within the specified rectangle, otherwise a runtime error is raised.
public void initDelaunay(@ByVal Rect rect)
rect
- Rectangle that includes all of the 2D points that are to be added to the subdivision.
public int insert(@ByVal Point2f pt)
pt
- Point to insert.
The function inserts a single point into a subdivision and modifies the subdivision topology appropriately. If a point with the same coordinates exists already, no new point is added.
\note If the point is outside of the triangulation specified rect a runtime error is raised.
public void insert(@Const @ByRef Point2fVector ptvec)
ptvec
- Points to insert.
The function inserts a vector of points into a subdivision and modifies the subdivision topology appropriately.
public int locate(@ByVal Point2f pt, @ByRef IntPointer edge, @ByRef IntPointer vertex)
pt
- Point to locate.edge
- Output edge that the point belongs to or is located to the right of it.vertex
- Optional output vertex the input point coincides with.
The function locates the input point within the subdivision and gives one of the triangle edges or vertices.
public int findNearest(@ByVal Point2f pt, Point2f nearestPt)
pt
- Input point.nearestPt
- Output subdivision vertex point.
The function is another function that locates the input point within the subdivision. It finds the subdivision vertex that is the closest to the input point. It is not necessarily one of vertices of the facet containing the input point, though the facet (located using locate() ) is used as a starting point.
public void getEdgeList(@ByRef Vec4fVector edgeList)
edgeList
- Output vector.
The function gives each edge as a 4 numbers vector, where each two are one of the edge vertices. i.e. org_x = v[0], org_y = v[1], dst_x = v[2], dst_y = v[3].
public void getLeadingEdgeList(@StdVector IntPointer leadingEdgeList)
leadingEdgeList
- Output vector.
The function gives one edge ID for each triangle.
public void getLeadingEdgeList(@StdVector IntBuffer leadingEdgeList)
public void getLeadingEdgeList(@StdVector int[] leadingEdgeList)
public void getTriangleList(@ByRef Vec6fVector triangleList)
triangleList
- Output vector.
The function gives each triangle as a 6 numbers vector, where each two are one of the triangle vertices. i.e. p1_x = v[0], p1_y = v[1], p2_x = v[2], p2_y = v[3], p3_x = v[4], p3_y = v[5].
public void getVoronoiFacetList(@StdVector IntPointer idx, @ByRef Point2fVectorVector facetList, @ByRef Point2fVector facetCenters)
idx
- Vector of vertices IDs to consider. For all vertices you can pass empty vector.facetList
- Output vector of the Voronoi facets.facetCenters
- Output vector of the Voronoi facets center points.
public void getVoronoiFacetList(@StdVector IntBuffer idx, @ByRef Point2fVectorVector facetList, @ByRef Point2fVector facetCenters)
public void getVoronoiFacetList(@StdVector int[] idx, @ByRef Point2fVectorVector facetList, @ByRef Point2fVector facetCenters)
@ByVal public Point2f getVertex(int vertex, IntPointer firstEdge)
vertex
- vertex ID.firstEdge
- Optional. The first edge ID which is connected to the vertex.public int getEdge(int edge, int nextEdgeType)
edge
- Subdivision edge ID.nextEdgeType
- Parameter specifying which of the related edges to return.
The following values are possible:
- NEXT_AROUND_ORG next around the edge origin ( eOnext on the picture below if e is the input edge)
- NEXT_AROUND_DST next around the edge vertex ( eDnext )
- PREV_AROUND_ORG previous around the edge origin (reversed eRnext )
- PREV_AROUND_DST previous around the edge destination (reversed eLnext )
- NEXT_AROUND_LEFT next around the left facet ( eLnext )
- NEXT_AROUND_RIGHT next around the right facet ( eRnext )
- PREV_AROUND_LEFT previous around the left facet (reversed eOnext )
- PREV_AROUND_RIGHT previous around the right facet (reversed eDnext )

public int nextEdge(int edge)
edge
- Subdivision edge ID.
public int rotateEdge(int edge, int rotate)
edge
- Subdivision edge ID.rotate
- Parameter specifying which of the edges of the same quad-edge as the input
one to return. The following values are possible:
- 0 - the input edge ( e on the picture below if e is the input edge)
- 1 - the rotated edge ( eRot )
- 2 - the reversed edge (reversed e (in green))
- 3 - the reversed rotated edge (reversed eRot (in green))
public int symEdge(int edge)
public int edgeOrg(int edge, Point2f orgpt)
edge
- Subdivision edge ID.orgpt
- Output vertex location.
public int edgeOrg(int edge)
public int edgeDst(int edge, Point2f dstpt)
edge
- Subdivision edge ID.dstpt
- Output vertex location.
public int edgeDst(int edge)
Copyright © 2020. All rights reserved.