pub trait WeChatQRCodeTrait: WeChatQRCodeTraitConst {
// Required method
fn as_raw_mut_WeChatQRCode(&mut self) -> *mut c_void;
// Provided methods
fn detect_and_decode(
&mut self,
img: &impl ToInputArray,
points: &mut impl ToOutputArray,
) -> Result<Vector<String>> { ... }
fn detect_and_decode_def(
&mut self,
img: &impl ToInputArray,
) -> Result<Vector<String>> { ... }
fn set_scale_factor(&mut self, _scaling_factor: f32) -> Result<()> { ... }
fn get_scale_factor(&mut self) -> Result<f32> { ... }
}
Expand description
Mutable methods for crate::wechat_qrcode::WeChatQRCode
Required Methods§
fn as_raw_mut_WeChatQRCode(&mut self) -> *mut c_void
Provided Methods§
Sourcefn detect_and_decode(
&mut self,
img: &impl ToInputArray,
points: &mut impl ToOutputArray,
) -> Result<Vector<String>>
fn detect_and_decode( &mut self, img: &impl ToInputArray, points: &mut impl ToOutputArray, ) -> Result<Vector<String>>
Both detects and decodes QR code. To simplify the usage, there is a only API: detectAndDecode
§Parameters
- img: supports grayscale or color (BGR) image.
- points: optional output array of vertices of the found QR code quadrangle. Will be empty if not found.
§Returns
list of decoded string.
§C++ default parameters
- points: noArray()
Sourcefn detect_and_decode_def(
&mut self,
img: &impl ToInputArray,
) -> Result<Vector<String>>
fn detect_and_decode_def( &mut self, img: &impl ToInputArray, ) -> Result<Vector<String>>
Both detects and decodes QR code. To simplify the usage, there is a only API: detectAndDecode
§Parameters
- img: supports grayscale or color (BGR) image.
- points: optional output array of vertices of the found QR code quadrangle. Will be empty if not found.
§Returns
list of decoded string.
§Note
This alternative version of WeChatQRCodeTrait::detect_and_decode function uses the following default values for its arguments:
- points: noArray()
Sourcefn set_scale_factor(&mut self, _scaling_factor: f32) -> Result<()>
fn set_scale_factor(&mut self, _scaling_factor: f32) -> Result<()>
set scale factor QR code detector use neural network to detect QR. Before running the neural network, the input image is pre-processed by scaling. By default, the input image is scaled to an image with an area of 160000 pixels. The scale factor allows to use custom scale the input image: width = scaleFactorwidth height = scaleFactorwidth
scaleFactor valuse must be > 0 and <= 1, otherwise the scaleFactor value is set to -1 and use default scaled to an image with an area of 160000 pixels.
fn get_scale_factor(&mut self) -> Result<f32>
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.