pub struct Dictionary {
pub n_bits: usize,
pub tau: u32,
pub codes: HashMap<u64, usize>,
pub code_list: Vec<u64>,
}Fields§
§n_bits: usize§tau: u32§codes: HashMap<u64, usize>§code_list: Vec<u64>Implementations§
Source§impl Dictionary
impl Dictionary
pub fn new(name: &str) -> Option<Self>
pub fn find(&self, bits: u64, max_hamming: u32) -> Option<(usize, u32)>
Sourcepub fn recognize_marker(
&self,
img: &GrayImage,
_mark_size: usize,
max_hamming: u32,
corners: &[Point],
debug_log: Option<&mut Vec<String>>,
) -> Option<Marker>
pub fn recognize_marker( &self, img: &GrayImage, _mark_size: usize, max_hamming: u32, corners: &[Point], debug_log: Option<&mut Vec<String>>, ) -> Option<Marker>
Recognize a marker from a warped+thresholded image. Port of AR.Detector.prototype.getMarker from JS.
Key differences from previous Rust version:
- Validates that border cells are BLACK (non-zero count < minZero)
- Reads bits using countNonZero over the full cell area (not 3x3 sample)
- Tries all 4 rotations to find best match
Sourcepub fn generate_marker_image(
&self,
id: usize,
cell_size: usize,
) -> Option<GrayImage>
pub fn generate_marker_image( &self, id: usize, cell_size: usize, ) -> Option<GrayImage>
Genera una imagen (GrayImage) de un marcador ArUco dado su ID. La imagen tendrá un borde negro de 1 celda y el patrón NxN interno.
Sourcepub fn generate_marker_svg(&self, id: usize) -> Option<String>
pub fn generate_marker_svg(&self, id: usize) -> Option<String>
Genera una cadena con el contenido de un archivo SVG para el marcador dado su ID. El SVG es vectorial y escala perfectamente sin pérdida de calidad.
Auto Trait Implementations§
impl Freeze for Dictionary
impl RefUnwindSafe for Dictionary
impl Send for Dictionary
impl Sync for Dictionary
impl Unpin for Dictionary
impl UnsafeUnpin for Dictionary
impl UnwindSafe for Dictionary
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
Mutably borrows from an owned value. Read more
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>
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 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>
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 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>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
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
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
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.