Trait opencv::prelude::BarcodeDetectorTraitConst
source · pub trait BarcodeDetectorTraitConst {
// Required method
fn as_raw_BarcodeDetector(&self) -> *const c_void;
// Provided methods
fn detect(
&self,
img: &dyn ToInputArray,
points: &mut dyn ToOutputArray
) -> Result<bool> { ... }
fn decode(
&self,
img: &dyn ToInputArray,
points: &dyn ToInputArray,
decoded_info: &mut Vector<String>,
decoded_type: &mut Vector<BarcodeType>
) -> Result<bool> { ... }
fn detect_and_decode(
&self,
img: &dyn ToInputArray,
decoded_info: &mut Vector<String>,
decoded_type: &mut Vector<BarcodeType>,
points: &mut dyn ToOutputArray
) -> Result<bool> { ... }
}
Expand description
Constant methods for crate::barcode::BarcodeDetector
Required Methods§
fn as_raw_BarcodeDetector(&self) -> *const c_void
Provided Methods§
sourcefn detect(
&self,
img: &dyn ToInputArray,
points: &mut dyn ToOutputArray
) -> Result<bool>
fn detect( &self, img: &dyn ToInputArray, points: &mut dyn ToOutputArray ) -> Result<bool>
Detects Barcode in image and returns the rectangle(s) containing the code.
Parameters
- img: grayscale or color (BGR) image containing (or not) Barcode.
- points: Output 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.
sourcefn decode(
&self,
img: &dyn ToInputArray,
points: &dyn ToInputArray,
decoded_info: &mut Vector<String>,
decoded_type: &mut Vector<BarcodeType>
) -> Result<bool>
fn decode( &self, img: &dyn ToInputArray, points: &dyn ToInputArray, decoded_info: &mut Vector<String>, decoded_type: &mut Vector<BarcodeType> ) -> Result<bool>
Decodes barcode in image once it’s found by the detect() method.
Parameters
- img: grayscale or color (BGR) image containing bar code.
- points: vector 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
is bottomLeft, topLeft, topRight, bottomRight. - decoded_info: UTF8-encoded output vector of string or empty vector of string if the codes cannot be decoded.
- decoded_type: vector of BarcodeType, specifies the type of these barcodes
sourcefn detect_and_decode(
&self,
img: &dyn ToInputArray,
decoded_info: &mut Vector<String>,
decoded_type: &mut Vector<BarcodeType>,
points: &mut dyn ToOutputArray
) -> Result<bool>
fn detect_and_decode( &self, img: &dyn ToInputArray, decoded_info: &mut Vector<String>, decoded_type: &mut Vector<BarcodeType>, points: &mut dyn ToOutputArray ) -> Result<bool>
Both detects and decodes barcode
Parameters
- img: grayscale or color (BGR) image containing barcode.
- decoded_info: UTF8-encoded output vector of string(s) or empty vector of string if the codes cannot be decoded.
- decoded_type: vector of BarcodeType, specifies the type of these barcodes
- points: optional output vector of vertices of the found barcode rectangle. Will be empty if not found.
C++ default parameters
- points: noArray()