Package org.opencv.features2d

## Class Feature2D

- java.lang.Object
- - org.opencv.core.Algorithm
  - - org.opencv.features2d.Feature2D

- Direct Known Subclasses:
    `AgastFeatureDetector`, `AKAZE`, `BoostDesc`, `BriefDescriptorExtractor`, `BRISK`, `DAISY`, `FastFeatureDetector`, `FREAK`, `GFTTDetector`, `HarrisLaplaceFeatureDetector`, `KAZE`, `LATCH`, `LUCID`, `MSDDetector`, `MSER`, `ORB`, `SIFT`, `SimpleBlobDetector`, `StarDetector`, `SURF`, `VGG`

      public class Feature2D
      extends Algorithm

  Abstract base class for 2D image feature detectors and descriptor extractors

- - ### Field Summary

    - ### Fields inherited from class org.opencv.core.Algorithm

      `nativeObj`

  - ### Constructor Summary

    Constructors
    Modifier | Constructor | Description
    --- | --- | ---
    `protected` | `Feature2D​(long addr)` |

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `static Feature2D` | `__fromPtr__​(long addr)` |
    `void` | `compute​(java.util.List<Mat> images, java.util.List<MatOfKeyPoint> keypoints, java.util.List<Mat> descriptors)` |
    `void` | `compute​(Mat image, MatOfKeyPoint keypoints, Mat descriptors)` | Computes the descriptors for a set of keypoints detected in an image (first variant) or image set (second variant).
    `int` | `defaultNorm()` |
    `int` | `descriptorSize()` |
    `int` | `descriptorType()` |
    `void` | `detect​(java.util.List<Mat> images, java.util.List<MatOfKeyPoint> keypoints)` |
    `void` | `detect​(java.util.List<Mat> images, java.util.List<MatOfKeyPoint> keypoints, java.util.List<Mat> masks)` |
    `void` | `detect​(Mat image, MatOfKeyPoint keypoints)` | Detects keypoints in an image (first variant) or image set (second variant).
    `void` | `detect​(Mat image, MatOfKeyPoint keypoints, Mat mask)` | Detects keypoints in an image (first variant) or image set (second variant).
    `void` | `detectAndCompute​(Mat image, Mat mask, MatOfKeyPoint keypoints, Mat descriptors)` | Detects keypoints and computes the descriptors
    `void` | `detectAndCompute​(Mat image, Mat mask, MatOfKeyPoint keypoints, Mat descriptors, boolean useProvidedKeypoints)` | Detects keypoints and computes the descriptors
    `boolean` | `empty()` | Returns true if the Algorithm is empty (e.g.
    `protected void` | `finalize()` |
    `java.lang.String` | `getDefaultName()` | Returns the algorithm string identifier.
    `void` | `read​(java.lang.String fileName)` |
    `void` | `write​(java.lang.String fileName)` |

    - ### Methods inherited from class org.opencv.core.Algorithm

      `clear, getNativeObjAddr, save`

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

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

- - ### Constructor Detail

    - #### Feature2D

          protected Feature2D​(long addr)

  - ### Method Detail

    - #### __fromPtr__

          public static Feature2D __fromPtr__​(long addr)

    - #### getDefaultName

          public java.lang.String getDefaultName()

      Description copied from class: `Algorithm`
      Returns the algorithm string identifier. This string is used as top level xml/yml node tag when the object is saved to a file or string.
      Overrides:
        `getDefaultName` in class `Algorithm`
      Returns:
        automatically generated

    - #### empty

          public boolean empty()

      Description copied from class: `Algorithm`
      Returns true if the Algorithm is empty (e.g. in the very beginning or after unsuccessful read
      Overrides:
        `empty` in class `Algorithm`
      Returns:
        automatically generated

    - #### defaultNorm

          public int defaultNorm()

    - #### descriptorSize

          public int descriptorSize()

    - #### descriptorType

          public int descriptorType()

    - #### compute

          public void compute​(Mat image,
                              MatOfKeyPoint keypoints,
                              Mat descriptors)

      Computes the descriptors for a set of keypoints detected in an image (first variant) or image set (second variant).
      Parameters:
        `image` - Image.
        `keypoints` - Input collection of keypoints. Keypoints for which a descriptor cannot be computed are removed. Sometimes new keypoints can be added, for example: SIFT duplicates keypoint with several dominant orientations (for each orientation).
        `descriptors` - Computed descriptors. In the second variant of the method descriptors[i] are descriptors computed for a keypoints[i]. Row j is the keypoints (or keypoints[i]) is the descriptor for keypoint j-th keypoint.

    - #### compute

          public void compute​(java.util.List<Mat> images,
                              java.util.List<MatOfKeyPoint> keypoints,
                              java.util.List<Mat> descriptors)

      Parameters:
        `images` - Image set.
        `keypoints` - Input collection of keypoints. Keypoints for which a descriptor cannot be computed are removed. Sometimes new keypoints can be added, for example: SIFT duplicates keypoint with several dominant orientations (for each orientation).
        `descriptors` - Computed descriptors. In the second variant of the method descriptors[i] are descriptors computed for a keypoints[i]. Row j is the keypoints (or keypoints[i]) is the descriptor for keypoint j-th keypoint.

    - #### detect

          public void detect​(Mat image,
                             MatOfKeyPoint keypoints,
                             Mat mask)

      Detects keypoints in an image (first variant) or image set (second variant).
      Parameters:
        `image` - Image.
        `keypoints` - The detected keypoints. In the second variant of the method keypoints[i] is a set of keypoints detected in images[i] .
        `mask` - Mask specifying where to look for keypoints (optional). It must be a 8-bit integer matrix with non-zero values in the region of interest.

    - #### detect

          public void detect​(Mat image,
                             MatOfKeyPoint keypoints)

      Detects keypoints in an image (first variant) or image set (second variant).
      Parameters:
        `image` - Image.
        `keypoints` - The detected keypoints. In the second variant of the method keypoints[i] is a set of keypoints detected in images[i] . matrix with non-zero values in the region of interest.

    - #### detect

          public void detect​(java.util.List<Mat> images,
                             java.util.List<MatOfKeyPoint> keypoints,
                             java.util.List<Mat> masks)

      Parameters:
        `images` - Image set.
        `keypoints` - The detected keypoints. In the second variant of the method keypoints[i] is a set of keypoints detected in images[i] .
        `masks` - Masks for each input image specifying where to look for keypoints (optional). masks[i] is a mask for images[i].

    - #### detect

          public void detect​(java.util.List<Mat> images,
                             java.util.List<MatOfKeyPoint> keypoints)

      Parameters:
        `images` - Image set.
        `keypoints` - The detected keypoints. In the second variant of the method keypoints[i] is a set of keypoints detected in images[i] . masks[i] is a mask for images[i].

    - #### detectAndCompute

          public void detectAndCompute​(Mat image,
                                       Mat mask,
                                       MatOfKeyPoint keypoints,
                                       Mat descriptors,
                                       boolean useProvidedKeypoints)

      Detects keypoints and computes the descriptors
      Parameters:
        `image` - automatically generated
        `mask` - automatically generated
        `keypoints` - automatically generated
        `descriptors` - automatically generated
        `useProvidedKeypoints` - automatically generated

    - #### detectAndCompute

          public void detectAndCompute​(Mat image,
                                       Mat mask,
                                       MatOfKeyPoint keypoints,
                                       Mat descriptors)

      Detects keypoints and computes the descriptors
      Parameters:
        `image` - automatically generated
        `mask` - automatically generated
        `keypoints` - automatically generated
        `descriptors` - automatically generated

    - #### read

          public void read​(java.lang.String fileName)

    - #### write

          public void write​(java.lang.String fileName)

    - #### finalize

          protected void finalize()
                           throws java.lang.Throwable

      Overrides:
        `finalize` in class `Algorithm`
      Throws:
        `java.lang.Throwable`