pub trait BarcodeDetectorTraitConst: GraphicalCodeDetectorTraitConst {
    // Required method
    fn as_raw_BarcodeDetector(&self) -> *const c_void;

    // Provided methods
    fn decode_with_type(
        &self,
        img: &impl ToInputArray,
        points: &impl ToInputArray,
        decoded_info: &mut Vector<String>,
        decoded_type: &mut Vector<String>
    ) -> Result<bool> { ... }
    fn detect_and_decode_with_type(
        &self,
        img: &impl ToInputArray,
        decoded_info: &mut Vector<String>,
        decoded_type: &mut Vector<String>,
        points: &mut impl ToOutputArray
    ) -> Result<bool> { ... }
    fn detect_and_decode_with_type_def(
        &self,
        img: &impl ToInputArray,
        decoded_info: &mut Vector<String>,
        decoded_type: &mut Vector<String>
    ) -> Result<bool> { ... }
}
Expand description

Constant methods for crate::objdetect::BarcodeDetector

Required Methods§

Provided Methods§

source

fn decode_with_type( &self, img: &impl ToInputArray, points: &impl ToInputArray, decoded_info: &mut Vector<String>, decoded_type: &mut Vector<String> ) -> 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 strings, specifies the type of these barcodes
Returns

true if at least one valid barcode have been found

source

fn detect_and_decode_with_type( &self, img: &impl ToInputArray, decoded_info: &mut Vector<String>, decoded_type: &mut Vector<String>, points: &mut impl 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 strings, specifies the type of these barcodes
  • points: optional output vector of vertices of the found barcode rectangle. Will be empty if not found.
Returns

true if at least one valid barcode have been found

C++ default parameters
  • points: noArray()
source

fn detect_and_decode_with_type_def( &self, img: &impl ToInputArray, decoded_info: &mut Vector<String>, decoded_type: &mut Vector<String> ) -> 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 strings, specifies the type of these barcodes
  • points: optional output vector of vertices of the found barcode rectangle. Will be empty if not found.
Returns

true if at least one valid barcode have been found

Note

This alternative version of BarcodeDetectorTraitConst::detect_and_decode_with_type function uses the following default values for its arguments:

  • points: noArray()

Object Safety§

This trait is not object safe.

Implementors§