Purpose: completed the feature2d chapter
authorElena Fedotova <no@email>
Sun, 8 May 2011 09:31:15 +0000 (09:31 +0000)
committerElena Fedotova <no@email>
Sun, 8 May 2011 09:31:15 +0000 (09:31 +0000)
modules/features2d/doc/object_categorization.rst

index 96689d1..ce639e7 100644 (file)
@@ -3,8 +3,7 @@ Object Categorization
 
 .. highlight:: cpp
 
-Some approaches based on local 2D features and used to object categorization
-are described in this section.
+This section describes some approaches based on local 2D features and used to categorize objects.
 
 .. index:: BOWTrainer
 
@@ -14,8 +13,8 @@ BOWTrainer
 ----------
 .. c:type:: BOWTrainer
 
-Abstract base class for training ''bag of visual words'' vocabulary from a set of descriptors.
-See e.g. ''Visual Categorization with Bags of Keypoints'' of Gabriella Csurka, Christopher R. Dance,
+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. ::
 
     class BOWTrainer
@@ -44,9 +43,9 @@ BOWTrainer::add
 -------------------
 .. c:function:: void BOWTrainer::add( const Mat\& descriptors )
 
-    Add descriptors to training set. The training set will be clustered using clustermethod to construct vocabulary.
+    Adds descriptors to a training set. The training set ise clustered using ``clustermethod`` to construct the vocabulary.
 
-    :param descriptors: Descriptors to add to training set. Each row of  ``descriptors``                                                 matrix is a one descriptor.
+    :param descriptors: Descriptors to add to a training set. Each row of  the ``descriptors``  matrix is a descriptor.
 
 .. index:: BOWTrainer::getDescriptors
 
@@ -54,7 +53,7 @@ BOWTrainer::getDescriptors
 ------------------------------
 .. c:function:: const vector<Mat>\& BOWTrainer::getDescriptors() const
 
-    Returns training set of descriptors.
+    Returns training set of descriptors.
 
 .. index:: BOWTrainer::descripotorsCount
 
@@ -62,7 +61,7 @@ BOWTrainer::descripotorsCount
 ---------------------------------
 .. c:function:: const vector<Mat>\& BOWTrainer::descripotorsCount() const
 
-    Returns count of all descriptors stored in the training set.
+    Returns the count of all descriptors stored in the training set.
 
 .. index:: BOWTrainer::cluster
 
@@ -70,11 +69,11 @@ BOWTrainer::cluster
 -----------------------
 .. c:function:: Mat BOWTrainer::cluster() const
 
-    Cluster train descriptors. Vocabulary consists from cluster centers. So this method returns vocabulary. In first method variant the stored in object train descriptors will be clustered, in second variant -- input descriptors will be clustered.
+    Clusters train descriptors. The vocabulary consists of cluster centers. So, this method returns the vocabulary. In the first variant of the method, train descriptors stored in the object are clustered. In the second variant, input descriptors are clustered.
 
 .. c:function:: Mat BOWTrainer::cluster( const Mat\& descriptors ) const
 
-    :param descriptors: Descriptors to cluster. Each row of  ``descriptors``                                                 matrix is a one descriptor. Descriptors will not be added to the inner train descriptor set.
+    :param descriptors: Descriptors to cluster. Each row of  the ``descriptors``  matrix is a descriptor. Descriptors are not added to the inner train descriptor set.
 
 .. index:: BOWKMeansTrainer
 
@@ -84,7 +83,7 @@ BOWKMeansTrainer
 ----------------
 .. c:type:: BOWKMeansTrainer
 
