Class Subdiv2D
Planar Subdivision
Implements
Inherited Members
Namespace: OpenCvSharp
Assembly: OpenCvSharp.dll
Syntax
public class Subdiv2D : DisposableCvObject, ICvPtrHolder
Constructors
| Improve this Doc View SourceSubdiv2D()
Creates an empty Subdiv2D object. To create a new empty Delaunay subdivision you need to use the #initDelaunay function.
Declaration
public Subdiv2D()
Subdiv2D(Rect)
Creates an empty Subdiv2D object.
Declaration
public Subdiv2D(Rect rect)
Parameters
Type | Name | Description |
---|---|---|
OpenCvSharp.Rect | rect | Rectangle that includes all of the 2D points that are to be added to the subdivision. |
Fields
| Improve this Doc View SourceNEXT_AROUND_DST
Declaration
public const int NEXT_AROUND_DST = 34
Field Value
Type | Description |
---|---|
System.Int32 |
NEXT_AROUND_LEFT
Declaration
public const int NEXT_AROUND_LEFT = 19
Field Value
Type | Description |
---|---|
System.Int32 |
NEXT_AROUND_ORG
Declaration
public const int NEXT_AROUND_ORG = 0
Field Value
Type | Description |
---|---|
System.Int32 |
NEXT_AROUND_RIGHT
Declaration
public const int NEXT_AROUND_RIGHT = 49
Field Value
Type | Description |
---|---|
System.Int32 |
PREV_AROUND_DST
Declaration
public const int PREV_AROUND_DST = 51
Field Value
Type | Description |
---|---|
System.Int32 |
PREV_AROUND_LEFT
Declaration
public const int PREV_AROUND_LEFT = 32
Field Value
Type | Description |
---|---|
System.Int32 |
PREV_AROUND_ORG
Declaration
public const int PREV_AROUND_ORG = 17
Field Value
Type | Description |
---|---|
System.Int32 |
PREV_AROUND_RIGHT
Declaration
public const int PREV_AROUND_RIGHT = 2
Field Value
Type | Description |
---|---|
System.Int32 |
PTLOC_ERROR
Declaration
public const int PTLOC_ERROR = -2
Field Value
Type | Description |
---|---|
System.Int32 |
PTLOC_INSIDE
Declaration
public const int PTLOC_INSIDE = 0
Field Value
Type | Description |
---|---|
System.Int32 |
PTLOC_ON_EDGE
Declaration
public const int PTLOC_ON_EDGE = 2
Field Value
Type | Description |
---|---|
System.Int32 |
PTLOC_OUTSIDE_RECT
Declaration
public const int PTLOC_OUTSIDE_RECT = -1
Field Value
Type | Description |
---|---|
System.Int32 |
PTLOC_VERTEX
Declaration
public const int PTLOC_VERTEX = 1
Field Value
Type | Description |
---|---|
System.Int32 |
Methods
| Improve this Doc View SourceDisposeUnmanaged()
Releases unmanaged resources
Declaration
protected override void DisposeUnmanaged()
Overrides
| Improve this Doc View SourceEdgeDst(Int32, out Point2f)
Returns the edge destination.
Declaration
public int EdgeDst(int edge, out Point2f dstPt)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | edge | Subdivision edge ID. |
OpenCvSharp.Point2f | dstPt | Output vertex location. |
Returns
Type | Description |
---|---|
System.Int32 | vertex ID. |
EdgeOrg(Int32, out Point2f)
Returns the edge origin.
Declaration
public int EdgeOrg(int edge, out Point2f orgPt)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | edge | Subdivision edge ID. |
OpenCvSharp.Point2f | orgPt | Output vertex location. |
Returns
Type | Description |
---|---|
System.Int32 | vertex ID. |
FindNearest(Point2f, out Point2f)
Finds the subdivision vertex closest to the given point.
Declaration
public int FindNearest(Point2f pt, out Point2f nearestPt)
Parameters
Type | Name | Description |
---|---|---|
OpenCvSharp.Point2f | pt | Input point. |
OpenCvSharp.Point2f | nearestPt | Output subdivision vertex point. |
Returns
Type | Description |
---|---|
System.Int32 | vertex ID. |
GetEdge(Int32, NextEdgeType)
Returns one of the edges related to the given edge.
Declaration
public int GetEdge(int edge, NextEdgeType nextEdgeType)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | edge | Subdivision edge ID. |
NextEdgeType | nextEdgeType | Parameter specifying which of the related edges to return. The following values are possible:
|
Returns
Type | Description |
---|---|
System.Int32 |
GetEdgeList()
Returns a list of all edges.
Declaration
public Vec4f[] GetEdgeList()
Returns
Type | Description |
---|---|
Vec4f[] | Output vector. |
GetLeadingEdgeList()
Returns a list of the leading edge ID connected to each triangle. The function gives one edge ID for each triangle.
Declaration
public int[] GetLeadingEdgeList()
Returns
Type | Description |
---|---|
System.Int32[] | Output vector. |
GetTriangleList()
Returns a list of all triangles.
Declaration
public Vec6f[] GetTriangleList()
Returns
Type | Description |
---|---|
Vec6f[] | Output vector. |
GetVertex(Int32, out Int32)
Returns vertex location from vertex ID.
Declaration
public Point2f GetVertex(int vertex, out int firstEdge)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | vertex | vertex ID. |
System.Int32 | firstEdge | The first edge ID which is connected to the vertex. |
Returns
Type | Description |
---|---|
OpenCvSharp.Point2f | vertex (x,y) |
GetVoronoiFacetList(Nullable<IEnumerable<Int32>>, out Point2f[][], out Point2f[])
Returns a list of all Voronoi facets.
Declaration
public void GetVoronoiFacetList(IEnumerable<int>? idx, out Point2f[][] facetList, out Point2f[] facetCenters)
Parameters
Type | Name | Description |
---|---|---|
System.Nullable<IEnumerable<System.Int32>> | idx | Vector of vertices IDs to consider. For all vertices you can pass empty vector. |
OpenCvSharp.Point2f[][] | facetList | Output vector of the Voronoi facets. |
OpenCvSharp.Point2f[] | facetCenters | Output vector of the Voronoi facets center points. |
InitDelaunay(Rect)
Creates a new empty Delaunay subdivision
Declaration
public void InitDelaunay(Rect rect)
Parameters
Type | Name | Description |
---|---|---|
OpenCvSharp.Rect | rect | Rectangle that includes all of the 2D points that are to be added to the subdivision. |
Insert(IEnumerable<Point2f>)
Insert multiple points into a Delaunay triangulation.
Declaration
public void Insert(IEnumerable<Point2f> ptVec)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<OpenCvSharp.Point2f> | ptVec | Points to insert. |
Insert(Point2f)
Insert a single point into a Delaunay triangulation.
Declaration
public int Insert(Point2f pt)
Parameters
Type | Name | Description |
---|---|---|
OpenCvSharp.Point2f | pt | Point to insert. |
Returns
Type | Description |
---|---|
System.Int32 |
Locate(Point2f, out Int32, out Int32)
Returns the location of a point within a Delaunay triangulation.
Declaration
public int Locate(Point2f pt, out int edge, out int vertex)
Parameters
Type | Name | Description |
---|---|---|
OpenCvSharp.Point2f | pt | Point to locate. |
System.Int32 | edge | Output edge that the point belongs to or is located to the right of it. |
System.Int32 | vertex | Optional output vertex the input point coincides with. |
Returns
Type | Description |
---|---|
System.Int32 | an integer which specify one of the following five cases for point location:
|
NextEdge(Int32)
Subdivision edge ID.
Declaration
public int NextEdge(int edge)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | edge | Subdivision edge ID. |
Returns
Type | Description |
---|---|
System.Int32 | an integer which is next edge ID around the edge origin: eOnext on the picture above if e is the input edge). |
Release()
Clean up any resources being used.
Declaration
public void Release()
RotateEdge(Int32, Int32)
Returns another edge of the same quad-edge.
Declaration
public int RotateEdge(int edge, int rotate)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | edge | Subdivision edge ID. |
System.Int32 | rotate | Parameter specifying which of the edges of the same quad-edge as the input one to return. The following values are possible:
|
Returns
Type | Description |
---|---|
System.Int32 | one of the edges ID of the same quad-edge as the input edge. |
SymEdge(Int32)
Declaration
public int SymEdge(int edge)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | edge |
Returns
Type | Description |
---|---|
System.Int32 |