[][src]Trait opencv::features2d::prelude::BOWImgDescriptorExtractorTrait

pub trait BOWImgDescriptorExtractorTrait {
    pub fn as_raw_BOWImgDescriptorExtractor(&self) -> *const c_void;
pub fn as_raw_mut_BOWImgDescriptorExtractor(&mut self) -> *mut c_void; pub fn set_vocabulary(&mut self, vocabulary: &Mat) -> Result<()> { ... }
pub fn get_vocabulary(&self) -> Result<Mat> { ... }
pub fn compute_desc(
        &mut self,
        image: &dyn ToInputArray,
        keypoints: &mut Vector<KeyPoint>,
        img_descriptor: &mut dyn ToOutputArray,
        point_idxs_of_clusters: &mut Vector<Vector<i32>>,
        descriptors: &mut Mat
    ) -> Result<()> { ... }
pub fn compute(
        &mut self,
        keypoint_descriptors: &dyn ToInputArray,
        img_descriptor: &mut dyn ToOutputArray,
        point_idxs_of_clusters: &mut Vector<Vector<i32>>
    ) -> Result<()> { ... }
pub fn compute2(
        &mut self,
        image: &Mat,
        keypoints: &mut Vector<KeyPoint>,
        img_descriptor: &mut Mat
    ) -> Result<()> { ... }
pub fn descriptor_size(&self) -> Result<i32> { ... }
pub fn descriptor_type(&self) -> Result<i32> { ... } }

Class to compute an image descriptor using the bag of visual words.

Such a computation consists of the following steps:

  1. Compute descriptors for a given image and its keypoints set.
  2. Find the nearest visual words from the vocabulary for each keypoint descriptor.
  3. Compute the bag-of-words image descriptor as is a normalized histogram of vocabulary words encountered in the image. The i-th bin of the histogram is a frequency of i-th word of the vocabulary in the given image.

Required methods

Loading content...

Provided methods

pub fn set_vocabulary(&mut self, vocabulary: &Mat) -> Result<()>[src]

Sets a visual vocabulary.

Parameters

  • vocabulary: Vocabulary (can be trained using the inheritor of BOWTrainer ). Each row of the vocabulary is a visual word (cluster center).

pub fn get_vocabulary(&self) -> Result<Mat>[src]

Returns the set vocabulary.

pub fn compute_desc(
    &mut self,
    image: &dyn ToInputArray,
    keypoints: &mut Vector<KeyPoint>,
    img_descriptor: &mut dyn ToOutputArray,
    point_idxs_of_clusters: &mut Vector<Vector<i32>>,
    descriptors: &mut Mat
) -> Result<()>
[src]

Computes an image descriptor using the set visual vocabulary.

Parameters

  • image: Image, for which the descriptor is computed.
  • keypoints: Keypoints detected in the input image.
  • imgDescriptor: Computed output image descriptor.
  • pointIdxsOfClusters: Indices of keypoints that belong to the cluster. This means that pointIdxsOfClusters[i] are keypoint indices that belong to the i -th cluster (word of vocabulary) returned if it is non-zero.
  • descriptors: Descriptors of the image keypoints that are returned if they are non-zero.

C++ default parameters

  • point_idxs_of_clusters: 0
  • descriptors: 0

pub fn compute(
    &mut self,
    keypoint_descriptors: &dyn ToInputArray,
    img_descriptor: &mut dyn ToOutputArray,
    point_idxs_of_clusters: &mut Vector<Vector<i32>>
) -> Result<()>
[src]

Computes an image descriptor using the set visual vocabulary.

Parameters

  • image: Image, for which the descriptor is computed.
  • keypoints: Keypoints detected in the input image.
  • imgDescriptor: Computed output image descriptor.
  • pointIdxsOfClusters: Indices of keypoints that belong to the cluster. This means that pointIdxsOfClusters[i] are keypoint indices that belong to the i -th cluster (word of vocabulary) returned if it is non-zero.
  • descriptors: Descriptors of the image keypoints that are returned if they are non-zero.

Overloaded parameters

  • keypointDescriptors: Computed descriptors to match with vocabulary.
  • imgDescriptor: Computed output image descriptor.
  • pointIdxsOfClusters: Indices of keypoints that belong to the cluster. This means that pointIdxsOfClusters[i] are keypoint indices that belong to the i -th cluster (word of vocabulary) returned if it is non-zero.

C++ default parameters

  • point_idxs_of_clusters: 0

pub fn compute2(
    &mut self,
    image: &Mat,
    keypoints: &mut Vector<KeyPoint>,
    img_descriptor: &mut Mat
) -> Result<()>
[src]

pub fn descriptor_size(&self) -> Result<i32>[src]

Returns an image descriptor size if the vocabulary is set. Otherwise, it returns 0.

pub fn descriptor_type(&self) -> Result<i32>[src]

Returns an image descriptor type.

Loading content...

Implementors

Loading content...