Feature2D.java 11.2 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299
//
// This file is auto-generated. Please don't modify it!
//
package org.opencv.features2d;

import java.util.ArrayList;
import java.util.List;
import org.opencv.core.Algorithm;
import org.opencv.core.Mat;
import org.opencv.core.MatOfKeyPoint;
import org.opencv.utils.Converters;

// C++: class Feature2D
/**
 * Abstract base class for 2D image feature detectors and descriptor extractors
 */
public class Feature2D extends Algorithm {

    protected Feature2D(long addr) { super(addr); }

    // internal usage only
    public static Feature2D __fromPtr__(long addr) { return new Feature2D(addr); }

    //
    // C++:  void cv::Feature2D::detect(Mat image, vector_KeyPoint& keypoints, Mat mask = Mat())
    //

    /**
     * Detects keypoints in an image (first variant) or image set (second variant).
     *
     *     @param image Image.
     *     @param keypoints The detected keypoints. In the second variant of the method keypoints[i] is a set
     *     of keypoints detected in images[i] .
     *     @param 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.
     */
    public void detect(Mat image, MatOfKeyPoint keypoints, Mat mask) {
        Mat keypoints_mat = keypoints;
        detect_0(nativeObj, image.nativeObj, keypoints_mat.nativeObj, mask.nativeObj);
    }

    /**
     * Detects keypoints in an image (first variant) or image set (second variant).
     *
     *     @param image Image.
     *     @param 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.
     */
    public void detect(Mat image, MatOfKeyPoint keypoints) {
        Mat keypoints_mat = keypoints;
        detect_1(nativeObj, image.nativeObj, keypoints_mat.nativeObj);
    }


    //
    // C++:  void cv::Feature2D::detect(vector_Mat images, vector_vector_KeyPoint& keypoints, vector_Mat masks = vector_Mat())
    //

    /**
     *
     *     @param images Image set.
     *     @param keypoints The detected keypoints. In the second variant of the method keypoints[i] is a set
     *     of keypoints detected in images[i] .
     *     @param masks Masks for each input image specifying where to look for keypoints (optional).
     *     masks[i] is a mask for images[i].
     */
    public void detect(List<Mat> images, List<MatOfKeyPoint> keypoints, List<Mat> masks) {
        Mat images_mat = Converters.vector_Mat_to_Mat(images);
        Mat keypoints_mat = new Mat();
        Mat masks_mat = Converters.vector_Mat_to_Mat(masks);
        detect_2(nativeObj, images_mat.nativeObj, keypoints_mat.nativeObj, masks_mat.nativeObj);
        Converters.Mat_to_vector_vector_KeyPoint(keypoints_mat, keypoints);
        keypoints_mat.release();
    }

    /**
     *
     *     @param images Image set.
     *     @param 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].
     */
    public void detect(List<Mat> images, List<MatOfKeyPoint> keypoints) {
        Mat images_mat = Converters.vector_Mat_to_Mat(images);
        Mat keypoints_mat = new Mat();
        detect_3(nativeObj, images_mat.nativeObj, keypoints_mat.nativeObj);
        Converters.Mat_to_vector_vector_KeyPoint(keypoints_mat, keypoints);
        keypoints_mat.release();
    }


    //
    // C++:  void cv::Feature2D::compute(Mat image, vector_KeyPoint& keypoints, Mat& descriptors)
    //

    /**
     * Computes the descriptors for a set of keypoints detected in an image (first variant) or image set
     *     (second variant).
     *
     *     @param image Image.
     *     @param 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).
     *     @param 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.
     */
    public void compute(Mat image, MatOfKeyPoint keypoints, Mat descriptors) {
        Mat keypoints_mat = keypoints;
        compute_0(nativeObj, image.nativeObj, keypoints_mat.nativeObj, descriptors.nativeObj);
    }


    //
    // C++:  void cv::Feature2D::compute(vector_Mat images, vector_vector_KeyPoint& keypoints, vector_Mat& descriptors)
    //

    /**
     *
     *
     *     @param images Image set.
     *     @param 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).
     *     @param 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.
     */
    public void compute(List<Mat> images, List<MatOfKeyPoint> keypoints, List<Mat> descriptors) {
        Mat images_mat = Converters.vector_Mat_to_Mat(images);
        List<Mat> keypoints_tmplm = new ArrayList<Mat>((keypoints != null) ? keypoints.size() : 0);
        Mat keypoints_mat = Converters.vector_vector_KeyPoint_to_Mat(keypoints, keypoints_tmplm);
        Mat descriptors_mat = new Mat();
        compute_1(nativeObj, images_mat.nativeObj, keypoints_mat.nativeObj, descriptors_mat.nativeObj);
        Converters.Mat_to_vector_vector_KeyPoint(keypoints_mat, keypoints);
        keypoints_mat.release();
        Converters.Mat_to_vector_Mat(descriptors_mat, descriptors);
        descriptors_mat.release();
    }


    //
    // C++:  void cv::Feature2D::detectAndCompute(Mat image, Mat mask, vector_KeyPoint& keypoints, Mat& descriptors, bool useProvidedKeypoints = false)
    //

