pub trait BarcodeDetectorTrait: BarcodeDetectorTraitConst + GraphicalCodeDetectorTrait {
// Required method
fn as_raw_mut_BarcodeDetector(&mut self) -> *mut c_void;
// Provided methods
fn set_downsampling_threshold(
&mut self,
thresh: f64,
) -> Result<BarcodeDetector> { ... }
fn set_detector_scales(
&mut self,
sizes: &Vector<f32>,
) -> Result<BarcodeDetector> { ... }
fn set_gradient_threshold(&mut self, thresh: f64) -> Result<BarcodeDetector> { ... }
}
Expand description
Mutable methods for crate::objdetect::BarcodeDetector
Required Methods§
fn as_raw_mut_BarcodeDetector(&mut self) -> *mut c_void
Provided Methods§
Sourcefn set_downsampling_threshold(&mut self, thresh: f64) -> Result<BarcodeDetector>
fn set_downsampling_threshold(&mut self, thresh: f64) -> Result<BarcodeDetector>
Set detector downsampling threshold.
By default, the detect method resizes the input image to this limit if the smallest image size is is greater than the threshold. Increasing this value can improve detection accuracy and the number of results at the expense of performance. Correlates with detector scales. Setting this to a large value will disable downsampling.
§Parameters
- thresh: downsampling limit to apply (default 512)
§See also
setDetectorScales
Sourcefn set_detector_scales(
&mut self,
sizes: &Vector<f32>,
) -> Result<BarcodeDetector>
fn set_detector_scales( &mut self, sizes: &Vector<f32>, ) -> Result<BarcodeDetector>
Set detector box filter sizes.
Adjusts the value and the number of box filters used in the detect step. The filter sizes directly correlate with the expected line widths for a barcode. Corresponds to expected barcode distance. If the downsampling limit is increased, filter sizes need to be adjusted in an inversely proportional way.
§Parameters
- sizes: box filter sizes, relative to minimum dimension of the image (default [0.01, 0.03, 0.06, 0.08])
Sourcefn set_gradient_threshold(&mut self, thresh: f64) -> Result<BarcodeDetector>
fn set_gradient_threshold(&mut self, thresh: f64) -> Result<BarcodeDetector>
Set detector gradient magnitude threshold.
Sets the coherence threshold for detected bounding boxes. Increasing this value will generate a closer fitted bounding box width and can reduce false-positives. Values between 16 and 1024 generally work, while too high of a value will remove valid detections.
§Parameters
- thresh: gradient magnitude threshold (default 64).
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.