OpenCV  4.5.4
Open Source Computer Vision
Public Member Functions | Protected Attributes | List of all members
cv::barcode::BarcodeDetector Class Reference

#include <opencv2/barcode.hpp>

Public Member Functions

 BarcodeDetector (const std::string &prototxt_path="", const std::string &model_path="")
 Initialize the BarcodeDetector. More...
 
 ~BarcodeDetector ()
 
bool decode (InputArray img, InputArray points, std::vector< std::string > &decoded_info, std::vector< BarcodeType > &decoded_type) const
 Decodes barcode in image once it's found by the detect() method. More...
 
bool detect (InputArray img, OutputArray points) const
 Detects Barcode in image and returns the rectangle(s) containing the code. More...
 
bool detectAndDecode (InputArray img, std::vector< std::string > &decoded_info, std::vector< BarcodeType > &decoded_type, OutputArray points=noArray()) const
 Both detects and decodes barcode. More...
 

Protected Attributes

Ptr< Impl > p
 

Constructor & Destructor Documentation

◆ BarcodeDetector()

cv::barcode::BarcodeDetector::BarcodeDetector ( const std::string &  prototxt_path = "",
const std::string &  model_path = "" 
)
Python:
cv.barcode_BarcodeDetector([, prototxt_path[, model_path]]) -> <barcode_BarcodeDetector object>

Initialize the BarcodeDetector.

Parameters
prototxt_pathprototxt file path for the super resolution model
model_pathmodel file path for the super resolution model

◆ ~BarcodeDetector()

cv::barcode::BarcodeDetector::~BarcodeDetector ( )

Member Function Documentation

◆ decode()

bool cv::barcode::BarcodeDetector::decode ( InputArray  img,
InputArray  points,
std::vector< std::string > &  decoded_info,
std::vector< BarcodeType > &  decoded_type 
) const
Python:
cv.barcode_BarcodeDetector.decode(img, points) -> retval, decoded_info, decoded_type

Decodes barcode in image once it's found by the detect() method.

Parameters
imggrayscale or color (BGR) image containing bar code.
pointsvector of rotated rectangle vertices found by detect() method (or some other algorithm). For N detected barcodes, the dimensions of this array should be [N][4]. Order of four points in vector<Point2f> is bottomLeft, topLeft, topRight, bottomRight.
decoded_infoUTF8-encoded output vector of string or empty vector of string if the codes cannot be decoded.
decoded_typevector of BarcodeType, specifies the type of these barcodes

◆ detect()

bool cv::barcode::BarcodeDetector::detect ( InputArray  img,
OutputArray  points 
) const
Python:
cv.barcode_BarcodeDetector.detect(img[, points]) -> retval, points

Detects Barcode in image and returns the rectangle(s) containing the code.

Parameters
imggrayscale or color (BGR) image containing (or not) Barcode.
pointsOutput vector of vector of vertices of the minimum-area rotated rectangle containing the codes. For N detected barcodes, the dimensions of this array should be [N][4]. Order of four points in vector< Point2f> is bottomLeft, topLeft, topRight, bottomRight.

◆ detectAndDecode()

bool cv::barcode::BarcodeDetector::detectAndDecode ( InputArray  img,
std::vector< std::string > &  decoded_info,
std::vector< BarcodeType > &  decoded_type,
OutputArray  points = noArray() 
) const
Python:
cv.barcode_BarcodeDetector.detectAndDecode(img[, points]) -> retval, decoded_info, decoded_type, points

Both detects and decodes barcode.

Parameters
imggrayscale or color (BGR) image containing barcode.
decoded_infoUTF8-encoded output vector of string(s) or empty vector of string if the codes cannot be decoded.
decoded_typevector of BarcodeType, specifies the type of these barcodes
pointsoptional output vector of vertices of the found barcode rectangle. Will be empty if not found.

Member Data Documentation

◆ p

Ptr<Impl> cv::barcode::BarcodeDetector::p
protected

The documentation for this class was generated from the following file: