Skip to main content

Akaze

Struct Akaze 

Source
pub struct Akaze {
    pub num_sublevels: u32,
    pub max_octave_evolution: u32,
    pub base_scale_offset: f64,
    pub initial_contrast: f64,
    pub contrast_percentile: f64,
    pub contrast_factor_num_bins: usize,
    pub derivative_factor: f64,
    pub detector_threshold: f64,
    pub descriptor_channels: usize,
    pub descriptor_pattern_size: usize,
}
Expand description

Contains the configuration parameters of AKAZE.

The most important parameter to pay attention to is detector_threshold. [Config::new] can be used to set this threshold and let all other parameters remain default. You can also use the helpers [Config::sparse] and [Config::dense]. The default value of detector_threshold is 0.001.

Fields§

§num_sublevels: u32

Default number of sublevels per scale level

§max_octave_evolution: u32

Maximum octave evolution of the image 2^sigma (coarsest scale sigma units)

§base_scale_offset: f64

Base scale offset (sigma units)

§initial_contrast: f64

The initial contrast factor parameter

§contrast_percentile: f64

Percentile level for the contrast factor

§contrast_factor_num_bins: usize

Number of bins for the contrast factor histogram

§derivative_factor: f64

Factor for the multiscale derivatives

§detector_threshold: f64

Detector response threshold to accept point

§descriptor_channels: usize

Number of channels in the descriptor (1, 2, 3)

§descriptor_pattern_size: usize

Actual patch size is 2pattern_sizepoint.scale

Implementations§

Source§

impl Akaze

Source

pub fn extract_descriptors( &self, evolutions: &[EvolutionStep], keypoints: &[KeyPoint], ) -> Vec<BitArray<64>>

Extract descriptors from keypoints/an evolution

§Arguments
  • evolutions - the nonlinear scale space
  • keypoints - the keypoints detected.
  • options - The options of the nonlinear scale space.
§Return value

A vector of descriptors.

Source§

impl Akaze

Source

pub fn detector_response(&self, evolutions: &mut Vec<EvolutionStep>)

Compute the detector response - the determinant of the Hessian - and save the result in the evolutions.

§Arguments
  • evolutions - The computed evolutions.
  • options - The options
Source§

impl Akaze

Source

pub fn allocate_evolutions(&self, width: u32, height: u32) -> Vec<EvolutionStep>

Allocate and calculate prerequisites to the construction of a scale space.

§Arguments

width - The width of the input image. height - The height of the input image. options - The configuration to use.

Source§

impl Akaze

Source

pub fn detect_keypoints( &self, evolutions: &mut Vec<EvolutionStep>, ) -> Vec<KeyPoint>

Detect keypoints in an image given a nonlinear scale space. Detects scale space extrema and performs sub-pixel refinement.

§Arguments
  • evolutions - The fully-constructed non-linear scale space.
  • options - The options to use.
§Return value

The resulting keypoints.

Source§

impl Akaze

Source

pub fn new(threshold: f64) -> Self

This convenience constructor is provided for the very common case that the detector threshold needs to be modified.

Source

pub fn sparse() -> Self

Create a Config that sparsely detects features.

Uses a threshold of 0.01 (default is 0.001).

Source

pub fn dense() -> Self

Create a Config that densely detects features.

Uses a threshold of 0.0001 (default is 0.001).

Source§

impl Akaze

Source

pub fn extract( &self, image: &DynamicImage, ) -> (Vec<KeyPoint>, Vec<BitArray<64>>)

Extract features using the Akaze feature extractor.

This performs all operations end-to-end. The client might be only interested in certain portions of the process, all of which are exposed in public functions, but this function can document how the various parts fit together.

§Arguments
  • image - The input image for which to extract features.
  • options - The options for the algorithm. Set this to None for default options.

Returns the keypoints and the descriptors.

§Example
use std::path::Path;
let akaze = akaze::Akaze::default();
let (keypoints, descriptors) = akaze.extract(&image::open("res/0000000000.png").unwrap());
Source

pub fn extract_path( &self, path: impl AsRef<Path>, ) -> ImageResult<(Vec<KeyPoint>, Vec<BitArray<64>>)>

Extract features using the Akaze feature extractor from an image on disk.

This performs all operations end-to-end. The client might be only interested in certain portions of the process, all of which are exposed in public functions, but this function can document how the various parts fit together.

§Arguments
  • path - The input image path for which to extract features.
  • options - The options for the algorithm. Set this to None for default options.

Returns an ImageResult of the keypoints and the descriptors.

§Examples
use std::path::Path;
let akaze = akaze::Akaze::default();
let (keypoints, descriptors) = akaze.extract_path("res/0000000000.png").unwrap();

Trait Implementations§

Source§

impl Clone for Akaze

Source§

fn clone(&self) -> Akaze

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 Akaze

Source§

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

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

impl Default for Akaze

Source§

fn default() -> Akaze

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

impl Copy for Akaze

Auto Trait Implementations§

§

impl Freeze for Akaze

§

impl RefUnwindSafe for Akaze

§

impl Send for Akaze

§

impl Sync for Akaze

§

impl Unpin for Akaze

§

impl UnsafeUnpin for Akaze

§

impl UnwindSafe for Akaze

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, 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> 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