org.opencv.features2d

## Class BOWTrainer

- java.lang.Object
- - org.opencv.features2d.BOWTrainer

- Direct Known Subclasses:
    BOWKMeansTrainer

      public class BOWTrainer
      extends Object

  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. :

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected long` | `nativeObj`

  - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `BOWTrainer(long addr)`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static BOWTrainer` | `__fromPtr__(long addr)`
    `void` | `add(Mat descriptors)` Adds descriptors to a training set.
    `void` | `clear()`
    `Mat` | `cluster()`
    `Mat` | `cluster(Mat descriptors)` Clusters train descriptors.
    `int` | `descriptorsCount()` Returns the count of all descriptors stored in the training set.
    `protected void` | `finalize()`
    `List<Mat>` | `getDescriptors()` Returns a training set of descriptors.
    `long` | `getNativeObjAddr()`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### nativeObj

          protected final long nativeObj

  - ### Constructor Detail

    - #### BOWTrainer

          protected BOWTrainer(long addr)

  - ### Method Detail

    - #### getNativeObjAddr

          public long getNativeObjAddr()

    - #### __fromPtr__

          public static BOWTrainer __fromPtr__(long addr)

    - #### cluster

          public Mat cluster(Mat descriptors)

      Clusters train descriptors.
      Parameters:
        `descriptors` - Descriptors to cluster. Each row of the descriptors matrix is a descriptor. Descriptors are not added to the inner train descriptor set. 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.
      Returns:
        automatically generated

    - #### cluster

          public Mat cluster()

    - #### descriptorsCount

          public int descriptorsCount()

      Returns the count of all descriptors stored in the training set.
      Returns:
        automatically generated

    - #### getDescriptors

          public List<Mat> getDescriptors()

      Returns a training set of descriptors.
      Returns:
        automatically generated

    - #### add

          public void add(Mat descriptors)

      Adds descriptors to a training set.
      Parameters:
        `descriptors` - Descriptors to add to a training set. Each row of the descriptors matrix is a descriptor. The training set is clustered using clustermethod to construct the vocabulary.

    - #### clear

          public void clear()

    - #### finalize

          protected void finalize()
                           throws Throwable

      Overrides:
        `finalize` in class `Object`
      Throws:
        `Throwable`

Generated on Wed Oct 9 2019 16:55:37 UTC / OpenCV 3.4.8