OpenCV 4.12.0
開源計算機視覺
載入中...
搜尋中...
無匹配項
cv::barcode::BarcodeDetector 類參考

#include <opencv2/objdetect/barcode.hpp>

cv::barcode::BarcodeDetector 的協作圖

公共成員函式

 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
 獲取檢測器梯度幅值閾值。
 
BarcodeDetectorsetDetectorScales (const std::vector< float > &sizes)
 設定檢測器盒式濾波器尺寸。
 
BarcodeDetectorsetDownsamplingThreshold (double thresh)
 設定檢測器下采樣閾值。
 
BarcodeDetectorsetGradientThreshold (double thresh)
 設定檢測器梯度幅值閾值。
 
- 從 cv::GraphicalCodeDetector 繼承的公共成員函式
 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
 在影像中檢測圖形碼並返回包含這些碼的四邊形向量。
 
GraphicalCodeDetectoroperator= (const GraphicalCodeDetector &)=default
 
GraphicalCodeDetectoroperator= (GraphicalCodeDetector &&)=default
 

額外繼承的成員

- 從 cv::GraphicalCodeDetector 繼承的受保護屬性
Ptr< Impl > p
 

建構函式 & 解構函式文件

◆ BarcodeDetector() [1/2]

cv::barcode::BarcodeDetector::BarcodeDetector ( )
Python
cv.barcode.BarcodeDetector() -> <barcode_BarcodeDetector 物件>
cv.barcode.BarcodeDetector(prototxt_path, model_path) -> <barcode_BarcodeDetector 物件>

初始化 BarcodeDetector

◆ BarcodeDetector() [2/2]

cv::barcode::BarcodeDetector::BarcodeDetector ( CV_WRAP_FILE_PATH const std::string & prototxt_path,
CV_WRAP_FILE_PATH const std::string & model_path )
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_infoUTF8 編碼的字串輸出向量,如果無法解碼則為空字串向量。
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_infoUTF8 編碼的字串輸出向量或空字串向量(如果無法解碼)。
decoded_type字串向量,指定這些條形碼的型別
points找到的條形碼矩形頂點的可選輸出向量。如果未找到則為空。
返回
如果至少找到一個有效條形碼則為 true
此函式的呼叫圖如下

◆ getDetectorScales()

void cv::barcode::BarcodeDetector::getDetectorScales ( std::vector< float > & sizes) const
Python
cv.barcode.BarcodeDetector.getDetectorScales() -> sizes

返回檢測器盒式濾波器尺寸。

引數
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 方法會將輸入影像大小調整到此限制。增加此值可以提高檢測精度和結果數量,但會犧牲效能。與檢測器尺度相關。將其設定為大值將停用下采樣。

引數
thresh要應用的下采樣限制(預設值 512)
另請參見
setDetectorScales

◆ setGradientThreshold()

BarcodeDetector & cv::barcode::BarcodeDetector::setGradientThreshold ( double thresh)
Python
cv.barcode.BarcodeDetector.setGradientThreshold(thresh) -> retval

設定檢測器梯度幅值閾值。

設定檢測到的邊界框的相干性閾值。增加此值將生成更緊密的邊界框寬度,並可以減少誤報。值在 16 到 1024 之間通常有效,而過高的值將移除有效檢測。

引數
thresh梯度幅值閾值(預設值 64)。

此類的文件是從以下檔案生成的