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>> { ... }
fn get_encoding(
&mut self,
code_idx: i32,
) -> Result<QRCodeEncoder_ECIEncodings> { ... }
fn get_encoding_def(&mut self) -> Result<QRCodeEncoder_ECIEncodings> { ... }
}
Expand description
Mutable methods for crate::objdetect::QRCodeDetector
Required Methods§
fn as_raw_mut_QRCodeDetector(&mut self) -> *mut c_void
Provided Methods§
Sourcefn set_eps_x(&mut self, eps_x: f64) -> Result<QRCodeDetector>
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.
Sourcefn set_eps_y(&mut self, eps_y: f64) -> Result<QRCodeDetector>
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.
Sourcefn set_use_alignment_markers(
&mut self,
use_alignment_markers: bool,
) -> Result<QRCodeDetector>
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
Sourcefn decode_curved(
&mut self,
img: &impl ToInputArray,
points: &impl ToInputArray,
straight_qrcode: &mut impl ToOutputArray,
) -> Result<Vec<u8>>
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()
Sourcefn decode_curved_def(
&mut self,
img: &impl ToInputArray,
points: &impl ToInputArray,
) -> Result<Vec<u8>>
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()
Sourcefn 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( &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()
Sourcefn detect_and_decode_curved_def(
&mut self,
img: &impl ToInputArray,
) -> Result<Vec<u8>>
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()
Sourcefn get_encoding(&mut self, code_idx: i32) -> Result<QRCodeEncoder_ECIEncodings>
fn get_encoding(&mut self, code_idx: i32) -> Result<QRCodeEncoder_ECIEncodings>
Returns a kind of encoding for the decoded info from the latest [decode] or [detectAndDecode] call
§Parameters
- codeIdx: an index of the previously decoded QR code. When [decode] or [detectAndDecode] is used, valid value is zero. For [decodeMulti] or [detectAndDecodeMulti] use indices corresponding to the output order.
§C++ default parameters
- code_idx: 0
Sourcefn get_encoding_def(&mut self) -> Result<QRCodeEncoder_ECIEncodings>
fn get_encoding_def(&mut self) -> Result<QRCodeEncoder_ECIEncodings>
Returns a kind of encoding for the decoded info from the latest [decode] or [detectAndDecode] call
§Parameters
- codeIdx: an index of the previously decoded QR code. When [decode] or [detectAndDecode] is used, valid value is zero. For [decodeMulti] or [detectAndDecodeMulti] use indices corresponding to the output order.
§Note
This alternative version of QRCodeDetectorTrait::get_encoding function uses the following default values for its arguments:
- code_idx: 0
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.