Struct abow::vocab::Vocabulary[][src]

pub struct Vocabulary { /* fields omitted */ }

Feature vocabulary built from a collection of image keypoint descriptors. Can be:

  1. Created.
  2. Saved to a file & loaded from a file (requires bincode feature, enabled by default).
  3. Used to transform a new set of descriptors into a BoW representation (and optionally get DirectIndex from features to nodes).

Implementations

impl Vocabulary[src]

Vocabulary API

pub fn transform(&self, features: &Vec<Desc>) -> Result<BoW, BowErr>[src]

Transform a vector of binary descriptors into its bag of words representation with respect to the Vocabulary. Descriptor is l1 normalized.

pub fn transform_with_direct_idx(
    &self,
    features: &Vec<Desc>
) -> Result<(BoW, DirectIdx), BowErr>
[src]

Transform a vector of binary descriptors into its bag of words representation with respect to the Vocabulary. Descriptor is l1 normalized.

Also provides "direct index" from the features to their corresponding nodes in the Vocabulary tree.

The direct index for feature[i] is di = DirectIdx[i] where di.len() <= l (number of levels), and di[j] is the id of the node matching feature[i] at level j in the Vocabulary tree.

pub fn create(features: &Vec<Desc>, k: usize, l: usize) -> Result<Self, BowErr>[src]

Build a vocabulary from a collection of descriptors.

Args: (k: Branching factor, l: Max number of levels)

pub fn load<P: AsRef<Path>>(file: P) -> Result<Self, BowErr>[src]

Load an ABoW vocabulary from a file

pub fn save<P: AsRef<Path>>(&self, file: P) -> Result<(), BowErr>[src]

Save vocabulary to a file

Trait Implementations

impl Clone for Vocabulary[src]

impl Debug for Vocabulary[src]

impl<'de> Deserialize<'de> for Vocabulary[src]

impl PartialEq<Vocabulary> for Vocabulary[src]

impl Serialize for Vocabulary[src]

impl StructuralPartialEq for Vocabulary[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Conv for T

impl<T> Conv for T

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

impl<T> FmtForward for T

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Pipe for T where
    T: ?Sized

impl<T> Pipe for T

impl<T> PipeAsRef for T

impl<T> PipeBorrow for T

impl<T> PipeDeref for T

impl<T> PipeRef for T

impl<T> Tap for T

impl<T> Tap for T

impl<T, U> TapAsRef<U> for T where
    U: ?Sized

impl<T, U> TapBorrow<U> for T where
    U: ?Sized

impl<T> TapDeref for T

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> TryConv for T

impl<T> TryConv for T

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,