Trait GraphicalCodeDetectorTraitConst

Source
pub trait GraphicalCodeDetectorTraitConst {
    // Required method
    fn as_raw_GraphicalCodeDetector(&self) -> *const c_void;

    // Provided methods
    fn detect(
        &self,
        img: &impl ToInputArray,
        points: &mut impl ToOutputArray,
    ) -> Result<bool> { ... }
    fn decode(
        &self,
        img: &impl ToInputArray,
        points: &impl ToInputArray,
        straight_code: &mut impl ToOutputArray,
    ) -> Result<Vec<u8>> { ... }
    fn decode_def(
        &self,
        img: &impl ToInputArray,
        points: &impl ToInputArray,
    ) -> Result<Vec<u8>> { ... }
    fn detect_and_decode(
        &self,
        img: &impl ToInputArray,
        points: &mut impl ToOutputArray,
        straight_code: &mut impl ToOutputArray,
    ) -> Result<Vec<u8>> { ... }
    fn detect_and_decode_def(&self, img: &impl ToInputArray) -> Result<Vec<u8>> { ... }
    fn detect_multi(
        &self,
        img: &impl ToInputArray,
        points: &mut impl ToOutputArray,
    ) -> Result<bool> { ... }
    fn decode_multi(
        &self,
        img: &impl ToInputArray,
        points: &impl ToInputArray,
        decoded_info: &mut Vector<String>,
        straight_code: &mut impl ToOutputArray,
    ) -> Result<bool> { ... }
    fn decode_multi_def(
        &self,
        img: &impl ToInputArray,
        points: &impl ToInputArray,
        decoded_info: &mut Vector<String>,
    ) -> Result<bool> { ... }
    fn detect_and_decode_multi(
        &self,
        img: &impl ToInputArray,
        decoded_info: &mut Vector<String>,
        points: &mut impl ToOutputArray,
        straight_code: &mut impl ToOutputArray,
    ) -> Result<bool> { ... }
    fn detect_and_decode_multi_def(
        &self,
        img: &impl ToInputArray,
        decoded_info: &mut Vector<String>,
    ) -> Result<bool> { ... }
}
Expand description

Required Methods§

Provided Methods§

Source

fn detect( &self, img: &impl ToInputArray, points: &mut impl ToOutputArray, ) -> Result<bool>

Detects graphical code in image and returns the quadrangle containing the code.

§Parameters
  • img: grayscale or color (BGR) image containing (or not) graphical code.
  • points: Output vector of vertices of the minimum-area quadrangle containing the code.
Source

fn decode( &self, img: &impl ToInputArray, points: &impl ToInputArray, straight_code: &mut impl ToOutputArray, ) -> Result<Vec<u8>>

Decodes graphical code in image once it’s found by the detect() method.

Returns UTF8-encoded output string or empty string if the code cannot be decoded.

§Parameters
  • img: grayscale or color (BGR) image containing graphical code.
  • points: Quadrangle vertices found by detect() method (or some other algorithm).
  • straight_code: The optional output image containing binarized code, will be empty if not found.
§C++ default parameters
  • straight_code: noArray()
Source

fn decode_def( &self, img: &impl ToInputArray, points: &impl ToInputArray, ) -> Result<Vec<u8>>

Decodes graphical code in image once it’s found by the detect() method.

Returns UTF8-encoded output string or empty string if the code cannot be decoded.

§Parameters
  • img: grayscale or color (BGR) image containing graphical code.
  • points: Quadrangle vertices found by detect() method (or some other algorithm).
  • straight_code: The optional output image containing binarized code, will be empty if not found.
§Note

This alternative version of GraphicalCodeDetectorTraitConst::decode function uses the following default values for its arguments:

  • straight_code: noArray()
Source

fn detect_and_decode( &self, img: &impl ToInputArray, points: &mut impl ToOutputArray, straight_code: &mut impl ToOutputArray, ) -> Result<Vec<u8>>

Both detects and decodes graphical code

§Parameters
  • img: grayscale or color (BGR) image containing graphical code.
  • points: optional output array of vertices of the found graphical code quadrangle, will be empty if not found.
  • straight_code: The optional output image containing binarized code
