ArucoDetector 類的主要功能是透過 detectMarkers() 方法檢測影像中的標記。更多...
#include <opencv2/objdetect/aruco_detector.hpp>
|
| | ArucoDetector (const Dictionary &dictionary=getPredefinedDictionary(cv::aruco::DICT_4X4_50), const DetectorParameters &detectorParams=DetectorParameters(), const RefineParameters &refineParams=RefineParameters()) |
| | 基本 ArucoDetector 建構函式。
|
| |
| | ArucoDetector (const std::vector< Dictionary > &dictionaries, const DetectorParameters &detectorParams=DetectorParameters(), const RefineParameters &refineParams=RefineParameters()) |
| | 用於多個字典的 ArucoDetector 建構函式。
|
| |
| void | detectMarkers (InputArray image, OutputArrayOfArrays corners, OutputArray ids, OutputArrayOfArrays rejectedImgPoints=noArray()) const |
| | 基本標記檢測。
|
| |
| void | detectMarkersMultiDict (InputArray image, OutputArrayOfArrays corners, OutputArray ids, OutputArrayOfArrays rejectedImgPoints=noArray(), OutputArray dictIndices=noArray()) const |
| | 基本標記檢測。
|
| |
| const DetectorParameters & | getDetectorParameters () const |
| |
| std::vector< Dictionary > | getDictionaries () const |
| | 返回當前用於標記檢測的所有字典,以向量形式。
|
| |
| const Dictionary & | getDictionary () const |
| | 返回內部列表中用於標記檢測的第一個字典。
|
| |
| const RefineParameters & | getRefineParameters () const |
| |
| virtual void | read (const FileNode &fn) override |
| | 從檔案儲存中讀取演算法引數。
|
| |
| void | refineDetectedMarkers (InputArray image, const Board &board, InputOutputArrayOfArrays detectedCorners, InputOutputArray detectedIds, InputOutputArrayOfArrays rejectedCorners, InputArray cameraMatrix=noArray(), InputArray distCoeffs=noArray(), OutputArray recoveredIdxs=noArray()) const |
| | 根據已檢測到的標記和板佈局最佳化未檢測到的標記。
|
| |
| void | setDetectorParameters (const DetectorParameters &detectorParameters) |
| |
| void | setDictionaries (const std::vector< Dictionary > &dictionaries) |
| | 設定用於標記檢測的整個字典集合,替換任何現有字典。
|
| |
| void | setDictionary (const Dictionary &dictionary) |
| | 設定並替換內部列表中用於標記檢測的第一個字典。
|
| |
| void | setRefineParameters (const RefineParameters &refineParameters) |
| |
| virtual void | write (FileStorage &fs) const override |
| | 將演算法引數儲存到檔案儲存中。
|
| |
| void | write (FileStorage &fs, const String &name) |
| | 簡化語言繫結的 API
|
| |
| | Algorithm () |
| |
| virtual | ~Algorithm () |
| |
| virtual void | clear () |
| | 清除演算法狀態。
|
| |
| virtual bool | empty () const |
| | 如果 Algorithm 為空(例如,在開始時或讀取不成功後),則返回 true。
|
| |
| virtual String | getDefaultName () const |
| |
| virtual void | save (const String &filename) const |
| |
| void | write (const Ptr< FileStorage > &fs, const String &name=String()) const |
| |
| void | write (FileStorage &fs, const String &name) const |
| |
◆ ArucoDetector() [1/2]
| Python |
|---|
| cv.aruco.ArucoDetector( | [, dictionary[, detectorParams[, refineParams]]] | ) -> | <aruco_ArucoDetector object> |
| cv.aruco.ArucoDetector( | dictionaries[, detectorParams[, refineParams]] | ) -> | <aruco_ArucoDetector object> |
基本 ArucoDetector 建構函式。
- 引數
-
| dictionary | 指示將要搜尋的標記型別 |
| detectorParams | 標記檢測引數 |
| refineParams | 標記精煉檢測引數 |
◆ ArucoDetector() [2/2]
| Python |
|---|
| cv.aruco.ArucoDetector( | [, dictionary[, detectorParams[, refineParams]]] | ) -> | <aruco_ArucoDetector object> |
| cv.aruco.ArucoDetector( | dictionaries[, detectorParams[, refineParams]] | ) -> | <aruco_ArucoDetector object> |
用於多個字典的 ArucoDetector 建構函式。
- 引數
-
| dictionaries | 指示將要搜尋的標記型別。空字典將丟擲錯誤。 |
| detectorParams | 標記檢測引數 |
| refineParams | 標記精煉檢測引數 |
◆ detectMarkers()
| Python |
|---|
| cv.aruco.ArucoDetector.detectMarkers( | image[, corners[, ids[, rejectedImgPoints]]] | ) -> | corners, ids, rejectedImgPoints |
基本標記檢測。
- 引數
-
| image | 輸入影像 |
| corners | 檢測到的標記角點向量。對於每個標記,提供其四個角點(例如 std::vector<std::vector<cv::Point2f> >)。對於 N 個檢測到的標記,此陣列的維度為 Nx4。角點順序為順時針。 |
| ids | 檢測到的標記識別符號向量。識別符號型別為 int(例如 std::vector<int>)。對於 N 個檢測到的標記,ids 的大小也為 N。識別符號與 imgPoints 陣列中的標記具有相同的順序。 |
| rejectedImgPoints | 包含內部編碼不正確的方形的 imgPoints。用於除錯目的。 |
在輸入影像中執行標記檢測。僅搜尋第一個指定字典中包含的標記。對於每個檢測到的標記,它返回其角點在影像中的 2D 位置及其對應的識別符號。請注意,此函式不執行姿態估計。
- 注意
- 該函式不校正鏡頭畸變,也不考慮它。如果相機引數已知,建議使用相應的相機模型對輸入影像進行去畸變處理。
- 另請參見
- undistort, estimatePoseSingleMarkers, estimatePoseBoard
◆ detectMarkersMultiDict()
| Python |
|---|
| cv.aruco.ArucoDetector.detectMarkersMultiDict( | image[, corners[, ids[, rejectedImgPoints[, dictIndices]]]] | ) -> | corners, ids, rejectedImgPoints, dictIndices |
基本標記檢測。
- 引數
-
| image | 輸入影像 |
| corners | 檢測到的標記角點向量。對於每個標記,提供其四個角點(例如 std::vector<std::vector<cv::Point2f> >)。對於 N 個檢測到的標記,此陣列的維度為 Nx4。角點順序為順時針。 |
| ids | 檢測到的標記識別符號向量。識別符號型別為 int(例如 std::vector<int>)。對於 N 個檢測到的標記,ids 的大小也為 N。識別符號與 imgPoints 陣列中的標記具有相同的順序。 |
| rejectedImgPoints | 包含內部編碼不正確的方形的 imgPoints。用於除錯目的。 |
| dictIndices | 每個檢測到的標記的字典索引向量。使用 getDictionaries() 獲取相應字典的列表。 |
在輸入影像中執行標記檢測。僅搜尋特定字典中包含的標記。對於每個檢測到的標記,它返回其角點在影像中的 2D 位置及其對應的識別符號。請注意,此函式不執行姿態估計。
- 注意
- 該函式不校正鏡頭畸變,也不考慮它。如果相機引數已知,建議使用相應的相機模型對輸入影像進行去畸變處理。
- 另請參見
- undistort, estimatePoseSingleMarkers, estimatePoseBoard
◆ getDetectorParameters()
| Python |
|---|
| cv.aruco.ArucoDetector.getDetectorParameters( | | ) -> | retval |
◆ getDictionaries()
| std::vector< Dictionary > cv::aruco::ArucoDetector::getDictionaries |
( |
| ) |
const |
| Python |
|---|
| cv.aruco.ArucoDetector.getDictionaries( | | ) -> | retval |
返回當前用於標記檢測的所有字典,以向量形式。
- 返回
- 包含 ArucoDetector 使用的所有字典的 std::vector<Dictionary>。
◆ getDictionary()
| const Dictionary & cv::aruco::ArucoDetector::getDictionary |
( |
| ) |
const |
| Python |
|---|
| cv.aruco.ArucoDetector.getDictionary( | | ) -> | retval |
◆ getRefineParameters()
| const RefineParameters & cv::aruco::ArucoDetector::getRefineParameters |
( |
| ) |
const |
| Python |
|---|
| cv.aruco.ArucoDetector.getRefineParameters( | | ) -> | retval |
◆ read()
| virtual void cv::aruco::ArucoDetector::read |
( |
const FileNode & | fn | ) |
|
|
overridevirtual |
| Python |
|---|
| cv.aruco.ArucoDetector.read( | fn | ) -> | 無 |
◆ refineDetectedMarkers()
| Python |
|---|
| cv.aruco.ArucoDetector.refineDetectedMarkers( | image, board, detectedCorners, detectedIds, rejectedCorners[, cameraMatrix[, distCoeffs[, recoveredIdxs]]] | ) -> | detectedCorners, detectedIds, rejectedCorners, recoveredIdxs |
根據已檢測到的標記和板佈局最佳化未檢測到的標記。
- 引數
-
| image | 輸入影像 |
| board | 板中標記的佈局。 |
| detectedCorners | 已檢測到的標記角點向量。 |
| detectedIds | 已檢測到的標記識別符號向量。 |
| rejectedCorners | 標記檢測過程中被拒絕的候選物件向量。 |
| cameraMatrix | 可選的 3x3 浮點相機矩陣 \(A = \vecthreethree{f_x}{0}{c_x}{0}{f_y}{c_y}{0}{0}{1}\) |
| distCoeffs | 可選的畸變係數向量 \((k_1, k_2, p_1, p_2[, k_3[, k_4, k_5, k_6],[s_1, s_2, s_3, s_4]])\),包含 4、5、8 或 12 個元素 |
| recoveredIdxs | 可選陣列,返回原始 rejectedCorners 陣列中恢復的候選索引。 |
此函式嘗試查詢在基本 detectMarkers 函式中未檢測到的標記。首先,根據當前檢測到的標記和板佈局,函式插值缺失標記的位置。然後,它嘗試基於 minRepDistance 和 errorCorrectionRate 引數在重新投影的標記和被拒絕的候選物件之間找到對應關係。如果提供了相機引數和畸變係數,則使用 projectPoint 函式重新投影缺失的標記。否則,使用全域性單應性插值缺失的標記投影,並且板中所有標記角點必須具有相同的 Z 座標。
- 注意
- 此函式假定板只包含來自一個字典的標記,因此只使用第一個配置的字典。它必須與板的字典匹配才能正常工作。
◆ setDetectorParameters()
| void cv::aruco::ArucoDetector::setDetectorParameters |
( |
const DetectorParameters & | detectorParameters | ) |
|
| Python |
|---|
| cv.aruco.ArucoDetector.setDetectorParameters( | detectorParameters | ) -> | 無 |
◆ setDictionaries()
| void cv::aruco::ArucoDetector::setDictionaries |
( |
const std::vector< Dictionary > & | dictionaries | ) |
|
| Python |
|---|
| cv.aruco.ArucoDetector.setDictionaries( | dictionaries | ) -> | 無 |
設定用於標記檢測的整個字典集合,替換任何現有字典。
- 引數
-
| dictionaries | 包含要使用的新字典集合的 std::vector<Dictionary>。 |
配置 ArucoDetector 使用提供的字典向量進行標記檢測。此方法會替換之前設定的任何字典。
- 注意
- 設定空字典向量將丟擲錯誤。
◆ setDictionary()
| void cv::aruco::ArucoDetector::setDictionary |
( |
const Dictionary & | dictionary | ) |
|
| Python |
|---|
| cv.aruco.ArucoDetector.setDictionary( | dictionary | ) -> | 無 |
設定並替換內部列表中用於標記檢測的第一個字典。
- 引數
-
| dictionary | 將替換內部列表中第一個字典的新字典。 |
◆ setRefineParameters()
| void cv::aruco::ArucoDetector::setRefineParameters |
( |
const RefineParameters & | refineParameters | ) |
|
| Python |
|---|
| cv.aruco.ArucoDetector.setRefineParameters( | refineParameters | ) -> | 無 |
◆ write() [1/2]
| virtual void cv::aruco::ArucoDetector::write |
( |
FileStorage & | fs | ) |
const |
|
overridevirtual |
| Python |
|---|
| cv.aruco.ArucoDetector.write( | fs, name | ) -> | 無 |
◆ write() [2/2]
| Python |
|---|
| cv.aruco.ArucoDetector.write( | fs, name | ) -> | 無 |
◆ arucoDetectorImpl
| Ptr<ArucoDetectorImpl> cv::aruco::ArucoDetector::arucoDetectorImpl |
|
保護 |
此類的文件由以下檔案生成