Skip to main content

DecodeConfig

Struct DecodeConfig 

Source
pub struct DecodeConfig {
    pub codebook_profile: CodebookProfile,
    pub code_band_ratio: f32,
    pub samples_per_sector: usize,
    pub n_radial_rings: usize,
    pub max_decode_dist: u8,
    pub min_decode_confidence: f32,
    pub min_decode_margin: u8,
    pub min_decode_contrast: f32,
    pub threshold_max_iters: usize,
    pub threshold_convergence_eps: f32,
}
Expand description

Configuration for sector decoding.

Fields§

§codebook_profile: CodebookProfile

Embedded codebook profile to match against.

Default: CodebookProfile::Base, which preserves the shipped stable IDs 0..892. extended is explicit opt-in and expands the codebook at the cost of a weaker minimum cyclic Hamming distance.

§code_band_ratio: f32

Ratio of code band center radius to outer ellipse semi-major axis. The code band is sampled at code_band_ratio * (a, b) in the ellipse coordinate frame. Default: DecodeConfig::DEFAULT_CODE_BAND_RATIO.

§samples_per_sector: usize

Number of angular samples per sector. Default: DecodeConfig::DEFAULT_SAMPLES_PER_SECTOR.

§n_radial_rings: usize

Number of radial rings to sample within the code band. Default: DecodeConfig::DEFAULT_N_RADIAL_RINGS.

§max_decode_dist: u8

Maximum Hamming distance for a valid decode. Default: DecodeConfig::DEFAULT_MAX_DECODE_DIST.

§min_decode_confidence: f32

Minimum confidence for a valid decode. Default: DecodeConfig::DEFAULT_MIN_DECODE_CONFIDENCE.

§min_decode_margin: u8

Minimum Hamming margin (second_best_dist - best_dist) for a valid decode.

A margin of 0 means the two closest codewords are equidistant from the observed word — genuinely ambiguous. Default rejects ties (margin = 0). For setups without homography validation (e.g. no camera intrinsics), setting this to the selected profile’s minimum cyclic Hamming distance accepts only matches that are unambiguous within that profile’s distance guarantee. For the shipped baseline profile this value is 2.

Default: DecodeConfig::DEFAULT_MIN_DECODE_MARGIN.

§min_decode_contrast: f32

Minimum accepted sector-intensity contrast (max - min) before decode. Default: DecodeConfig::DEFAULT_MIN_DECODE_CONTRAST.

§threshold_max_iters: usize

Maximum iterations for iterative 2-means threshold refinement. Default: DecodeConfig::DEFAULT_THRESHOLD_MAX_ITERS.

§threshold_convergence_eps: f32

Convergence epsilon for iterative 2-means threshold refinement. Stop when |new_threshold - old_threshold| <= eps. Default: DecodeConfig::DEFAULT_THRESHOLD_CONVERGENCE_EPS.

Implementations§

Source§

impl DecodeConfig

Source

pub const DEFAULT_CODE_BAND_RATIO: f32 = 0.76

Default radial location of the code band as a fraction of outer radius.

Source

pub const DEFAULT_SAMPLES_PER_SECTOR: usize = 5

Default number of angular intensity samples per bit sector.

Source

pub const DEFAULT_N_RADIAL_RINGS: usize = 3

Default number of concentric rings used for radial sampling.

Source

pub const DEFAULT_MAX_DECODE_DIST: u8 = 3

Default maximum Hamming distance accepted by decode.

Source

pub const DEFAULT_MIN_DECODE_CONFIDENCE: f32 = 0.3

Minimum decode confidence with the corrected formula clamp(1-dist/6) * clamp(margin/profile.min_cyclic_dist). A perfect decode (dist=0, margin≥2) scores 1.0; this threshold accepts matches down to dist=2 with margin≥1 on the shipped baseline profile.

Source

pub const DEFAULT_MIN_DECODE_MARGIN: u8 = 1

Minimum Hamming margin required for a valid decode.

A margin of 0 means two codewords are equidistant from the observed word (genuinely ambiguous). Setting this to 1 (default) rejects such ties.

Source

pub const DEFAULT_MIN_DECODE_CONTRAST: f32 = 0.03

Default minimum sector-intensity contrast (max - min) before decode.

Source

pub const DEFAULT_THRESHOLD_MAX_ITERS: usize = 10

Default iteration cap for iterative 2-means threshold refinement.

Source

pub const DEFAULT_THRESHOLD_CONVERGENCE_EPS: f32 = 1e-4

Default convergence epsilon for iterative 2-means threshold refinement.

Trait Implementations§

Source§

impl Clone for DecodeConfig

Source§

fn clone(&self) -> DecodeConfig

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for DecodeConfig

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for DecodeConfig

Source§

fn default() -> Self

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

impl<'de> Deserialize<'de> for DecodeConfig

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for DecodeConfig

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. 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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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<R, P> ReadPrimitive<R> for P
where R: Read + ReadEndian<P>, P: Default,

Source§

fn read_from_little_endian(read: &mut R) -> Result<Self, Error>

Read this value from the supplied reader. Same as ReadEndian::read_from_little_endian().
Source§

fn read_from_big_endian(read: &mut R) -> Result<Self, Error>

Read this value from the supplied reader. Same as ReadEndian::read_from_big_endian().
Source§

fn read_from_native_endian(read: &mut R) -> Result<Self, Error>

Read this value from the supplied reader. Same as ReadEndian::read_from_native_endian().
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<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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

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
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,