線段檢測器類。 更多...
#include <opencv2/imgproc.hpp>
|
| virtual | ~LineSegmentDetector () |
| |
| virtual int | compareSegments (const Size &size, InputArray lines1, InputArray lines2, InputOutputArray image=noArray())=0 |
| | 用藍色和紅色繪製兩組線條,並計算非重疊(不匹配)的畫素。
|
| |
| virtual void | detect (InputArray image, OutputArray lines, OutputArray width=noArray(), OutputArray prec=noArray(), OutputArray nfa=noArray())=0 |
| | 在輸入影像中查詢線條。
|
| |
| virtual void | drawSegments (InputOutputArray image, InputArray lines)=0 |
| | 在給定影像上繪製線段。
|
| |
| | Algorithm () |
| |
| virtual | ~Algorithm () |
| |
| virtual void | clear () |
| | 清除演算法狀態。
|
| |
| virtual bool | empty () const |
| | 如果 Algorithm 為空(例如,在剛開始時或在讀取失敗後)則返回 true。
|
| |
| virtual String | getDefaultName () const |
| |
| virtual void | read (const FileNode &fn) |
| | 從檔案儲存中讀取演算法引數。
|
| |
| virtual void | save (const String &filename) const |
| |
| void | write (const Ptr< FileStorage > &fs, const String &name=String()) const |
| |
| virtual void | write (FileStorage &fs) const |
| | 將演算法引數儲存到檔案儲存中。
|
| |
| void | write (FileStorage &fs, const String &name) const |
| |
線段檢測器類。
遵循 [112] 中描述的演算法。
- 注意
- 由於原始程式碼許可證衝突,已從 OpenCV 版本 3.4.6 到 3.4.15 以及 4.1.0 到 4.5.3 中移除實現。 在 Computation of a NFA 程式碼在 MIT 許可證下發布後再次恢復。
◆ ~LineSegmentDetector()
| virtual cv::LineSegmentDetector::~LineSegmentDetector |
( |
| ) |
|
|
inlinevirtual |
◆ compareSegments()
| Python |
|---|
| cv.LineSegmentDetector.compareSegments( | size, lines1, lines2[, image] | ) -> | 返回值, image |
用藍色和紅色繪製兩組線條,並計算非重疊(不匹配)的畫素。
- 引數
-
| size | lines1 和 lines2 所在影像的大小。 |
| lines1 | 需要繪製的第一組線條。 它以藍色視覺化。 |
| lines2 | 第二組線條。 它們以紅色視覺化。 |
| image | 可選影像,線條將在其中繪製。 該影像應該是彩色(3 通道)的,以便 lines1 和 lines2 以上述顏色繪製。 |
◆ detect()
| Python |
|---|
| cv.LineSegmentDetector.detect( | image[, lines[, width[, prec[, nfa]]]] | ) -> | lines, width, prec, nfa |
在輸入影像中查詢線條。
這是上述影像上演算法預設引數的輸出。
image
- 引數
-
| image | 灰度 (CV_8UC1) 輸入影像。 如果只需要選擇一個 roi,請使用:lsd_ptr-\>detect(image(roi), lines, ...); lines += Scalar(roi.x, roi.y, roi.x, roi.y); |
| 輸出向量,包含與另一影像中點對應的對極線。每條線\(ax + by + c=0\)由3個數字\((a, b, c)\)編碼。 | Vec4f 元素的向量,指定線的起點和終點。 其中 Vec4f 為 (x1, y1, x2, y2),點 1 為起點,點 2 為終點。 返回的線條嚴格按照梯度方向定向。 |
| width | 找到線條的區域的寬度向量。 例如,線條寬度。 |
| prec | 找到線條的精度向量。 |
| nfa | 包含線區域中誤報數量的向量,精度為 10%。 值越大,對數的檢測效果越好。
- -1 對應於 10 個平均誤報
- 0 對應於 1 個平均誤報
- 1 對應於 0.1 個平均誤報。 只有當物件型別為 LSD_REFINE_ADV 時才會計算此向量。
|
◆ drawSegments()
| Python |
|---|
| cv.LineSegmentDetector.drawSegments( | image, lines | ) -> | image |
在給定影像上繪製線段。
- 引數
-
| image | 將在其中繪製線條的影像。 應該大於或等於找到線條的影像。 |
| 輸出向量,包含與另一影像中點對應的對極線。每條線\(ax + by + c=0\)由3個數字\((a, b, c)\)編碼。 | 線條顏色。 |
此類文件由以下檔案生成