Commit 12d98a7d authored by Elena Fedotova's avatar Elena Fedotova

Purpose: completed the feature2d chapter

parent 4f335d18
......@@ -41,7 +41,7 @@ Abstract base class for computing descriptors for image keypoints ::
In this interface, a keypoint descriptor can be represented as a
dense, fixed-dimensional vector of a basic type. Most descriptors
dense, fixed-dimension vector of a basic type. Most descriptors
follow this pattern as it simplifies computing
distances between descriptors. Therefore, a collection of
descriptors is represented as
......@@ -103,13 +103,13 @@ DescriptorExtractor::create
The current implementation supports the following types of a descriptor extractor:
* ``"SIFT"`` -- :func:`SiftFeatureDetector`
* ``"SURF"`` -- :func:`SurfFeatureDetector`
* ``"BRIEF"`` -- :func:`BriefFeatureDetector`
* ``"SIFT"`` -- :ref:`SiftFeatureDetector`
* ``"SURF"`` -- :ref:`SurfFeatureDetector`
* ``"BRIEF"`` -- :ref:`BriefFeatureDetector`
A combined format is also supported: descriptor extractor adapter name ( ``"Opponent"`` --
:ref:`OpponentColorDescriptorExtractor` ) + descriptor extractor name (see above),
for example, ``"OpponentSIFT"`` .
for example: ``"OpponentSIFT"`` .
.. index:: SiftDescriptorExtractor
......@@ -117,7 +117,7 @@ SiftDescriptorExtractor
-----------------------
.. c:type:: SiftDescriptorExtractor
Wrapping class for descriptors computing using the
Wrapping class for computing descriptors by using the
:ref:`SIFT` class ::
class SiftDescriptorExtractor : public DescriptorExtractor
......@@ -147,7 +147,7 @@ SurfDescriptorExtractor
-----------------------
.. c:type:: SurfDescriptorExtractor
Wrapping class for computing descriptors using the
Wrapping class for computing descriptors by using the
:ref:`SURF` class ::
class SurfDescriptorExtractor : public DescriptorExtractor
......@@ -171,7 +171,7 @@ CalonderDescriptorExtractor
---------------------------
.. c:type:: CalonderDescriptorExtractor
Wrapping class for computing descriptors using the
Wrapping class for computing descriptors by using the
:ref:`RTreeClassifier` class ::
template<typename T>
......@@ -197,7 +197,7 @@ OpponentColorDescriptorExtractor
--------------------------------
.. c:type:: OpponentColorDescriptorExtractor
Class adapting a descriptor extractor to compute descripors in the Opponent Color Space
Class adapting a descriptor extractor to compute descriptors in the Opponent Color Space
(refer to Van de Sande et al., CGIV 2008 *Color Descriptors for Object Category Recognition*).
Input RGB image is transformed in the Opponent Color Space. Then, an unadapted descriptor extractor
(set in the constructor) computes descriptors on each of three channels and concatenates
......
......@@ -136,7 +136,7 @@ DescriptorMatcher::empty
----------------------------
.. c:function:: bool DescriptorMatcher::empty() const
Returns true if there are not train descriptors in the collection.
Returns true if there are no train descriptors in the collection.
.. index:: DescriptorMatcher::isMaskSupported
......@@ -160,7 +160,7 @@ DescriptorMatcher::match
----------------------------
.. c:function:: void DescriptorMatcher::match( const Mat\& queryDescriptors, const Mat\& trainDescriptors, vector<DMatch>\& matches, const Mat\& mask=Mat() ) const
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 belong to 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.??
.. c:function:: void DescriptorMatcher::match( const Mat\& queryDescriptors, vector<DMatch>\& matches, const vector<Mat>\& masks=vector<Mat>() )
......@@ -172,7 +172,7 @@ DescriptorMatcher::match
: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]``.
.. index:: DescriptorMatcher::knnMatch
......@@ -196,7 +196,6 @@ DescriptorMatcher::knnMatch
DescriptorMatcher::radiusMatch
----------------------------------
:func:`DescriptorMatcher::match`
.. c:function:: void DescriptorMatcher::radiusMatch( const Mat\& queryDescriptors, const Mat\& trainDescriptors, vector<vector<DMatch> >\& matches, float maxDistance, const Mat\& mask=Mat(), bool compactResult=false ) const
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 ??.
......@@ -225,14 +224,13 @@ DescriptorMatcher::clone
DescriptorMatcher::create
-----------------------------
:func:`DescriptorMatcher`
.. c:function:: Ptr<DescriptorMatcher> DescriptorMatcher::create( const string\& descriptorMatcherType )
Creates a descriptor matcher of a given type with the default parameters (using default constructor).
:param descriptorMatcherType: Descriptor matcher type.
:param descriptorMatcherType: Descriptor matcher type.??broken param formatting
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: ::
template<typename T>
struct Accumulator
......
......@@ -18,7 +18,7 @@ GenericDescriptorMatcher
------------------------
.. c:type:: GenericDescriptorMatcher
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. ::
class GenericDescriptorMatcher
{
......@@ -154,7 +154,6 @@ GenericDescriptorMatcher::classify
GenericDescriptorMatcher::match
-----------------------------------
:func:`GenericDescriptorMatcher::add` :func:`DescriptorMatcher::match`
.. c:function:: void GenericDescriptorMatcher::match( const Mat\& queryImage, vector<KeyPoint>\& queryKeypoints, const Mat\& trainImage, vector<KeyPoint>\& trainKeypoints, vector<DMatch>\& matches, const Mat\& mask=Mat() ) const
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.??
......
......@@ -30,7 +30,7 @@ drawMatches
: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:
.. code-block:: cpp
......
......@@ -84,7 +84,7 @@ Class implementing the Star keypoint detector ::
void operator()(const Mat& image, vector<KeyPoint>& keypoints) const;
};
The class implements a modified version of the CenSurE keypoint detector described in
The class implements a modified version of the ``CenSurE`` keypoint detector described in
[Agrawal08].
.. index:: SIFT
......@@ -301,19 +301,19 @@ RandomizedTree::train
.. c:function:: void train(std::vector<BaseKeypoint> const& base_set, RNG& rng, PatchGenerator& make_patch, int depth, int views, size_t reduced_num_dim, int num_quant_bits)
:param base_set: Vector of ``BaseKeypoint`` type. Contains keypoints from the image that are used for training
:param base_set: Vector of ``BaseKeypoint`` type. Contains image keypoints used for training.
:param rng: Random numbers generator is used for training
:param rng: Random-number generator used for training.
:param make_patch: Patch generator is used for training
:param make_patch: Patch generator used for training.
:param depth: Maximum tree depth
:param depth: Maximum tree depth.
:param views: The number of random views of each keypoint neighborhood to generate
:param views: Number of random views of each keypoint neighborhood to generate.
:param reduced_num_dim: Number of dimensions are used in compressed signature
:param reduced_num_dim: Number of dimensions used in the compressed signature.
:param num_quant_bits: Number of bits are used for quantization
:param num_quant_bits: Number of bits used for quantization.
.. index:: RandomizedTree::read
......@@ -323,13 +323,13 @@ RandomizedTree::read
.. c:function:: read(std::istream &is, int num_quant_bits)
Read a pre-saved randomized tree from a file or stream.
Reads a pre-saved randomized tree from a file or stream.
:param file_name: Name of the file that contains randomized tree data.
:param is: Input stream associated with the file that contains randomized tree data.
:param num_quant_bits: Number of bits are used for quantization
:param num_quant_bits: Number of bits used for quantization.
.. index:: RandomizedTree::write
......@@ -353,7 +353,7 @@ RandomizedTree::applyQuantization
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.
.. index:: RTreeNode
......@@ -391,7 +391,7 @@ RTreeClassifier
---------------
.. c:type:: RTreeClassifier
Class containing ``RTreeClassifier`` . It represents the Calonder descriptor that was originally introduced by Michael Calonder ::
Class containing ``RTreeClassifier`` . It represents the Calonder descriptor that was originally introduced by Michael Calonder. ::
class CV_EXPORTS RTreeClassifier
{
......@@ -465,23 +465,23 @@ RTreeClassifier::train
.. c:function:: void train(vector<BaseKeypoint> const& base_set, RNG& rng, PatchGenerator& make_patch, int num_trees = RTreeClassifier::DEFAULT_TREES, int depth = DEFAULT_DEPTH, int views = DEFAULT_VIEWS, size_t reduced_num_dim = DEFAULT_REDUCED_NUM_DIM, int num_quant_bits = DEFAULT_NUM_QUANT_BITS, bool print_status = true)
:param base_set: Vector of ``BaseKeypoint`` type. Contains image keypoints used for training
:param base_set: Vector of ``BaseKeypoint`` type. It contains image keypoints used for training.
:param rng: Random-number generator is used for training
:param rng: Random-number generator used for training.
:param make_patch: Patch generator is used for training
:param make_patch: Patch generator used for training.
:param num_trees: Number of randomized trees used in RTreeClassificator
:param num_trees: Number of randomized trees used in ``RTreeClassificator`` .
:param depth: Maximum tree depth
:param depth: Maximum tree depth.
:param views: The number of random views of each keypoint neighborhood to generate
:param views: Number of random views of each keypoint neighborhood to generate.
:param reduced_num_dim: Number of dimensions are used in compressed signature
:param reduced_num_dim: Number of dimensions used in the compressed signature.
:param num_quant_bits: Number of bits are used for quantization
:param num_quant_bits: Number of bits used for quantization.
:param print_status: Print current status of training on the console
:param print_status: Current status of training printed on the console.
.. index:: RTreeClassifier::getSignature
......@@ -493,8 +493,8 @@ RTreeClassifier::getSignature
.. c:function:: void getSignature(IplImage *patch, float *sig)
:param patch: Image patch to calculate signature for
:param sig: Output signature (array dimension is ``reduced_num_dim)``
:param patch: Image patch to calculate the signature for.
:param sig: Output signature (array dimension is ``reduced_num_dim)`` .
.. index:: RTreeClassifier::getSparseSignature
......@@ -503,13 +503,13 @@ RTreeClassifier::getSparseSignature
.. c:function:: void getSparseSignature(IplImage *patch, float *sig, float thresh)
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.
.. index:: RTreeClassifier::countNonZeroElements
......@@ -523,7 +523,7 @@ RTreeClassifier::countNonZeroElements
:param n: Input vector size.
:param tol: The threshold used for counting elements. We take all elements are less than ``tol`` as zero elements
:param tol: Threshold used for counting elements. All elements less than ``tol`` are considered as zero elements.
.. index:: RTreeClassifier::read
......@@ -545,7 +545,7 @@ RTreeClassifier::write
--------------------------
.. c:function:: void write(const char* file_name) const
Writes the current RTreeClassifier to a file or stream.
Writes the current ``RTreeClassifier`` to a file or stream.
.. c:function:: void write(std::ostream &os) const
......@@ -561,9 +561,9 @@ RTreeClassifier::setQuantization
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. ::
......
......@@ -3,7 +3,7 @@ Object Categorization
.. highlight:: cpp
This section describes some approaches based on local 2D features and used to categorize objects.
This section describes approaches based on local 2D features and used to categorize objects.
.. index:: BOWTrainer
......@@ -13,7 +13,7 @@ BOWTrainer
----------
.. c:type:: BOWTrainer
Abstract base class for training the ''bag of visual words'' vocabulary from a set of descriptors.
Abstract base class for training the *bag of visual words* vocabulary from a set of descriptors.
For details, see, for example, *Visual Categorization with Bags of Keypoints* by Gabriella Csurka, Christopher R. Dance,
Lixin Fan, Jutta Willamowski, Cedric Bray, 2004. ::
......@@ -43,7 +43,7 @@ BOWTrainer::add
-------------------
.. c:function:: void BOWTrainer::add( const Mat\& descriptors )
Adds descriptors to a training set. The training set ise clustered using ``clustermethod`` to construct the vocabulary.
Adds descriptors to a training set. The training set is clustered using ``clustermethod`` to construct the vocabulary.
:param descriptors: Descriptors to add to a training set. Each row of the ``descriptors`` matrix is a descriptor.
......@@ -83,7 +83,7 @@ BOWKMeansTrainer
----------------
.. c:type:: BOWKMeansTrainer
:ref:`kmeans` -based class to train visual vocabulary using the ''bag of visual words'' approach ::
:ref:`kmeans` -based class to train visual vocabulary using the *bag of visual words* approach ::
class BOWKMeansTrainer : public BOWTrainer
{
......@@ -178,11 +178,11 @@ BOWImgDescriptorExtractor::compute
Computes an image descriptor using the set visual vocabulary.
:param image: Image. Image descriptor is computed for this.
:param image: Image. Descriptor is computed for each image.??
:param keypoints: Keypoints detected in the input image.
:param imgDescriptor: Output computed image descriptor.
:param imgDescriptor: Computed output image descriptor.
: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.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment