Trait DictionaryTraitConst

Source
pub trait DictionaryTraitConst {
    // Required method
    fn as_raw_Dictionary(&self) -> *const c_void;

    // Provided methods
    fn bytes_list(&self) -> Mat { ... }
    fn marker_size(&self) -> i32 { ... }
    fn max_correction_bits(&self) -> i32 { ... }
    fn identify(
        &self,
        only_bits: &impl MatTraitConst,
        idx: &mut i32,
        rotation: &mut i32,
        max_correction_rate: f64,
    ) -> Result<bool> { ... }
    fn get_distance_to_id(
        &self,
        bits: &impl ToInputArray,
        id: i32,
        all_rotations: bool,
    ) -> Result<i32> { ... }
    fn get_distance_to_id_def(
        &self,
        bits: &impl ToInputArray,
        id: i32,
    ) -> Result<i32> { ... }
    fn generate_image_marker(
        &self,
        id: i32,
        side_pixels: i32,
        _img: &mut impl ToOutputArray,
        border_bits: i32,
    ) -> Result<()> { ... }
    fn generate_image_marker_def(
        &self,
        id: i32,
        side_pixels: i32,
        _img: &mut impl ToOutputArray,
    ) -> Result<()> { ... }
}
Expand description

Constant methods for crate::objdetect::Dictionary

Required Methods§

Provided Methods§

Source

fn bytes_list(&self) -> Mat

marker code information. See class description for more details

Source

fn marker_size(&self) -> i32

number of bits per dimension

Source

fn max_correction_bits(&self) -> i32

maximum number of bits that can be corrected

Source

fn identify( &self, only_bits: &impl MatTraitConst, idx: &mut i32, rotation: &mut i32, max_correction_rate: f64, ) -> Result<bool>

Given a matrix of bits. Returns whether if marker is identified or not.

Returns reference to the marker id in the dictionary (if any) and its rotation.

Source

fn get_distance_to_id( &self, bits: &impl ToInputArray, id: i32, all_rotations: bool, ) -> Result<i32>

Returns Hamming distance of the input bits to the specific id.

If allRotations flag is set, the four posible marker rotations are considered

§C++ default parameters
  • all_rotations: true
Source

fn get_distance_to_id_def( &self, bits: &impl ToInputArray, id: i32, ) -> Result<i32>

Returns Hamming distance of the input bits to the specific id.

If allRotations flag is set, the four posible marker rotations are considered

§Note

This alternative version of DictionaryTraitConst::get_distance_to_id function uses the following default values for its arguments:

  • all_rotations: true
Source

fn generate_image_marker( &self, id: i32, side_pixels: i32, _img: &mut impl ToOutputArray, border_bits: i32, ) -> Result<()>

Generate a canonical marker image

§C++ default parameters
  • border_bits: 1
Source

fn generate_image_marker_def( &self, id: i32, side_pixels: i32, _img: &mut impl ToOutputArray, ) -> Result<()>

Generate a canonical marker image

§Note

This alternative version of DictionaryTraitConst::generate_image_marker function uses the following default values for its arguments:

  • border_bits: 1

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.

Implementors§