    /**
     * Detects keypoints and computes the descriptors
     * @param image automatically generated
     * @param mask automatically generated
     * @param keypoints automatically generated
     * @param descriptors automatically generated
     * @param useProvidedKeypoints automatically generated
     */
    public void detectAndCompute(Mat image, Mat mask, MatOfKeyPoint keypoints, Mat descriptors, boolean useProvidedKeypoints) {
        Mat keypoints_mat = keypoints;
        detectAndCompute_0(nativeObj, image.nativeObj, mask.nativeObj, keypoints_mat.nativeObj, descriptors.nativeObj, useProvidedKeypoints);
    }

    /**
     * Detects keypoints and computes the descriptors
     * @param image automatically generated
     * @param mask automatically generated
     * @param keypoints automatically generated
     * @param descriptors automatically generated
     */
    public void detectAndCompute(Mat image, Mat mask, MatOfKeyPoint keypoints, Mat descriptors) {
        Mat keypoints_mat = keypoints;
        detectAndCompute_1(nativeObj, image.nativeObj, mask.nativeObj, keypoints_mat.nativeObj, descriptors.nativeObj);
    }


    //
    // C++:  int cv::Feature2D::descriptorSize()
    //

    public int descriptorSize() {
        return descriptorSize_0(nativeObj);
    }


    //
    // C++:  int cv::Feature2D::descriptorType()
    //

    public int descriptorType() {
        return descriptorType_0(nativeObj);
    }


    //
    // C++:  int cv::Feature2D::defaultNorm()
    //

    public int defaultNorm() {
        return defaultNorm_0(nativeObj);
    }


    //
    // C++:  void cv::Feature2D::write(String fileName)
    //

    public void write(String fileName) {
        write_0(nativeObj, fileName);
    }


    //
    // C++:  void cv::Feature2D::read(String fileName)
    //

    public void read(String fileName) {
        read_0(nativeObj, fileName);
    }


    //
    // C++:  void cv::Feature2D::read(FileNode arg1)
    //

    // Unknown type 'FileNode' (I), skipping the function


    //
    // C++:  bool cv::Feature2D::empty()
    //

    public boolean empty() {
        return empty_0(nativeObj);
    }


    //
    // C++:  String cv::Feature2D::getDefaultName()
    //

    public String getDefaultName() {
        return getDefaultName_0(nativeObj);
    }


    //
    // C++:  void cv::Feature2D::write(FileStorage fs, String name)
    //

    // Unknown type 'FileStorage' (I), skipping the function


    @Override
    protected void finalize() throws Throwable {
        delete(nativeObj);
    }



    // C++:  void cv::Feature2D::detect(Mat image, vector_KeyPoint& keypoints, Mat mask = Mat())
    private static native void detect_0(long nativeObj, long image_nativeObj, long keypoints_mat_nativeObj, long mask_nativeObj);
    private static native void detect_1(long nativeObj, long image_nativeObj, long keypoints_mat_nativeObj);

    // C++:  void cv::Feature2D::detect(vector_Mat images, vector_vector_KeyPoint& keypoints, vector_Mat masks = vector_Mat())
    private static native void detect_2(long nativeObj, long images_mat_nativeObj, long keypoints_mat_nativeObj, long masks_mat_nativeObj);
    private static native void detect_3(long nativeObj, long images_mat_nativeObj, long keypoints_mat_nativeObj);

    // C++:  void cv::Feature2D::compute(Mat image, vector_KeyPoint& keypoints, Mat& descriptors)
    private static native void compute_0(long nativeObj, long image_nativeObj, long keypoints_mat_nativeObj, long descriptors_nativeObj);

    // C++:  void cv::Feature2D::compute(vector_Mat images, vector_vector_KeyPoint& keypoints, vector_Mat& descriptors)
    private static native void compute_1(long nativeObj, long images_mat_nativeObj, long keypoints_mat_nativeObj, long descriptors_mat_nativeObj);

    // C++:  void cv::Feature2D::detectAndCompute(Mat image, Mat mask, vector_KeyPoint& keypoints, Mat& descriptors, bool useProvidedKeypoints = false)
    private static native void detectAndCompute_0(long nativeObj, long image_nativeObj, long mask_nativeObj, long keypoints_mat_nativeObj, long descriptors_nativeObj, boolean useProvidedKeypoints);
    private static native void detectAndCompute_1(long nativeObj, long image_nativeObj, long mask_nativeObj, long keypoints_mat_nativeObj, long descriptors_nativeObj);

    // C++:  int cv::Feature2D::descriptorSize()
    private static native int descriptorSize_0(long nativeObj);

    // C++:  int cv::Feature2D::descriptorType()
    private static native int descriptorType_0(long nativeObj);

    // C++:  int cv::Feature2D::defaultNorm()
    private static native int defaultNorm_0(long nativeObj);

    // C++:  void cv::Feature2D::write(String fileName)
    private static native void write_0(long nativeObj, String fileName);

    // C++:  void cv::Feature2D::read(String fileName)
    private static native void read_0(long nativeObj, String fileName);

    // C++:  bool cv::Feature2D::empty()
    private static native boolean empty_0(long nativeObj);

    // C++:  String cv::Feature2D::getDefaultName()
    private static native String getDefaultName_0(long nativeObj);

    // native support for java finalize()
    private static native void delete(long nativeObj);

}