-:func:`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
     {
@@ -102,8 +101,8 @@ BOWKMeansTrainer
     };
 
 
-To gain an understanding of constructor parameters see
-:func:`kmeans` function
+To understand constructor parameters, see
+:ref:`kmeans` function
 arguments.
 
 .. index:: BOWImgDescriptorExtractor
@@ -114,11 +113,11 @@ BOWImgDescriptorExtractor
 -------------------------
 .. c:type:: BOWImgDescriptorExtractor
 
-Class to compute image descriptor using ''bad of visual words''. In few, such computing consists from the following steps:
+Class to compute an image descriptor using the ''bag of visual words''. Such a computation consists of the following steps:
 
-    #. Compute descriptors for given image and it's keypoints set
-    #. Find nearest visual words from vocabulary for each keypoint descriptor,
-    #. Image descriptor is a normalized histogram of vocabulary words encountered in the image. I.e. ``i`` -bin of the histogram is a frequency of ``i`` -word of vocabulary in the given image. ::
+    #. Compute descriptors for a given image and its keypoints set.
+    #. Find the nearest visual words from the vocabulary for each keypoint descriptor.
+    #. Image descriptor is a normalized histogram of vocabulary words encountered in the image. This means that the ``i`` -th bin of the histogram is a frequency of ``i`` -th word of the vocabulary in the given image.??this is not a step ::
 
         class BOWImgDescriptorExtractor
         {
@@ -147,11 +146,11 @@ BOWImgDescriptorExtractor::BOWImgDescriptorExtractor
 --------------------------------------------------------
 .. c:function:: BOWImgDescriptorExtractor::BOWImgDescriptorExtractor(           const Ptr<DescriptorExtractor>\& dextractor,          const Ptr<DescriptorMatcher>\& dmatcher )
 
-    Constructor.
+    Constructs ??.
 
-    :param dextractor: Descriptor extractor that will be used to compute descriptors for input image and it's keypoints.
+    :param dextractor: Descriptor extractor that is used to compute descriptors for an input image and its keypoints.
 
-    :param dmatcher: Descriptor matcher that will be used to find nearest word of trained vocabulary to each keupoints descriptor of the image.
+    :param dmatcher: Descriptor matcher that is used to find the nearest word of the trained vocabulary for each keypoint descriptor of the image.
 
 .. index:: BOWImgDescriptorExtractor::setVocabulary
 
@@ -159,9 +158,9 @@ BOWImgDescriptorExtractor::setVocabulary
 --------------------------------------------
 .. c:function:: void BOWImgDescriptorExtractor::setVocabulary( const Mat\& vocabulary )
 
-    Method to set visual vocabulary.
+    Sets a visual vocabulary.
 
-    :param vocabulary: Vocabulary (can be trained using inheritor of  :func:`BOWTrainer` ). Each row of vocabulary is a one visual word (cluster center).
+    :param vocabulary: Vocabulary (can be trained using the inheritor of  :ref:`BOWTrainer` ). Each row of the vocabulary is a visual word (cluster center).
 
 .. index:: BOWImgDescriptorExtractor::getVocabulary
 
@@ -169,7 +168,7 @@ BOWImgDescriptorExtractor::getVocabulary
 --------------------------------------------
 .. c:function:: const Mat\& BOWImgDescriptorExtractor::getVocabulary() const
 
-    Returns set vocabulary.
+    Returns the set vocabulary.
 
 .. index:: BOWImgDescriptorExtractor::compute
 
@@ -177,17 +176,17 @@ BOWImgDescriptorExtractor::compute
 --------------------------------------
 .. c:function:: void BOWImgDescriptorExtractor::compute( const Mat\& image,           vector<KeyPoint>\& keypoints, Mat\& imgDescriptor,           vector<vector<int> >* pointIdxsOfClusters=0,           Mat* descriptors=0 )
 
-    Compute image descriptor using set visual vocabulary.
+    Computes an image descriptor using the set visual vocabulary.
 
-    :param image: The image. Image descriptor will be computed for this.
+    :param image: Image. Image descriptor is computed for this.
 
     :param keypoints: Keypoints detected in the input image.
 
-    :param imgDescriptor: This is output, i.e. computed image descriptor.
+    :param imgDescriptor: Output computed image descriptor.
 
-    :param pointIdxsOfClusters: Indices of keypoints which belong to the cluster, i.e. ``pointIdxsOfClusters[i]``  is keypoint indices which belong to the  ``i-`` cluster (word of vocabulary) (returned if it is not 0.)
+    :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.
 
-    :param descriptors: Descriptors of the image keypoints (returned if it is not 0.)
+    :param descriptors: Descriptors of the image keypoints  that are returned if they are non-zero.
 
 .. index:: BOWImgDescriptorExtractor::descriptorSize
 
@@ -195,7 +194,7 @@ BOWImgDescriptorExtractor::descriptorSize
 ---------------------------------------------
 .. c:function:: int BOWImgDescriptorExtractor::descriptorSize() const
 
-    Returns image discriptor size, if vocabulary was set, and 0 otherwise.
+    Returns an image discriptor size if the vocabulary is set. Otherwise, it returns 0.
 
 .. index:: BOWImgDescriptorExtractor::descriptorType
 
@@ -203,5 +202,5 @@ BOWImgDescriptorExtractor::descriptorType
 ---------------------------------------------
 .. c:function:: int BOWImgDescriptorExtractor::descriptorType() const
 
-    Returns image descriptor type.
+    Returns an image descriptor type.