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
impl DetectorConfigBuilder
Sourcepub fn threshold_tile_size(self, size: usize) -> Self
pub fn threshold_tile_size(self, size: usize) -> Self
Set the tile size for adaptive thresholding.
Sourcepub fn threshold_min_range(self, range: u8) -> Self
pub fn threshold_min_range(self, range: u8) -> Self
Set the minimum intensity range for valid tiles.
Sourcepub fn quad_min_area(self, area: u32) -> Self
pub fn quad_min_area(self, area: u32) -> Self
Set the minimum quad area.
Sourcepub fn quad_max_aspect_ratio(self, ratio: f32) -> Self
pub fn quad_max_aspect_ratio(self, ratio: f32) -> Self
Set the maximum aspect ratio.
Sourcepub fn quad_min_fill_ratio(self, ratio: f32) -> Self
pub fn quad_min_fill_ratio(self, ratio: f32) -> Self
Set the minimum fill ratio.
Sourcepub fn quad_max_fill_ratio(self, ratio: f32) -> Self
pub fn quad_max_fill_ratio(self, ratio: f32) -> Self
Set the maximum fill ratio.
Sourcepub fn quad_min_edge_length(self, length: f64) -> Self
pub fn quad_min_edge_length(self, length: f64) -> Self
Set the minimum edge length.
Sourcepub fn quad_min_edge_score(self, score: f64) -> Self
pub fn quad_min_edge_score(self, score: f64) -> Self
Set the minimum edge gradient score.
Sourcepub fn enable_bilateral(self, enable: bool) -> Self
pub fn enable_bilateral(self, enable: bool) -> Self
Enable or disable bilateral pre-filtering.
Sourcepub fn bilateral_sigma_space(self, sigma: f32) -> Self
pub fn bilateral_sigma_space(self, sigma: f32) -> Self
Set bilateral spatial sigma.
Sourcepub fn bilateral_sigma_color(self, sigma: f32) -> Self
pub fn bilateral_sigma_color(self, sigma: f32) -> Self
Set bilateral color sigma.
Sourcepub fn enable_sharpening(self, enable: bool) -> Self
pub fn enable_sharpening(self, enable: bool) -> Self
Enable or disable Laplacian sharpening.
Sourcepub fn enable_adaptive_window(self, enable: bool) -> Self
pub fn enable_adaptive_window(self, enable: bool) -> Self
Enable or disable adaptive threshold window sizing.
Sourcepub fn threshold_min_radius(self, radius: usize) -> Self
pub fn threshold_min_radius(self, radius: usize) -> Self
Set minimum threshold window radius.
Sourcepub fn threshold_max_radius(self, radius: usize) -> Self
pub fn threshold_max_radius(self, radius: usize) -> Self
Set maximum threshold window radius.
Sourcepub fn adaptive_threshold_constant(self, c: i16) -> Self
pub fn adaptive_threshold_constant(self, c: i16) -> Self
Set the constant subtracted from local mean in adaptive thresholding.
Sourcepub fn adaptive_threshold_gradient_threshold(self, threshold: u8) -> Self
pub fn adaptive_threshold_gradient_threshold(self, threshold: u8) -> Self
Set the gradient threshold for adaptive window sizing.
Sourcepub fn build(self) -> DetectorConfig
pub fn build(self) -> DetectorConfig
Build the configuration, using defaults for unset fields.
Sourcepub fn validated_build(self) -> Result<DetectorConfig, ConfigError>
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.
Sourcepub fn segmentation_connectivity(
self,
connectivity: SegmentationConnectivity,
) -> Self
pub fn segmentation_connectivity( self, connectivity: SegmentationConnectivity, ) -> Self
Set the segmentation connectivity.
Sourcepub fn segmentation_margin(self, margin: i16) -> Self
pub fn segmentation_margin(self, margin: i16) -> Self
Set the segmentation margin for threshold-model CCL.
Sourcepub fn upscale_factor(self, factor: usize) -> Self
pub fn upscale_factor(self, factor: usize) -> Self
Set the upscale factor (1 = no upscaling, 2 = 2x, etc.).
Sourcepub fn decoder_min_contrast(self, contrast: f64) -> Self
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.
Sourcepub fn refinement_mode(self, mode: CornerRefinementMode) -> Self
pub fn refinement_mode(self, mode: CornerRefinementMode) -> Self
Set the corner refinement mode.
Sourcepub fn decode_mode(self, mode: DecodeMode) -> Self
pub fn decode_mode(self, mode: DecodeMode) -> Self
Set the decoding mode (Hard or Soft).
Sourcepub fn max_hamming_error(self, errors: u32) -> Self
pub fn max_hamming_error(self, errors: u32) -> Self
Set the maximum number of Hamming errors allowed.
Sourcepub fn gwlf_transversal_alpha(self, alpha: f64) -> Self
pub fn gwlf_transversal_alpha(self, alpha: f64) -> Self
Set the GWLF transversal alpha.
Sourcepub fn quad_max_elongation(self, max_elongation: f64) -> Self
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.
Sourcepub fn quad_min_density(self, min_density: f64) -> Self
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.
Sourcepub fn quad_extraction_mode(self, mode: QuadExtractionMode) -> Self
pub fn quad_extraction_mode(self, mode: QuadExtractionMode) -> Self
Set the quad extraction mode (ContourRdp or EdLines).
Sourcepub fn huber_delta_px(self, delta: f64) -> Self
pub fn huber_delta_px(self, delta: f64) -> Self
Set the Huber delta for LM reprojection (pixels).
Sourcepub fn tikhonov_alpha_max(self, alpha: f64) -> Self
pub fn tikhonov_alpha_max(self, alpha: f64) -> Self
Set the maximum Tikhonov regularisation alpha for Accurate pose mode.
Sourcepub fn sigma_n_sq(self, sigma_n_sq: f64) -> Self
pub fn sigma_n_sq(self, sigma_n_sq: f64) -> Self
Set the pixel noise variance for the Structure Tensor covariance model.
Sourcepub fn structure_tensor_radius(self, radius: u8) -> Self
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
impl Default for DetectorConfigBuilder
Source§fn default() -> DetectorConfigBuilder
fn default() -> DetectorConfigBuilder
Auto Trait Implementations§
impl Freeze for DetectorConfigBuilder
impl RefUnwindSafe for DetectorConfigBuilder
impl Send for DetectorConfigBuilder
impl Sync for DetectorConfigBuilder
impl Unpin for DetectorConfigBuilder
impl UnsafeUnpin for DetectorConfigBuilder
impl UnwindSafe for DetectorConfigBuilder
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.