OpenCV  3.4.1
Open Source Computer Vision
Classes | Enumerations
Planar Subdivision

Classes

struct  cv::Subdiv2D::QuadEdge
 
class  cv::Subdiv2D
 
struct  cv::Subdiv2D::Vertex
 

Enumerations

enum  {
  cv::Subdiv2D::PTLOC_ERROR = -2,
  cv::Subdiv2D::PTLOC_OUTSIDE_RECT = -1,
  cv::Subdiv2D::PTLOC_INSIDE = 0,
  cv::Subdiv2D::PTLOC_VERTEX = 1,
  cv::Subdiv2D::PTLOC_ON_EDGE = 2
}
 
enum  {
  cv::Subdiv2D::NEXT_AROUND_ORG = 0x00,
  cv::Subdiv2D::NEXT_AROUND_DST = 0x22,
  cv::Subdiv2D::PREV_AROUND_ORG = 0x11,
  cv::Subdiv2D::PREV_AROUND_DST = 0x33,
  cv::Subdiv2D::NEXT_AROUND_LEFT = 0x13,
  cv::Subdiv2D::NEXT_AROUND_RIGHT = 0x31,
  cv::Subdiv2D::PREV_AROUND_LEFT = 0x20,
  cv::Subdiv2D::PREV_AROUND_RIGHT = 0x02
}
 

Detailed Description

The Subdiv2D class described in this section is used to perform various planar subdivision on a set of 2D points (represented as vector of Point2f). OpenCV subdivides a plane into triangles using the Delaunay's algorithm, which corresponds to the dual graph of the Voronoi diagram. In the figure below, the Delaunay's triangulation is marked with black lines and the Voronoi diagram with red lines.

delaunay_voronoi.png
Delaunay triangulation (black) and Voronoi (red)

The subdivisions can be used for the 3D piece-wise transformation of a plane, morphing, fast location of points on the plane, building special graphs (such as NNG,RNG), and so forth.

Enumeration Type Documentation

anonymous enum

Subdiv2D point location cases

Enumerator
PTLOC_ERROR 

Point location error.

PTLOC_OUTSIDE_RECT 

Point outside the subdivision bounding rect.

PTLOC_INSIDE 

Point inside some facet.

PTLOC_VERTEX 

Point coincides with one of the subdivision vertices.

PTLOC_ON_EDGE 

Point on some edge.

anonymous enum

Subdiv2D edge type navigation (see: getEdge())

Enumerator
NEXT_AROUND_ORG 
NEXT_AROUND_DST 
PREV_AROUND_ORG 
PREV_AROUND_DST 
NEXT_AROUND_LEFT 
NEXT_AROUND_RIGHT 
PREV_AROUND_LEFT 
PREV_AROUND_RIGHT