#include <opencv2/objdetect/barcode.hpp>
|
| | BarcodeDetector () |
| | 初始化 BarcodeDetector。
|
| |
| | BarcodeDetector (CV_WRAP_FILE_PATH const std::string &prototxt_path, CV_WRAP_FILE_PATH const std::string &model_path) |
| | 初始化 BarcodeDetector。
|
| |
| | ~BarcodeDetector () |
| |
| bool | decodeWithType (InputArray img, InputArray points, std::vector< std::string > &decoded_info, std::vector< std::string > &decoded_type) const |
| | 一旦透過 detect() 方法找到條形碼,就對其進行解碼。
|
| |
| bool | detectAndDecodeWithType (InputArray img, std::vector< std::string > &decoded_info, std::vector< std::string > &decoded_type, OutputArray points=noArray()) const |
| | 同時檢測和解碼條形碼。
|
| |
| void | getDetectorScales (std::vector< float > &sizes) const |
| | 返回檢測器盒式濾波器尺寸。
|
| |
| double | getDownsamplingThreshold () const |
| | 獲取檢測器下采樣閾值。
|
| |
| double | getGradientThreshold () const |
| | 獲取檢測器梯度幅值閾值。
|
| |
| BarcodeDetector & | setDetectorScales (const std::vector< float > &sizes) |
| | 設定檢測器盒式濾波器尺寸。
|
| |
| BarcodeDetector & | setDownsamplingThreshold (double thresh) |
| | 設定檢測器下采樣閾值。
|
| |
| BarcodeDetector & | setGradientThreshold (double thresh) |
| | 設定檢測器梯度幅值閾值。
|
| |
| | GraphicalCodeDetector () |
| |
| | GraphicalCodeDetector (const GraphicalCodeDetector &)=default |
| |
| | GraphicalCodeDetector (GraphicalCodeDetector &&)=default |
| |
| std::string | decode (InputArray img, InputArray points, OutputArray straight_code=noArray()) const |
| | 一旦透過 detect() 方法找到影像中的圖形碼,就對其進行解碼。
|
| |
| bool | decodeMulti (InputArray img, InputArray points, std::vector< std::string > &decoded_info, OutputArrayOfArrays straight_code=noArray()) const |
| | 一旦透過 detect() 方法找到影像中的圖形碼,就對其進行解碼。
|
| |
| bool | detect (InputArray img, OutputArray points) const |
| | 在影像中檢測圖形碼並返回包含該碼的四邊形。
|
| |
| std::string | detectAndDecode (InputArray img, OutputArray points=noArray(), OutputArray straight_code=noArray()) const |
| | 同時檢測和解碼圖形碼。
|
| |
| bool | detectAndDecodeMulti (InputArray img, std::vector< std::string > &decoded_info, OutputArray points=noArray(), OutputArrayOfArrays straight_code=noArray()) const |
| | 同時檢測和解碼圖形碼。
|
| |
| bool | detectMulti (InputArray img, OutputArray points) const |
| | 在影像中檢測圖形碼並返回包含這些碼的四邊形向量。
|
| |
| GraphicalCodeDetector & | operator= (const GraphicalCodeDetector &)=default |
| |
| GraphicalCodeDetector & | operator= (GraphicalCodeDetector &&)=default |
| |
◆ BarcodeDetector() [1/2]
| cv::barcode::BarcodeDetector::BarcodeDetector |
( |
| ) |
|
| Python |
|---|
| cv.barcode.BarcodeDetector( | | ) -> | <barcode_BarcodeDetector 物件> |
| cv.barcode.BarcodeDetector( | prototxt_path, model_path | ) -> | <barcode_BarcodeDetector 物件> |
◆ BarcodeDetector() [2/2]
| Python |
|---|
| cv.barcode.BarcodeDetector( | | ) -> | <barcode_BarcodeDetector 物件> |
| cv.barcode.BarcodeDetector( | prototxt_path, model_path | ) -> | <barcode_BarcodeDetector 物件> |
初始化 BarcodeDetector。
引數允許載入可選的超解析度 DNN 模型以獲得更好的質量。
- 引數
-
| prototxt_path | 超解析度模型的 prototxt 檔案路徑 |
| model_path | 超解析度模型的模型檔案路徑 |
◆ ~BarcodeDetector()
| cv::barcode::BarcodeDetector::~BarcodeDetector |
( |
| ) |
|
◆ decodeWithType()
| bool cv::barcode::BarcodeDetector::decodeWithType |
( |
InputArray | img, |
|
|
InputArray | points, |
|
|
std::vector< std::string > & | decoded_info, |
|
|
std::vector< std::string > & | decoded_type ) const |
| Python |
|---|
| cv.barcode.BarcodeDetector.decodeWithType( | img, points | ) -> | retval, decoded_info, decoded_type |
一旦透過 detect() 方法找到條形碼,就對其進行解碼。
- 引數
-
| img | 包含條形碼的灰度或彩色 (BGR) 影像。 |
| points | 透過 detect() 方法(或其他演算法)找到的旋轉矩形頂點的向量。對於 N 個檢測到的條形碼,此陣列的維度應為 [N][4]。vector<Point2f> 中四個點的順序是 bottomLeft、topLeft、topRight、bottomRight。 |
| decoded_info | UTF8 編碼的字串輸出向量,如果無法解碼則為空字串向量。 |
| decoded_type | 字串向量,指定這些條形碼的型別 |
- 返回
- 如果至少找到一個有效條形碼則為 true
◆ detectAndDecodeWithType()
| bool cv::barcode::BarcodeDetector::detectAndDecodeWithType |
( |
InputArray | img, |
|
|
std::vector< std::string > & | decoded_info, |
|
|
std::vector< std::string > & | decoded_type, |
|
|
OutputArray | points = noArray() ) const |
| Python |
|---|
| cv.barcode.BarcodeDetector.detectAndDecodeWithType( | img[, points] | ) -> | retval, decoded_info, decoded_type, points |
同時檢測和解碼條形碼。
- 引數
-
| img | 包含條形碼的灰度或彩色 (BGR) 影像。 |
| decoded_info | UTF8 編碼的字串輸出向量或空字串向量(如果無法解碼)。 |
| decoded_type | 字串向量,指定這些條形碼的型別 |
| points | 找到的條形碼矩形頂點的可選輸出向量。如果未找到則為空。 |
- 返回
- 如果至少找到一個有效條形碼則為 true
◆ getDetectorScales()
| void cv::barcode::BarcodeDetector::getDetectorScales |
( |
std::vector< float > & | sizes | ) |
const |
| Python |
|---|
| cv.barcode.BarcodeDetector.getDetectorScales( | | ) -> | sizes |
◆ getDownsamplingThreshold()
| double cv::barcode::BarcodeDetector::getDownsamplingThreshold |
( |
| ) |
const |
| Python |
|---|
| cv.barcode.BarcodeDetector.getDownsamplingThreshold( | | ) -> | retval |
◆ getGradientThreshold()
| double cv::barcode::BarcodeDetector::getGradientThreshold |
( |
| ) |
const |
| Python |
|---|
| cv.barcode.BarcodeDetector.getGradientThreshold( | | ) -> | retval |
獲取檢測器梯度幅值閾值。
- 返回
- 檢測器梯度幅值閾值。
◆ setDetectorScales()
| BarcodeDetector & cv::barcode::BarcodeDetector::setDetectorScales |
( |
const std::vector< float > & | sizes | ) |
|
| Python |
|---|
| cv.barcode.BarcodeDetector.setDetectorScales( | sizes | ) -> | retval |
設定檢測器盒式濾波器尺寸。
調整檢測步驟中使用的盒式濾波器值和數量。濾波器尺寸與條形碼的預期線寬直接相關。對應於預期條形碼距離。如果下采樣限制增加,則需要以反比例方式調整濾波器尺寸。
- 引數
-
| sizes | 盒式濾波器尺寸,相對於影像的最小維度(預設值 [0.01, 0.03, 0.06, 0.08]) |
◆ setDownsamplingThreshold()
| BarcodeDetector & cv::barcode::BarcodeDetector::setDownsamplingThreshold |
( |
double | thresh | ) |
|
| Python |
|---|
| cv.barcode.BarcodeDetector.setDownsamplingThreshold( | thresh | ) -> | retval |
設定檢測器下采樣閾值。
預設情況下,如果最小影像尺寸大於此閾值,則 detect 方法會將輸入影像大小調整到此限制。增加此值可以提高檢測精度和結果數量,但會犧牲效能。與檢測器尺度相關。將其設定為大值將停用下采樣。
- 引數
-
- 另請參見
- setDetectorScales
◆ setGradientThreshold()
| BarcodeDetector & cv::barcode::BarcodeDetector::setGradientThreshold |
( |
double | thresh | ) |
|
| Python |
|---|
| cv.barcode.BarcodeDetector.setGradientThreshold( | thresh | ) -> | retval |
設定檢測器梯度幅值閾值。
設定檢測到的邊界框的相干性閾值。增加此值將生成更緊密的邊界框寬度,並可以減少誤報。值在 16 到 1024 之間通常有效,而過高的值將移除有效檢測。
- 引數
-
此類的文件是從以下檔案生成的