Skip to main content

DetectorConfigBuilder

Struct DetectorConfigBuilder 

Source
pub struct DetectorConfigBuilder {
Show 17 fields pub quad_min_edge_score: Option<f64>, pub subpixel_refinement_sigma: Option<f64>, pub segmentation_margin: Option<i16>, pub segmentation_connectivity: Option<SegmentationConnectivity>, pub upscale_factor: Option<usize>, pub decoder_min_contrast: Option<f64>, pub refinement_mode: Option<CornerRefinementMode>, pub decode_mode: Option<DecodeMode>, pub max_hamming_error: Option<u32>, pub gwlf_transversal_alpha: Option<f64>, pub quad_max_elongation: Option<f64>, pub quad_min_density: Option<f64>, pub quad_extraction_mode: Option<QuadExtractionMode>, pub huber_delta_px: Option<f64>, pub tikhonov_alpha_max: Option<f64>, pub sigma_n_sq: Option<f64>, pub structure_tensor_radius: Option<u8>, /* private fields */
}
Expand description

Builder for DetectorConfig.

Fields§

§quad_min_edge_score: Option<f64>

Minimum gradient magnitude along edges (rejects weak candidates).

§subpixel_refinement_sigma: Option<f64>

Sigma for Gaussian in subpixel refinement.

§segmentation_margin: Option<i16>

Margin for threshold-model segmentation.

§segmentation_connectivity: Option<SegmentationConnectivity>

Connectivity mode for segmentation (4 or 8).

§upscale_factor: Option<usize>

Upscale factor for low-res images (1 = no upscale).

§decoder_min_contrast: Option<f64>

Minimum contrast for decoder to accept a tag.

§refinement_mode: Option<CornerRefinementMode>

Refinement mode.

§decode_mode: Option<DecodeMode>

Decoding mode.

§max_hamming_error: Option<u32>

Maximum Hamming errors.

§gwlf_transversal_alpha: Option<f64>

GWLF transversal alpha.

§quad_max_elongation: Option<f64>

Maximum elongation for the moments culling gate.

§quad_min_density: Option<f64>

Minimum density for the moments culling gate.

§quad_extraction_mode: Option<QuadExtractionMode>

Quad extraction mode.

§huber_delta_px: Option<f64>

Huber delta for LM reprojection (pixels).

§tikhonov_alpha_max: Option<f64>

Maximum Tikhonov regularisation alpha for Accurate mode.

§sigma_n_sq: Option<f64>

Pixel noise variance for Structure Tensor covariance model.

§structure_tensor_radius: Option<u8>

Radius of the Structure Tensor window in Accurate mode.

Implementations§

Source§

impl DetectorConfigBuilder

Source

pub fn threshold_tile_size(self, size: usize) -> Self

Set the tile size for adaptive thresholding.

Source

pub fn threshold_min_range(self, range: u8) -> Self

Set the minimum intensity range for valid tiles.

Source

pub fn quad_min_area(self, area: u32) -> Self

Set the minimum quad area.

Source

pub fn quad_max_aspect_ratio(self, ratio: f32) -> Self

Set the maximum aspect ratio.

Source

pub fn quad_min_fill_ratio(self, ratio: f32) -> Self

Set the minimum fill ratio.

Source

pub fn quad_max_fill_ratio(self, ratio: f32) -> Self

Set the maximum fill ratio.

Source

pub fn quad_min_edge_length(self, length: f64) -> Self

Set the minimum edge length.

Source

pub fn quad_min_edge_score(self, score: f64) -> Self

Set the minimum edge gradient score.

Source

pub fn enable_bilateral(self, enable: bool) -> Self

Enable or disable bilateral pre-filtering.

Source

pub fn bilateral_sigma_space(self, sigma: f32) -> Self

Set bilateral spatial sigma.

Source

pub fn bilateral_sigma_color(self, sigma: f32) -> Self

Set bilateral color sigma.

Source

pub fn enable_sharpening(self, enable: bool) -> Self

Enable or disable Laplacian sharpening.

Source

pub fn enable_adaptive_window(self, enable: bool) -> Self

Enable or disable adaptive threshold window sizing.

Source

pub fn threshold_min_radius(self, radius: usize) -> Self

Set minimum threshold window radius.

Source

pub fn threshold_max_radius(self, radius: usize) -> Self

Set maximum threshold window radius.

Source

pub fn adaptive_threshold_constant(self, c: i16) -> Self

Set the constant subtracted from local mean in adaptive thresholding.

Source

pub fn adaptive_threshold_gradient_threshold(self, threshold: u8) -> Self

Set the gradient threshold for adaptive window sizing.

Source

pub fn build(self) -> DetectorConfig

Build the configuration, using defaults for unset fields.

Source

pub fn validated_build(self) -> Result<DetectorConfig, ConfigError>

Build the configuration and validate all parameter ranges.

§Errors

Returns [ConfigError] if any parameter is out of its valid range.

Source

pub fn segmentation_connectivity( self, connectivity: SegmentationConnectivity, ) -> Self

Set the segmentation connectivity.

Source

pub fn segmentation_margin(self, margin: i16) -> Self

Set the segmentation margin for threshold-model CCL.

Source

pub fn upscale_factor(self, factor: usize) -> Self

Set the upscale factor (1 = no upscaling, 2 = 2x, etc.).

Source

pub fn decoder_min_contrast(self, contrast: f64) -> Self

Set the minimum contrast for decoder bit classification. Lower values (e.g., 10.0) improve recall on small/blurry checkerboard tags.

Source

pub fn refinement_mode(self, mode: CornerRefinementMode) -> Self

Set the corner refinement mode.

Source

pub fn decode_mode(self, mode: DecodeMode) -> Self

Set the decoding mode (Hard or Soft).

Source

pub fn max_hamming_error(self, errors: u32) -> Self

Set the maximum number of Hamming errors allowed.

Source

pub fn gwlf_transversal_alpha(self, alpha: f64) -> Self

Set the GWLF transversal alpha.

Source

pub fn quad_max_elongation(self, max_elongation: f64) -> Self

Set the maximum elongation for the moments-based culling gate. Set to 0.0 to disable (default). Recommended: 15.0.

Source

pub fn quad_min_density(self, min_density: f64) -> Self

Set the minimum density for the moments-based culling gate. Set to 0.0 to disable (default). Recommended: 0.2.

Source

pub fn quad_extraction_mode(self, mode: QuadExtractionMode) -> Self

Set the quad extraction mode (ContourRdp or EdLines).

Source

pub fn huber_delta_px(self, delta: f64) -> Self

Set the Huber delta for LM reprojection (pixels).

Source

pub fn tikhonov_alpha_max(self, alpha: f64) -> Self

Set the maximum Tikhonov regularisation alpha for Accurate pose mode.

Source

pub fn sigma_n_sq(self, sigma_n_sq: f64) -> Self

Set the pixel noise variance for the Structure Tensor covariance model.

Source

pub fn structure_tensor_radius(self, radius: u8) -> Self

Set the Structure Tensor window radius for Accurate pose mode.

Trait Implementations§

Source§

impl Default for DetectorConfigBuilder

Source§

fn default() -> DetectorConfigBuilder

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<SS, SP> SupersetOf<SS> for SP
where SS: SubsetOf<SP>,

Source§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
Source§

fn is_in_subset(&self) -> bool

Checks if self is actually part of its subset T (and can be converted to it).
Source§

fn to_subset_unchecked(&self) -> SS

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
Source§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more