BarcodeDetectorTraitConst

Trait BarcodeDetectorTraitConst 

Source
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> { ... }
    fn get_downsampling_threshold(&self) -> Result<f64> { ... }
    fn get_detector_scales(&self, sizes: &mut Vector<f32>) -> Result<()> { ... }
    fn get_gradient_threshold(&self) -> Result<f64> { ... }
}
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()
Source

fn get_downsampling_threshold(&self) -> Result<f64>

Get detector downsampling threshold.

§Returns

detector downsampling threshold

Source

fn get_detector_scales(&self, sizes: &mut Vector<f32>) -> Result<()>

Returns detector box filter sizes.

§Parameters
  • sizes: output parameter for returning the sizes.
Source

fn get_gradient_threshold(&self) -> Result<f64>

Get detector gradient magnitude threshold.

§Returns

detector gradient magnitude threshold.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§