OpenCV 5.0.0
Open Source Computer Vision
Loading...
Searching...
No Matches
cv::Subdiv2D Class Reference

#include <opencv2/geometry/2d.hpp>

Classes

struct  QuadEdge
struct  Vertex

Public Types

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
}

Public Member Functions

 Subdiv2D ()
 Subdiv2D (Rect rect)
 Subdiv2D (Rect2f rect2f)
int edgeDst (int edge, Point2f *dstpt=0) const
 Returns the edge destination.
int edgeOrg (int edge, Point2f *orgpt=0) const
 Returns the edge origin.
int findNearest (Point2f pt, Point2f *nearestPt=0)
 Finds the subdivision vertex closest to the given point.
int getEdge (int edge, int nextEdgeType) const
 Returns one of the edges related to the given edge.
void getEdgeList (std::vector< Vec4f > &edgeList) const
 Returns a list of all edges.
void getLeadingEdgeList (std::vector< int > &leadingEdgeList) const
 Returns a list of the leading edge ID connected to each triangle.
void getTriangleList (std::vector< Vec6f > &triangleList) const
 Returns a list of all triangles.
Point2f getVertex (int vertex, int *firstEdge=0) const
 Returns vertex location from vertex ID.
void getVoronoiFacetList (const std::vector< int > &idx, std::vector< std::vector< Point2f > > &facetList, std::vector< Point2f > &facetCenters)
 Returns a list of all Voronoi facets.
void initDelaunay (Rect rect)
 Creates a new empty Delaunay subdivision.
void initDelaunay (Rect2f rect)
 Creates a new empty Delaunay subdivision.
void insert (const std::vector< Point2f > &ptvec)
 Insert multiple points into a Delaunay triangulation.
int insert (Point2f pt)
 Insert a single point into a Delaunay triangulation.
int locate (Point2f pt, int &edge, int &vertex)
 Returns the location of a point within a Delaunay triangulation.
int nextEdge (int edge) const
 Returns next edge around the edge origin.
int rotateEdge (int edge, int rotate) const
 Returns another edge of the same quad-edge.
int symEdge (int edge) const

Protected Member Functions

void calcVoronoi ()
void checkSubdiv () const
void clearVoronoi ()
int connectEdges (int edgeA, int edgeB)
void deleteEdge (int edge)
void deletePoint (int vtx)
int isRightOf (Point2f pt, int edge) const
int newEdge ()
int newPoint (Point2f pt, bool isvirtual, int firstEdge=0)
void setEdgePoints (int edge, int orgPt, int dstPt)
void splice (int edgeA, int edgeB)
void swapEdges (int edge)

Protected Attributes

Point2f bottomRight
 Bottom right corner of the bounding rect.
int freePoint
int freeQEdge
std::vector< QuadEdgeqedges
 All of the edges.
int recentEdge
Point2f topLeft
 Top left corner of the bounding rect.
bool validGeometry
std::vector< Vertexvtx
 All of the vertices.

The documentation for this class was generated from the following file: