[−][src]Struct opencv::features2d::BOWImgDescriptorExtractor
Class to compute an image descriptor using the bag of visual words.
Such a computation consists of the following steps:
- Compute descriptors for a given image and its keypoints set.
- Find the nearest visual words from the vocabulary for each keypoint descriptor.
- 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.
Methods
impl BOWImgDescriptorExtractor
[src]
pub fn as_raw_BOWImgDescriptorExtractor(&self) -> *mut c_void
[src]
pub unsafe fn from_raw_ptr(ptr: *mut c_void) -> Self
[src]
impl BOWImgDescriptorExtractor
[src]
pub fn new_with_dextractor(
dextractor: &PtrOfFeature2D,
dmatcher: &PtrOfDescriptorMatcher
) -> Result<BOWImgDescriptorExtractor>
[src]
dextractor: &PtrOfFeature2D,
dmatcher: &PtrOfDescriptorMatcher
) -> Result<BOWImgDescriptorExtractor>
The constructor.
Parameters
- dextractor: Descriptor extractor that is used to compute descriptors for an input image and its keypoints.
- dmatcher: Descriptor matcher that is used to find the nearest word of the trained vocabulary for each keypoint descriptor of the image.
pub fn new(
dmatcher: &PtrOfDescriptorMatcher
) -> Result<BOWImgDescriptorExtractor>
[src]
dmatcher: &PtrOfDescriptorMatcher
) -> Result<BOWImgDescriptorExtractor>
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 VectorOfKeyPoint,
img_descriptor: &mut dyn ToOutputArray,
point_idxs_of_clusters: &mut VectorOfVectorOfint,
descriptors: &mut Mat
) -> Result<()>
[src]
&mut self,
image: &dyn ToInputArray,
keypoints: &mut VectorOfKeyPoint,
img_descriptor: &mut dyn ToOutputArray,
point_idxs_of_clusters: &mut VectorOfVectorOfint,
descriptors: &mut Mat
) -> Result<()>
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 VectorOfVectorOfint
) -> Result<()>
[src]
&mut self,
keypoint_descriptors: &dyn ToInputArray,
img_descriptor: &mut dyn ToOutputArray,
point_idxs_of_clusters: &mut VectorOfVectorOfint
) -> Result<()>
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 VectorOfKeyPoint,
img_descriptor: &mut Mat
) -> Result<()>
[src]
&mut self,
image: &Mat,
keypoints: &mut VectorOfKeyPoint,
img_descriptor: &mut Mat
) -> Result<()>
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.
Trait Implementations
impl Send for BOWImgDescriptorExtractor
[src]
impl Drop for BOWImgDescriptorExtractor
[src]
Auto Trait Implementations
impl !Sync for BOWImgDescriptorExtractor
impl Unpin for BOWImgDescriptorExtractor
impl UnwindSafe for BOWImgDescriptorExtractor
impl RefUnwindSafe for BOWImgDescriptorExtractor
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,