Show / Hide Table of Contents

Class Subdiv2D

Planar Subdivision

Inheritance
System.Object
DisposableObject
DisposableCvObject
Subdiv2D
Implements
ICvPtrHolder
Inherited Members
DisposableCvObject.ptr
DisposableCvObject.CvPtr
DisposableObject.DataHandle
DisposableObject.IsDisposed
DisposableObject.IsEnabledDispose
DisposableObject.AllocatedMemory
DisposableObject.AllocatedMemorySize
DisposableObject.Dispose()
DisposableObject.Dispose(Boolean)
DisposableObject.DisposeManaged()
DisposableObject.AllocGCHandle(Object)
DisposableObject.AllocMemory(Int32)
DisposableObject.NotifyMemoryPressure(Int64)
DisposableObject.ThrowIfDisposed()
Namespace: OpenCvSharp
Assembly: OpenCvSharp.dll
Syntax
public class Subdiv2D : DisposableCvObject, ICvPtrHolder

Constructors

| Improve this Doc View Source

Subdiv2D()

Creates an empty Subdiv2D object. To create a new empty Delaunay subdivision you need to use the #initDelaunay function.

Declaration
public Subdiv2D()
| Improve this Doc View Source

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 Source

NEXT_AROUND_DST

Declaration
public const int NEXT_AROUND_DST = 34
Field Value
Type Description
System.Int32
| Improve this Doc View Source

NEXT_AROUND_LEFT

Declaration
public const int NEXT_AROUND_LEFT = 19
Field Value
Type Description
System.Int32
| Improve this Doc View Source

NEXT_AROUND_ORG

Declaration
public const int NEXT_AROUND_ORG = 0
Field Value
Type Description
System.Int32
| Improve this Doc View Source

NEXT_AROUND_RIGHT

Declaration
public const int NEXT_AROUND_RIGHT = 49
Field Value
Type Description
System.Int32
| Improve this Doc View Source

PREV_AROUND_DST

Declaration
public const int PREV_AROUND_DST = 51
Field Value
Type Description
System.Int32
| Improve this Doc View Source

PREV_AROUND_LEFT

Declaration
public const int PREV_AROUND_LEFT = 32
Field Value
Type Description
System.Int32
| Improve this Doc View Source

PREV_AROUND_ORG

Declaration
public const int PREV_AROUND_ORG = 17
Field Value
Type Description
System.Int32
| Improve this Doc View Source

PREV_AROUND_RIGHT

Declaration
public const int PREV_AROUND_RIGHT = 2
Field Value
Type Description
System.Int32
| Improve this Doc View Source

PTLOC_ERROR

Declaration
public const int PTLOC_ERROR = -2
Field Value
Type Description
System.Int32
| Improve this Doc View Source

PTLOC_INSIDE

Declaration
public const int PTLOC_INSIDE = 0
Field Value
Type Description
System.Int32
| Improve this Doc View Source

PTLOC_ON_EDGE

Declaration
public const int PTLOC_ON_EDGE = 2
Field Value
Type Description
System.Int32
| Improve this Doc View Source

PTLOC_OUTSIDE_RECT

Declaration
public const int PTLOC_OUTSIDE_RECT = -1
Field Value
Type Description
System.Int32
| Improve this Doc View Source

PTLOC_VERTEX

Declaration
public const int PTLOC_VERTEX = 1
Field Value
Type Description
System.Int32

Methods

| Improve this Doc View Source

DisposeUnmanaged()

Releases unmanaged resources

Declaration
protected override void DisposeUnmanaged()
Overrides
DisposableCvObject.DisposeUnmanaged()
| Improve this Doc View Source

EdgeDst(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.

| Improve this Doc View Source

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.

| Improve this Doc View Source

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.

| Improve this Doc View Source

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:

  • 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 )
Returns
Type Description
System.Int32
| Improve this Doc View Source

GetEdgeList()

Returns a list of all edges.

Declaration
public Vec4f[] GetEdgeList()
Returns
Type Description
Vec4f[]

Output vector.

| Improve this Doc View Source

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.

| Improve this Doc View Source

GetTriangleList()

Returns a list of all triangles.

Declaration
public Vec6f[] GetTriangleList()
Returns
Type Description
Vec6f[]

Output vector.

| Improve this Doc View Source

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)

| Improve this Doc View Source

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.

| Improve this Doc View Source

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.

| Improve this Doc View Source

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.

| Improve this Doc View Source

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
| Improve this Doc View Source

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:

  • The point falls into some facet. The function returns #PTLOC_INSIDE and edge will contain one of edges of the facet.
  • The point falls onto the edge. The function returns #PTLOC_ON_EDGE and edge will contain this edge.
  • The point coincides with one of the subdivision vertices. The function returns #PTLOC_VERTEX and vertex will contain a pointer to the vertex.
  • The point is outside the subdivision reference rectangle. The function returns #PTLOC_OUTSIDE_RECT and no pointers are filled.
  • One of input arguments is invalid. A runtime error is raised or, if silent or "parent" error processing mode is selected, #PTLOC_ERROR is returned.
| Improve this Doc View Source

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).

| Improve this Doc View Source

Release()

Clean up any resources being used.

Declaration
public void Release()
| Improve this Doc View Source

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:

  • 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))
Returns
Type Description
System.Int32

one of the edges ID of the same quad-edge as the input edge.

| Improve this Doc View Source

SymEdge(Int32)

Declaration
public int SymEdge(int edge)
Parameters
Type Name Description
System.Int32 edge
Returns
Type Description
System.Int32

Implements

ICvPtrHolder
  • Improve this Doc
  • View Source
In This Article
Back to top Generated by DocFX