opencv::objdetect

Trait QRCodeDetectorTrait

source
pub trait QRCodeDetectorTrait: GraphicalCodeDetectorTrait + QRCodeDetectorTraitConst {
    // Required method
    fn as_raw_mut_QRCodeDetector(&mut self) -> *mut c_void;

    // Provided methods
    fn set_eps_x(&mut self, eps_x: f64) -> Result<QRCodeDetector> { ... }
    fn set_eps_y(&mut self, eps_y: f64) -> Result<QRCodeDetector> { ... }
    fn set_use_alignment_markers(
        &mut self,
        use_alignment_markers: bool,
    ) -> Result<QRCodeDetector> { ... }
    fn decode_curved(
        &mut self,
        img: &impl ToInputArray,
        points: &impl ToInputArray,
        straight_qrcode: &mut impl ToOutputArray,
    ) -> Result<Vec<u8>> { ... }
    fn decode_curved_def(
        &mut self,
        img: &impl ToInputArray,
        points: &impl ToInputArray,
    ) -> Result<Vec<u8>> { ... }
    fn detect_and_decode_curved(
        &mut self,
        img: &impl ToInputArray,
        points: &mut impl ToOutputArray,
        straight_qrcode: &mut impl ToOutputArray,
    ) -> Result<Vec<u8>> { ... }
    fn detect_and_decode_curved_def(
        &mut self,
        img: &impl ToInputArray,
    ) -> Result<Vec<u8>> { ... }
}
Expand description

Required Methods§

Provided Methods§

source

fn set_eps_x(&mut self, eps_x: f64) -> Result<QRCodeDetector>

sets the epsilon used during the horizontal scan of QR code stop marker detection.

§Parameters
  • epsX: Epsilon neighborhood, which allows you to determine the horizontal pattern of the scheme 1:1:3:1:1 according to QR code standard.
source

fn set_eps_y(&mut self, eps_y: f64) -> Result<QRCodeDetector>

sets the epsilon used during the vertical scan of QR code stop marker detection.

§Parameters
  • epsY: Epsilon neighborhood, which allows you to determine the vertical pattern of the scheme 1:1:3:1:1 according to QR code standard.
source

fn set_use_alignment_markers( &mut self, use_alignment_markers: bool, ) -> Result<QRCodeDetector>

use markers to improve the position of the corners of the QR code

alignmentMarkers using by default

source

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

Decodes QR code on a curved surface 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 QR code.
  • points: Quadrangle vertices found by detect() method (or some other algorithm).
  • straight_qrcode: The optional output image containing rectified and binarized QR code
§C++ default parameters
  • straight_qrcode: noArray()
source

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

Decodes QR code on a curved surface 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 QR code.
  • points: Quadrangle vertices found by detect() method (or some other algorithm).
  • straight_qrcode: The optional output image containing rectified and binarized QR code
§Note

This alternative version of QRCodeDetectorTrait::decode_curved function uses the following default values for its arguments:

  • straight_qrcode: noArray()
source

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

Both detects and decodes QR code on a curved surface

§Parameters
  • img: grayscale or color (BGR) image containing QR code.
  • points: optional output array of vertices of the found QR code quadrangle. Will be empty if not found.
  • straight_qrcode: The optional output image containing rectified and binarized QR code
§C++ default parameters
  • points: noArray()
  • straight_qrcode: noArray()
source

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

Both detects and decodes QR code on a curved surface

§Parameters
  • img: grayscale or color (BGR) image containing QR code.
  • points: optional output array of vertices of the found QR code quadrangle. Will be empty if not found.
  • straight_qrcode: The optional output image containing rectified and binarized QR code
§Note

This alternative version of QRCodeDetectorTrait::detect_and_decode_curved function uses the following default values for its arguments:

  • points: noArray()
  • straight_qrcode: noArray()

Object Safety§

This trait is not object safe.

Implementors§