§C++ default parameters
  • points: noArray()
  • straight_code: noArray()
Source

fn detect_and_decode_def(&self, img: &impl ToInputArray) -> Result<Vec<u8>>

Both detects and decodes graphical code

§Parameters
  • img: grayscale or color (BGR) image containing graphical code.
  • points: optional output array of vertices of the found graphical code quadrangle, will be empty if not found.
  • straight_code: The optional output image containing binarized code
§Note

This alternative version of GraphicalCodeDetectorTraitConst::detect_and_decode function uses the following default values for its arguments:

  • points: noArray()
  • straight_code: noArray()
Source

fn detect_multi( &self, img: &impl ToInputArray, points: &mut impl ToOutputArray, ) -> Result<bool>

Detects graphical codes in image and returns the vector of the quadrangles containing the codes.

§Parameters
  • img: grayscale or color (BGR) image containing (or not) graphical codes.
  • points: Output vector of vector of vertices of the minimum-area quadrangle containing the codes.
Source

fn decode_multi( &self, img: &impl ToInputArray, points: &impl ToInputArray, decoded_info: &mut Vector<String>, straight_code: &mut impl ToOutputArray, ) -> Result<bool>

Decodes graphical codes in image once it’s found by the detect() method.

§Parameters
  • img: grayscale or color (BGR) image containing graphical codes.
  • decoded_info: UTF8-encoded output vector of string or empty vector of string if the codes cannot be decoded.
  • points: vector of Quadrangle vertices found by detect() method (or some other algorithm).
  • straight_code: The optional output vector of images containing binarized codes
§C++ default parameters
  • straight_code: noArray()
Source

fn decode_multi_def( &self, img: &impl ToInputArray, points: &impl ToInputArray, decoded_info: &mut Vector<String>, ) -> Result<bool>

Decodes graphical codes in image once it’s found by the detect() method.

§Parameters
  • img: grayscale or color (BGR) image containing graphical codes.
  • decoded_info: UTF8-encoded output vector of string or empty vector of string if the codes cannot be decoded.
  • points: vector of Quadrangle vertices found by detect() method (or some other algorithm).
  • straight_code: The optional output vector of images containing binarized codes
§Note

This alternative version of GraphicalCodeDetectorTraitConst::decode_multi function uses the following default values for its arguments:

  • straight_code: noArray()
Source

fn detect_and_decode_multi( &self, img: &impl ToInputArray, decoded_info: &mut Vector<String>, points: &mut impl ToOutputArray, straight_code: &mut impl ToOutputArray, ) -> Result<bool>

Both detects and decodes graphical codes

§Parameters
  • img: grayscale or color (BGR) image containing graphical codes.
  • decoded_info: UTF8-encoded output vector of string or empty vector of string if the codes cannot be decoded.
  • points: optional output vector of vertices of the found graphical code quadrangles. Will be empty if not found.
  • straight_code: The optional vector of images containing binarized codes
  • If there are QR codes encoded with a Structured Append mode on the image and all of them detected and decoded correctly, method writes a full message to position corresponds to 0-th code in a sequence. The rest of QR codes from the same sequence have empty string.
§C++ default parameters
  • points: noArray()
  • straight_code: noArray()
Source

fn detect_and_decode_multi_def( &self, img: &impl ToInputArray, decoded_info: &mut Vector<String>, ) -> Result<bool>

Both detects and decodes graphical codes

§Parameters
  • img: grayscale or color (BGR) image containing graphical codes.
  • decoded_info: UTF8-encoded output vector of string or empty vector of string if the codes cannot be decoded.
  • points: optional output vector of vertices of the found graphical code quadrangles. Will be empty if not found.
  • straight_code: The optional vector of images containing binarized codes
  • If there are QR codes encoded with a Structured Append mode on the image and all of them detected and decoded correctly, method writes a full message to position corresponds to 0-th code in a sequence. The rest of QR codes from the same sequence have empty string.
§Note

This alternative version of GraphicalCodeDetectorTraitConst::detect_and_decode_multi function uses the following default values for its arguments:

  • points: noArray()
  • straight_code: noArray()

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§