OpenCV for Unity  2.6.0
Enox Software / Please refer to OpenCV official document ( http://docs.opencv.org/4.9.0/index.html ) for the details of the argument of the method.
Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
OpenCVForUnity.Features2dModule.BOWImgDescriptorExtractor Class Reference

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

Inheritance diagram for OpenCVForUnity.Features2dModule.BOWImgDescriptorExtractor:
OpenCVForUnity.DisposableOpenCVObject OpenCVForUnity.DisposableObject

Public Member Functions

IntPtr getNativeObjAddr ()
 
 BOWImgDescriptorExtractor (Feature2D dextractor, DescriptorMatcher dmatcher)
 The constructor. More...
 
void setVocabulary (Mat vocabulary)
 Sets a visual vocabulary. More...
 
Mat getVocabulary ()
 Returns the set vocabulary. More...
 
void compute (Mat image, MatOfKeyPoint keypoints, Mat imgDescriptor)
 
int descriptorSize ()
 Returns an image descriptor size if the vocabulary is set. Otherwise, it returns 0. More...
 
int descriptorType ()
 Returns an image descriptor type. More...
 
- Public Member Functions inherited from OpenCVForUnity.DisposableObject
void Dispose ()
 
void ThrowIfDisposed ()
 

Static Public Member Functions

static BOWImgDescriptorExtractor __fromPtr__ (IntPtr addr)
 
- Static Public Member Functions inherited from OpenCVForUnity.DisposableObject
static IntPtr ThrowIfNullIntPtr (IntPtr ptr)
 

Protected Member Functions

override void Dispose (bool disposing)
 
- Protected Member Functions inherited from OpenCVForUnity.DisposableOpenCVObject
 DisposableOpenCVObject ()
 
 DisposableOpenCVObject (IntPtr ptr)
 
 DisposableOpenCVObject (bool isEnabledDispose)
 
 DisposableOpenCVObject (IntPtr ptr, bool isEnabledDispose)
 
- Protected Member Functions inherited from OpenCVForUnity.DisposableObject
 DisposableObject ()
 
 DisposableObject (bool isEnabledDispose)
 

Additional Inherited Members

- Properties inherited from OpenCVForUnity.DisposableObject
bool IsDisposed [get, protected set]
 
bool IsEnabledDispose [get, set]
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ BOWImgDescriptorExtractor()

OpenCVForUnity.Features2dModule.BOWImgDescriptorExtractor.BOWImgDescriptorExtractor ( Feature2D  dextractor,
DescriptorMatcher  dmatcher 
)

The constructor.

Parameters
dextractorDescriptor extractor that is used to compute descriptors for an input image and its keypoints.
dmatcherDescriptor matcher that is used to find the nearest word of the trained vocabulary for each keypoint descriptor of the image.

Member Function Documentation

◆ __fromPtr__()

static BOWImgDescriptorExtractor OpenCVForUnity.Features2dModule.BOWImgDescriptorExtractor.__fromPtr__ ( IntPtr  addr)
static

◆ compute()

void OpenCVForUnity.Features2dModule.BOWImgDescriptorExtractor.compute ( Mat  image,
MatOfKeyPoint  keypoints,
Mat  imgDescriptor 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters
keypointDescriptorsComputed descriptors to match with vocabulary.
imgDescriptorComputed output image descriptor.
pointIdxsOfClustersIndices 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.

◆ descriptorSize()

int OpenCVForUnity.Features2dModule.BOWImgDescriptorExtractor.descriptorSize ( )

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

◆ descriptorType()

int OpenCVForUnity.Features2dModule.BOWImgDescriptorExtractor.descriptorType ( )

Returns an image descriptor type.

◆ Dispose()

override void OpenCVForUnity.Features2dModule.BOWImgDescriptorExtractor.Dispose ( bool  disposing)
protectedvirtual

◆ getNativeObjAddr()

IntPtr OpenCVForUnity.Features2dModule.BOWImgDescriptorExtractor.getNativeObjAddr ( )

◆ getVocabulary()

Mat OpenCVForUnity.Features2dModule.BOWImgDescriptorExtractor.getVocabulary ( )

Returns the set vocabulary.

◆ setVocabulary()

void OpenCVForUnity.Features2dModule.BOWImgDescriptorExtractor.setVocabulary ( Mat  vocabulary)

Sets a visual vocabulary.

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

The documentation for this class was generated from the following file: