Finds the best match for each descriptor from a query set with train descriptors. Query descriptors are supposed to be of keypoints detected on the same query image. In the first variant of this method, train descriptors are set as an input argument and are supposed to be of keypoints detected on the same train image. In the second variant of the method, train descriptors collection that was set using``addmethod`` is used. Optional mask (or masks) can be set to describe which descriptors can be matched. ``queryDescriptors[i]`` can be matched with ``trainDescriptors[j]`` only if ``mask.at<uchar>(i,j)`` is non-zero.?? what does "of keypoints" mean?
Finds the best match for each descriptor from a query set with train descriptors. Query descriptors are supposed to belong??to keypoints detected on the same query image. In the first variant of this method, train descriptors are set as an input argument and are supposed to belongto keypoints detected on the same train image. In the second variant of the method, train descriptors collection that was set by``addmethod`` is used. Optional mask (or masks) can be set to describe descriptors that can be matched. ``queryDescriptors[i]`` can be matched with ``trainDescriptors[j]`` only if ``mask.at<uchar>(i,j)`` is non-zero.??
:param mask:Mask specifying permissible matches between an input query and train matrices of descriptors.
:param masks:Set of masks. Each ``masks[i]`` specifies permissible matches between input query descriptors and stored train descriptors from the i-th image ``trainDescCollection[i]``.
:param masks:Set of masks. Each ``masks[i]`` specifies permissible matches between input query descriptors and stored train descriptors from the i-th image ``trainDescCollection[i]``.
Finds the best matches for each query descriptor that has a distance smaller than the given threshold. Found matches are returned in the distance increasing order. See the details about query and train descriptors in ??.
Now the following matcher types are supported: ``"BruteForce"`` (it uses ``L2`` ), ``"BruteForce-L1"`` ,``"BruteForce-Hamming"`` ,``"BruteForce-HammingLUT"`` , and ``"FlannBased"`` .
Now the following matcher types are supported: ``BruteForce`` (it uses ``L2`` ), ``BruteForce-L1`` ,``BruteForce-Hamming`` ,``BruteForce-HammingLUT`` , and ``FlannBased`` .
..index:: BruteForceMatcher
@ -258,7 +256,7 @@ Brute-force descriptor matcher. For each descriptor in the first set, this match
}
For efficiency, ``BruteForceMatcher`` is used as a template for the distance metric??. For float descriptors, a common choice is ``L2<float>``. The following class of supported distances is used: ::
For efficiency, ``BruteForceMatcher`` is used as a template for the distance metric??. For float descriptors, ``L2<float>``is a common choice. The following distances are supported: ::
:param adjaster::func:`AdjusterAdapter` that detects features and adjusts parameters.??parameter formatting is broken here
:param adjaster::ref:`AdjusterAdapter` that detects features and adjusts parameters.??parameter formatting is broken here
:param min_features:Minimum desired number features.
:param min_features:Minimum desired number of features.
:param max_features:Maximum desired number of features.
:param max_iters:Maximum number of times to try adjusting the feature detector parameters. For :func:`FastAdjuster` , this number can be high, but with ``Star`` or ``Surf`` , many iterations can be time-comsuming. At each iteration the detector is rerun.
:param max_iters:Maximum number of times to try adjusting the feature detector parameters. For :ref:`FastAdjuster` , this number can be high, but with ``Star`` or ``Surf`` many iterations can be time-comsuming. At each iteration the detector is rerun.
..index:: AdjusterAdapter
@ -457,7 +457,7 @@ AdjusterAdapter
..c:type:: AdjusterAdapter
Class providing an interface for adjusting parameters of a feature detector. This interface is used by :func:`DynamicAdaptedFeatureDetector` . It is a wrapper for :func:`FeatureDetector` that enables adjusting parameters after detection.?? ::
Class providing an interface for adjusting parameters of a feature detector. This interface is used by :ref:`DynamicAdaptedFeatureDetector` . It is a wrapper for :ref:`FeatureDetector` that enables adjusting parameters after detection.?? ::
class AdjusterAdapter: public FeatureDetector
{
@ -470,9 +470,9 @@ Class providing an interface for adjusting parameters of a feature detector. Thi
See
:func:`FastAdjuster`,
:func:`StarAdjuster`,
:func:`SurfAdjuster` for concrete implementations.
:ref:`FastAdjuster`,
:ref:`StarAdjuster`,
:ref:`SurfAdjuster` for concrete implementations.
..index:: AdjusterAdapter::tooFew
@ -501,7 +501,7 @@ AdjusterAdapter::tooMany
----------------------------
..c:function:: virtual void tooMany(int max, int n_detected) = 0
Adjusts the detector parameters detect less features.
Adjusts the detector parameters to detect less features.
:param max:Maximum desired number of features.
@ -538,7 +538,7 @@ FastAdjuster
..c:type:: FastAdjuster
:func:`AdjusterAdapter` for :func:`FastFeatureDetector`. This class decrements or increments the threshhold by 1.?? ::
:ref:`AdjusterAdapter` for :ref:`FastFeatureDetector`. This class decrements or increments the threshhold by 1.?? ::
class FastAdjuster FastAdjuster: public AdjusterAdapter
{
@ -554,7 +554,7 @@ StarAdjuster
..c:type:: StarAdjuster
:func:`AdjusterAdapter` for :func:`StarFeatureDetector` . This class adjusts the ``responseThreshhold`` of ``StarFeatureDetector`` . ::
:ref:`AdjusterAdapter` for :ref:`StarFeatureDetector` . This class adjusts the ``responseThreshhold`` of ``StarFeatureDetector`` . ::
class StarAdjuster: public AdjusterAdapter
{
@ -569,7 +569,7 @@ SurfAdjuster
..c:type:: SurfAdjuster
:func:`AdjusterAdapter` for :func:`SurfFeatureDetector` . This class adjusts the ``hessianThreshold`` of ``SurfFeatureDetector`` . ::
:ref:`AdjusterAdapter` for :ref:`SurfFeatureDetector` . This class adjusts the ``hessianThreshold`` of ``SurfFeatureDetector`` . ::
Provides the ``DynamicAdaptedFeatureDetector`` constructor.??
:param adjaster::func:`AdjusterAdapter` that detects features and adjusts parameters.??formatting issue again
:param adjaster::ref:`AdjusterAdapter` that detects features and adjusts parameters.??formatting issue again
:param min_features:Minimum desired number features.
:param min_features:Minimum desired number of features.
:param max_features:Maximum desired number of features.
:param max_iters:Maximum number of times to try adjusting the feature detector parameters. For :func:`FastAdjuster` , this number can be high, but with ``Star`` or ``Surf`` , many iterations can be time-consuming. At each iteration the detector is rerun.
:param max_iters:Maximum number of times to try adjusting the feature detector parameters. For :ref:`FastAdjuster` , this number can be high, but with ``Star`` or ``Surf`` many iterations can be time-consuming. At each iteration the detector is rerun.
..index:: AdjusterAdapter
@ -942,7 +943,7 @@ AdjusterAdapter
..c:type:: AdjusterAdapter
Class providing an interface for adjusting parameters of a feature detector. This interface is used by :func:`DynamicAdaptedFeatureDetector` . It is a wrapper for :func:`FeatureDetector` that enables adjusting parameters after detection. ::
Class providing an interface for adjusting parameters of a feature detector. This interface is used by :ref:`DynamicAdaptedFeatureDetector` . It is a wrapper for :ref:`FeatureDetector` that enables adjusting parameters after detection. ::
class AdjusterAdapter: public FeatureDetector
{
@ -954,9 +955,9 @@ Class providing an interface for adjusting parameters of a feature detector. Thi
};
See
:func:`FastAdjuster`,
:func:`StarAdjuster`,
:func:`SurfAdjuster` for concrete implementations.
:ref:`FastAdjuster`,
:ref:`StarAdjuster`,
:ref:`SurfAdjuster` for concrete implementations.
..index:: AdjusterAdapter::tooFew
@ -984,13 +985,13 @@ AdjusterAdapter::tooMany
----------------------------
..c:function:: virtual void tooMany(int max, int n_detected) = 0
Too many features were detected so, adjust the detector parameters accordingly - so that the next detection detects less features.
Adjusts the detector parameters to detect less features.
:param max:This maximum desired number features.
:param max:Maximum desired number of features.
:param n_detected:The actual number detected last run.
:param n_detected:Number of features detected during the latest run.
An example implementation of this is ::
Example: ::
void FastAdjuster::tooMany(int min, int n_detected)
{
@ -1004,7 +1005,9 @@ AdjusterAdapter::good
-------------------------
..c:function:: virtual bool good() const = 0
Are params maxed out or still valid? Returns false if the parameters can't be adjusted any more. An example implementation of this is ::
Are params maxed out or still valid?? Returns false if the parameters cannot be adjusted any more.
Example: ::
bool FastAdjuster::good() const
{
@ -1018,7 +1021,7 @@ FastAdjuster
..c:type:: FastAdjuster
:func:`AdjusterAdapter` for the :func:`FastFeatureDetector`. This will basically decrement or increment the threshhold by 1 ::
:ref:`AdjusterAdapter` for :ref:`FastFeatureDetector`. This class decrements or increments the threshhld by 1. ::
class FastAdjuster FastAdjuster: public AdjusterAdapter
{
@ -1035,7 +1038,7 @@ StarAdjuster
..c:type:: StarAdjuster
:func:`AdjusterAdapter` for the:func:`StarFeatureDetector` . This adjusts the responseThreshhold of StarFeatureDetector. ::
:ref:`AdjusterAdapter` for :ref:`StarFeatureDetector` . This classadjusts the responseThreshhold of StarFeatureDetector. ::
class StarAdjuster: public AdjusterAdapter
{
@ -1051,7 +1054,7 @@ SurfAdjuster
..c:type:: SurfAdjuster
:func:`AdjusterAdapter` for the:func:`SurfFeatureDetector` . This adjusts the hessianThreshold of SurfFeatureDetector. ::
:ref:`AdjusterAdapter` for :ref:`SurfFeatureDetector` . This class adjusts the ``hessianThreshold`` of ``SurfFeatureDetector``. ::
Abstract interface for extracting and matching a keypoint descriptor. There are aslo :ref:`DescriptorExtractor` and :ref:`DescriptorMatcher` for these purposes but their interfaces are intended for descriptors represented as vectors in a multidimensional space. ``GenericDescriptorMatcher`` is a more generic interface for descriptors. :ref:`DescriptorMatcher` and``GenericDescriptorMatcher`` have two groups of match methods: for matching keypoints of an image with another image or with an image set. ::
Abstract interface for extracting and matching a keypoint descriptor. There are also :ref:`DescriptorExtractor` and :ref:`DescriptorMatcher` for these purposes but their interfaces are intended for descriptors represented as vectors in a multidimensional space. ``GenericDescriptorMatcher`` is a more generic interface for descriptors. :ref:`DescriptorMatcher` and``GenericDescriptorMatcher`` have two groups of match methods: for matching keypoints of an image with another image or with an image set. ::
Finds the best match for query keypoints to the training set. In the first version of the method, a train image and keypoints detected on it are input arguments. In the second version, query keypoints are matched to a training collection set using ??. As in the mask can be set.??
:param flags:Flags setting drawing features. Possible ``flags`` bit values are defined by ``DrawMatchesFlags``.
This function draws matches of keypints from two images in the output image. Match is a line connecting two keypoints (circles). The structure ``DrawMatchesFlags`` is defined as follows:
This function draws matches of keypoints from two images in the output image. Match is a line connecting two keypoints (circles). The structure ``DrawMatchesFlags`` is defined as follows:
Similarly to ``getSignature``, but it uses a threshold for removing all signature elements below the threshold so that the signature is compressed.
Returns a signature for an image patch similarly to ``getSignature`` but uses a threshold for removing all signature elements below the threshold so that the signature is compressed.
:param patch:Image patch to calculate signature for
:param patch:Image patch to calculate the nsignature for.
:param sig:Output signature (array dimension is ``reduced_num_dim)``
:param sig:Output signature (array dimension is ``reduced_num_dim)`` .
:param thresh:The threshold that is used for compressing the signature
:param thresh:Threshold that is used for compressing the signature.
Applies quantization to the current randomized tree.
:param num_quant_bits:Number of bits are used for quantization
:param num_quant_bits:Number of bits used for quantization.
The example below demonstrates the usage of ``RTreeClassifier`` for feature matching. There are test and train images and features are extracted from both with SURF. Output is
The example below demonstrates the usage of ``RTreeClassifier`` for matching the features. The features are extracted from the test and train images with SURF. Output is
:math:`best\_corr` and
:math:`best\_corr\_idx` arrays that keep the best probabilities and corresponding features indices for every train feature. ::
:param 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.