#include <opencv2/imgproc.hpp>
|
| 列舉 | {
PTLOC_ERROR = -2
,
PTLOC_OUTSIDE_RECT = -1
,
PTLOC_INSIDE = 0
,
PTLOC_VERTEX = 1
,
PTLOC_ON_EDGE = 2
} |
| |
| 列舉 | {
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
} |
| |
|
| | Subdiv2D () |
| |
| | Subdiv2D (Rect rect) |
| |
| int | edgeDst (int edge, Point2f *dstpt=0) const |
| | 返回邊的目標。
|
| |
| int | edgeOrg (int edge, Point2f *orgpt=0) const |
| | 返回邊的起點。
|
| |
| int | findNearest (Point2f pt, Point2f *nearestPt=0) |
| | 查詢最接近給定點的細分頂點。
|
| |
| int | getEdge (int edge, int nextEdgeType) const |
| | 返回與給定邊相關的邊之一。
|
| |
| void | getEdgeList (std::vector< Vec4f > &edgeList) const |
| | 返回所有邊的列表。
|
| |
| void | getLeadingEdgeList (std::vector< int > &leadingEdgeList) const |
| | 返回連線到每個三角形的引導邊ID列表。
|
| |
| void | getTriangleList (std::vector< Vec6f > &triangleList) const |
| | 返回所有三角形的列表。
|
| |
| Point2f | getVertex (int vertex, int *firstEdge=0) const |
| | 從頂點 ID 返回頂點位置。
|
| |
| void | getVoronoiFacetList (const std::vector< int > &idx, std::vector< std::vector< Point2f > > &facetList, std::vector< Point2f > &facetCenters) |
| | 返回所有 Voronoi 面片的列表。
|
| |
| void | initDelaunay (Rect rect) |
| | 建立一個新的空Delaunay細分。
|
| |
| void | insert (const std::vector< Point2f > &ptvec) |
| | 將多個點插入到 Delaunay 三角剖分中。
|
| |
| int | insert (Point2f pt) |
| | 將單個點插入到 Delaunay 三角剖分中。
|
| |
| int | locate (Point2f pt, int &edge, int &vertex) |
| | 返回 Delaunay 三角剖分中點的位置。
|
| |
| int | nextEdge (int edge) const |
| | 返回邊起點周圍的下一條邊。
|
| |
| int | rotateEdge (int edge, int rotate) const |
| | 返回同一四邊形的另一條邊。
|
| |
| int | symEdge (int edge) const |
| |
◆ 匿名列舉
Subdiv2D 點定位情況
| 列舉器 |
|---|
| PTLOC_ERROR | 點定位錯誤。
|
| PTLOC_OUTSIDE_RECT | 點在細分邊界矩形之外。
|
| PTLOC_INSIDE | 點在某個面片內部。
|
| PTLOC_VERTEX | 點與細分的一個頂點重合。
|
| PTLOC_ON_EDGE | 點在某條邊上。
|
◆ 匿名列舉
Subdiv2D 邊型別導航 (參見: getEdge())
| 列舉器 |
|---|
| NEXT_AROUND_ORG | |
| NEXT_AROUND_DST | |
| PREV_AROUND_ORG | |
| PREV_AROUND_DST | |
| NEXT_AROUND_LEFT | |
| NEXT_AROUND_RIGHT | |
| PREV_AROUND_LEFT | |
| PREV_AROUND_RIGHT | |
◆ Subdiv2D() [1/2]
| cv::Subdiv2D::Subdiv2D |
( |
| ) |
|
| Python |
|---|
| cv.Subdiv2D( | | ) -> | <Subdiv2D object> |
| cv.Subdiv2D( | rect | ) -> | <Subdiv2D object> |
◆ Subdiv2D() [2/2]
| cv::Subdiv2D::Subdiv2D |
( |
Rect | rect | ) |
|
| Python |
|---|
| cv.Subdiv2D( | | ) -> | <Subdiv2D object> |
| cv.Subdiv2D( | rect | ) -> | <Subdiv2D object> |
這是一個過載的成員函式,為方便起見提供。它與上述函式的區別僅在於它接受的引數。
- 引數
-
此函式建立一個空的Delaunay細分,可以使用 insert() 函式新增二維點。所有要新增的點都必須在指定矩形內,否則會引發執行時錯誤。
◆ calcVoronoi()
| void cv::Subdiv2D::calcVoronoi |
( |
| ) |
|
|
保護 |
◆ checkSubdiv()
| void cv::Subdiv2D::checkSubdiv |
( |
| ) |
const |
|
保護 |
◆ clearVoronoi()
| void cv::Subdiv2D::clearVoronoi |
( |
| ) |
|
|
保護 |
◆ connectEdges()
| int cv::Subdiv2D::connectEdges |
( |
int | edgeA, |
|
|
int | edgeB ) |
|
保護 |
◆ deleteEdge()
| void cv::Subdiv2D::deleteEdge |
( |
int | edge | ) |
|
|
保護 |
◆ deletePoint()
| void cv::Subdiv2D::deletePoint |
( |
int | vtx | ) |
|
|
保護 |
◆ edgeDst()
| int cv::Subdiv2D::edgeDst |
( |
int | edge, |
|
|
Point2f * | dstpt = 0 ) const |
| Python |
|---|
| cv.Subdiv2D.edgeDst( | edge | ) -> | retval, dstpt |
◆ edgeOrg()
| int cv::Subdiv2D::edgeOrg |
( |
int | edge, |
|
|
Point2f * | orgpt = 0 ) const |
| Python |
|---|
| cv.Subdiv2D.edgeOrg( | edge | ) -> | retval, orgpt |
◆ findNearest()
| Python |
|---|
| cv.Subdiv2D.findNearest( | pt | ) -> | retval, nearestPt |
查詢最接近給定點的細分頂點。
- 引數
-
此函式是另一個用於在細分中定位輸入點的函式。它找到離輸入點最近的細分頂點。儘管包含輸入點的面片(使用 locate() 定位)被用作起點,但它不一定是該面片的頂點之一。
- 返回
- 頂點 ID。
◆ getEdge()
| int cv::Subdiv2D::getEdge |
( |
int | edge, |
|
|
int | nextEdgeType ) const |
| Python |
|---|
| cv.Subdiv2D.getEdge( | edge, nextEdgeType | ) -> | retval |
返回與給定邊相關的邊之一。
- 引數
-
| edge | 細分邊ID。 |
| nextEdgeType | 指定返回相關邊中的哪一個的引數。可能的值如下:
- NEXT_AROUND_ORG 圍繞邊原點的下一個邊 (如果 e 是輸入邊,則下圖中的 eOnext)
- NEXT_AROUND_DST 邊頂點周圍的下一個 (eDnext)
- PREV_AROUND_ORG 圍繞邊原點的上一個邊 (反向的 eRnext )
- PREV_AROUND_DST 圍繞邊目的地的上一個邊 (反向的 eLnext )
- NEXT_AROUND_LEFT 左面片周圍的下一個 (eLnext)
- NEXT_AROUND_RIGHT 右面片周圍的下一個 (eRnext)
- PREV_AROUND_LEFT 圍繞左面片的上一個邊 (反向的 eOnext )
- PREV_AROUND_RIGHT 圍繞右面片的上一個邊 (反向的 eDnext )
|
示例輸出
- 返回
- 與輸入邊相關的邊 ID。
◆ getEdgeList()
| void cv::Subdiv2D::getEdgeList |
( |
std::vector< Vec4f > & | edgeList | ) |
const |
| Python |
|---|
| cv.Subdiv2D.getEdgeList( | | ) -> | edgeList |
返回所有邊的列表。
- 引數
-
此函式將每條邊作為4個數字的向量給出,其中每兩個數字代表一個邊的頂點。例如,org_x = v[0], org_y = v[1], dst_x = v[2], dst_y = v[3]。
◆ getLeadingEdgeList()
| void cv::Subdiv2D::getLeadingEdgeList |
( |
std::vector< int > & | leadingEdgeList | ) |
const |
| Python |
|---|
| cv.Subdiv2D.getLeadingEdgeList( | | ) -> | leadingEdgeList |
返回連線到每個三角形的引導邊ID列表。
- 引數
-
此函式為每個三角形提供一個邊ID。
◆ getTriangleList()
| void cv::Subdiv2D::getTriangleList |
( |
std::vector< Vec6f > & | triangleList | ) |
const |
| Python |
|---|
| cv.Subdiv2D.getTriangleList( | | ) -> | triangleList |
返回所有三角形的列表。
- 引數
-
此函式將每個三角形作為6個數字的向量給出,其中每兩個數字代表一個三角形頂點。例如,p1_x = v[0], p1_y = v[1], p2_x = v[2], p2_y = v[3], p3_x = v[4], p3_y = v[5]。
◆ getVertex()
| Point2f cv::Subdiv2D::getVertex |
( |
int | vertex, |
|
|
int * | firstEdge = 0 ) const |
| Python |
|---|
| cv.Subdiv2D.getVertex( | vertex | ) -> | retval, firstEdge |
從頂點 ID 返回頂點位置。
- 引數
-
| vertex | 頂點 ID。 |
| firstEdge (第一個邊) | 可選。連線到該頂點的第一個邊ID。 |
- 返回
- 頂點 (x,y)
◆ getVoronoiFacetList()
| void cv::Subdiv2D::getVoronoiFacetList |
( |
const std::vector< int > & | idx, |
|
|
std::vector< std::vector< Point2f > > & | facetList, |
|
|
std::vector< Point2f > & | facetCenters ) |
| Python |
|---|
| cv.Subdiv2D.getVoronoiFacetList( | idx | ) -> | facetList, facetCenters |
返回所有 Voronoi 面片的列表。
- 引數
-
| idx | 要考慮的頂點ID向量。對於所有頂點,可以傳遞空向量。 |
| facetList | Voronoi面片的輸出向量。 |
| facetCenters | Voronoi面片中心點的輸出向量。 |
◆ initDelaunay()
| void cv::Subdiv2D::initDelaunay |
( |
Rect | rect | ) |
|
| Python |
|---|
| cv.Subdiv2D.initDelaunay( | rect | ) -> | 無 |
◆ insert() [1/2]
| void cv::Subdiv2D::insert |
( |
const std::vector< Point2f > & | ptvec | ) |
|
| Python |
|---|
| cv.Subdiv2D.insert( | pt | ) -> | retval |
| cv.Subdiv2D.insert( | ptvec | ) -> | 無 |
將多個點插入到 Delaunay 三角剖分中。
- 引數
-
此函式將點向量插入細分中,並適當地修改細分拓撲。
◆ insert() [2/2]
| int cv::Subdiv2D::insert |
( |
Point2f | pt | ) |
|
| Python |
|---|
| cv.Subdiv2D.insert( | pt | ) -> | retval |
| cv.Subdiv2D.insert( | ptvec | ) -> | 無 |
將單個點插入到 Delaunay 三角剖分中。
- 引數
-
此函式將單個點插入細分中,並適當地修改細分拓撲。如果已存在具有相同座標的點,則不會新增新點。
- 返回
- 點的ID。
- 注意
- 如果點位於三角剖分指定矩形之外,則會引發執行時錯誤。
◆ isRightOf()
| int cv::Subdiv2D::isRightOf |
( |
Point2f | pt, |
|
|
int | edge ) const |
|
保護 |
◆ locate()
| int cv::Subdiv2D::locate |
( |
Point2f | pt, |
|
|
int & | edge, |
|
|
int & | vertex ) |
| Python |
|---|
| cv.Subdiv2D.locate( | pt | ) -> | retval, edge, vertex |
返回 Delaunay 三角剖分中點的位置。
- 引數
-
| pt | 要定位的點。 |
| edge | 點所屬或位於其右側的輸出邊。 |
| vertex | 可選的輸出頂點,輸入點與其重合。 |
此函式在細分中定位輸入點,並給出三角形的邊或頂點之一。
- 返回
- 一個整數,指定點定位的以下五種情況之一
◆ newEdge()
| int cv::Subdiv2D::newEdge |
( |
| ) |
|
|
保護 |
◆ newPoint()
| int cv::Subdiv2D::newPoint |
( |
Point2f | pt, |
|
|
bool | isvirtual (是否虛擬), |
|
|
int | firstEdge = 0 ) |
|
保護 |
◆ nextEdge()
| int cv::Subdiv2D::nextEdge |
( |
int | edge | ) |
const |
| Python |
|---|
| cv.Subdiv2D.nextEdge( | edge | ) -> | retval |
返回邊起點周圍的下一條邊。
- 引數
-
- 返回
- 一個整數,表示圍繞邊原點的下一個邊ID:如果 e 是輸入邊,則為上圖中的 eOnext)。
◆ rotateEdge()
| int cv::Subdiv2D::rotateEdge |
( |
int | edge, |
|
|
int | rotate ) const |
| Python |
|---|
| cv.Subdiv2D.rotateEdge( | edge, rotate | ) -> | retval |
返回同一四邊形的另一條邊。
- 引數
-
| edge | 細分邊ID。 |
| rotate | 指定返回與輸入邊屬於同一四邊形邊的哪個邊的引數。可能的值如下:
- 0 - 輸入邊 (如果 e 是輸入邊,則下圖中的 e)
- 1 - 旋轉邊 (eRot)
- 2 - 反轉邊(反轉的 e(綠色))
- 3 - 反轉的旋轉邊(反轉的 eRot(綠色))
|
- 返回
- 與輸入邊相同的四邊形的邊 ID 之一。
◆ setEdgePoints()
| void cv::Subdiv2D::setEdgePoints |
( |
int | edge, |
|
|
int | orgPt, |
|
|
int | dstPt ) |
|
保護 |
◆ splice()
| void cv::Subdiv2D::splice |
( |
int | edgeA, |
|
|
int | edgeB ) |
|
保護 |
◆ swapEdges()
| void cv::Subdiv2D::swapEdges |
( |
int | edge | ) |
|
|
保護 |
◆ symEdge()
| int cv::Subdiv2D::symEdge |
( |
int | edge | ) |
const |
| Python |
|---|
| cv.Subdiv2D.symEdge( | edge | ) -> | retval |
◆ bottomRight
◆ freePoint
| int cv::Subdiv2D::freePoint |
|
保護 |
◆ freeQEdge
| int cv::Subdiv2D::freeQEdge |
|
保護 |
◆ qedges
| std::vector<QuadEdge> cv::Subdiv2D::qedges |
|
保護 |
◆ recentEdge
| int cv::Subdiv2D::recentEdge |
|
保護 |
◆ topLeft
◆ validGeometry
| bool cv::Subdiv2D::validGeometry |
|
保護 |
◆ vtx
| std::vector<Vertex> cv::Subdiv2D::vtx |
|
保護 |
此類的文件是從以下檔案生成的