001//
002// This file is auto-generated. Please don't modify it!
003//
004package org.opencv.features2d;
005
006import java.util.ArrayList;
007import java.util.List;
008import org.opencv.core.Algorithm;
009import org.opencv.core.Mat;
010import org.opencv.core.MatOfKeyPoint;
011import org.opencv.utils.Converters;
012
013// C++: class Feature2D
014/**
015 * Abstract base class for 2D image feature detectors and descriptor extractors
016 */
017public class Feature2D extends Algorithm {
018
019    protected Feature2D(long addr) { super(addr); }
020
021    // internal usage only
022    public static Feature2D __fromPtr__(long addr) { return new Feature2D(addr); }
023
024    //
025    // C++:  void cv::Feature2D::detect(Mat image, vector_KeyPoint& keypoints, Mat mask = Mat())
026    //
027
028    /**
029     * Detects keypoints in an image (first variant) or image set (second variant).
030     *
031     *     @param image Image.
032     *     @param keypoints The detected keypoints. In the second variant of the method keypoints[i] is a set
033     *     of keypoints detected in images[i] .
034     *     @param mask Mask specifying where to look for keypoints (optional). It must be a 8-bit integer
035     *     matrix with non-zero values in the region of interest.
036     */
037    public void detect(Mat image, MatOfKeyPoint keypoints, Mat mask) {
038        Mat keypoints_mat = keypoints;
039        detect_0(nativeObj, image.nativeObj, keypoints_mat.nativeObj, mask.nativeObj);
040    }
041
042    /**
043     * Detects keypoints in an image (first variant) or image set (second variant).
044     *
045     *     @param image Image.
046     *     @param keypoints The detected keypoints. In the second variant of the method keypoints[i] is a set
047     *     of keypoints detected in images[i] .
048     *     matrix with non-zero values in the region of interest.
049     */
050    public void detect(Mat image, MatOfKeyPoint keypoints) {
051        Mat keypoints_mat = keypoints;
052        detect_1(nativeObj, image.nativeObj, keypoints_mat.nativeObj);
053    }
054
055
056    //
057    // C++:  void cv::Feature2D::detect(vector_Mat images, vector_vector_KeyPoint& keypoints, vector_Mat masks = vector_Mat())
058    //
059
060    /**
061     *
062     *     @param images Image set.
063     *     @param keypoints The detected keypoints. In the second variant of the method keypoints[i] is a set
064     *     of keypoints detected in images[i] .
065     *     @param masks Masks for each input image specifying where to look for keypoints (optional).
066     *     masks[i] is a mask for images[i].
067     */
068    public void detect(List<Mat> images, List<MatOfKeyPoint> keypoints, List<Mat> masks) {
069        Mat images_mat = Converters.vector_Mat_to_Mat(images);
070        Mat keypoints_mat = new Mat();
071        Mat masks_mat = Converters.vector_Mat_to_Mat(masks);
072        detect_2(nativeObj, images_mat.nativeObj, keypoints_mat.nativeObj, masks_mat.nativeObj);
073        Converters.Mat_to_vector_vector_KeyPoint(keypoints_mat, keypoints);
074        keypoints_mat.release();
075    }
076
077    /**
078     *
079     *     @param images Image set.
080     *     @param keypoints The detected keypoints. In the second variant of the method keypoints[i] is a set
081     *     of keypoints detected in images[i] .
082     *     masks[i] is a mask for images[i].
083     */
084    public void detect(List<Mat> images, List<MatOfKeyPoint> keypoints) {
085        Mat images_mat = Converters.vector_Mat_to_Mat(images);
086        Mat keypoints_mat = new Mat();
087        detect_3(nativeObj, images_mat.nativeObj, keypoints_mat.nativeObj);
088        Converters.Mat_to_vector_vector_KeyPoint(keypoints_mat, keypoints);
089        keypoints_mat.release();
090    }
091
092
093    //
094    // C++:  void cv::Feature2D::compute(Mat image, vector_KeyPoint& keypoints, Mat& descriptors)
095    //
096
097    /**
098     * Computes the descriptors for a set of keypoints detected in an image (first variant) or image set
099     *     (second variant).
100     *
101     *     @param image Image.
102     *     @param keypoints Input collection of keypoints. Keypoints for which a descriptor cannot be
103     *     computed are removed. Sometimes new keypoints can be added, for example: SIFT duplicates keypoint
104     *     with several dominant orientations (for each orientation).
105     *     @param descriptors Computed descriptors. In the second variant of the method descriptors[i] are
106     *     descriptors computed for a keypoints[i]. Row j is the keypoints (or keypoints[i]) is the
107     *     descriptor for keypoint j-th keypoint.
108     */
109    public void compute(Mat image, MatOfKeyPoint keypoints, Mat descriptors) {
110        Mat keypoints_mat = keypoints;
111        compute_0(nativeObj, image.nativeObj, keypoints_mat.nativeObj, descriptors.nativeObj);
112    }
113
114
115    //
116    // C++:  void cv::Feature2D::compute(vector_Mat images, vector_vector_KeyPoint& keypoints, vector_Mat& descriptors)
117    //
118
119    /**
120     *
121     *
122     *     @param images Image set.
123     *     @param keypoints Input collection of keypoints. Keypoints for which a descriptor cannot be
124     *     computed are removed. Sometimes new keypoints can be added, for example: SIFT duplicates keypoint
125     *     with several dominant orientations (for each orientation).
126     *     @param descriptors Computed descriptors. In the second variant of the method descriptors[i] are
127     *     descriptors computed for a keypoints[i]. Row j is the keypoints (or keypoints[i]) is the
128     *     descriptor for keypoint j-th keypoint.
129     */
130    public void compute(List<Mat> images, List<MatOfKeyPoint> keypoints, List<Mat> descriptors) {
131        Mat images_mat = Converters.vector_Mat_to_Mat(images);
132        List<Mat> keypoints_tmplm = new ArrayList<Mat>((keypoints != null) ? keypoints.size() : 0);
133        Mat keypoints_mat = Converters.vector_vector_KeyPoint_to_Mat(keypoints, keypoints_tmplm);
134        Mat descriptors_mat = new Mat();
135        compute_1(nativeObj, images_mat.nativeObj, keypoints_mat.nativeObj, descriptors_mat.nativeObj);
136        Converters.Mat_to_vector_vector_KeyPoint(keypoints_mat, keypoints);
137        keypoints_mat.release();
138        Converters.Mat_to_vector_Mat(descriptors_mat, descriptors);
139        descriptors_mat.release();
140    }
141
142
143    //
144    // C++:  void cv::Feature2D::detectAndCompute(Mat image, Mat mask, vector_KeyPoint& keypoints, Mat& descriptors, bool useProvidedKeypoints = false)
145    //
146
147    /**
148     * Detects keypoints and computes the descriptors
149     * @param image automatically generated
150     * @param mask automatically generated
151     * @param keypoints automatically generated
152     * @param descriptors automatically generated
153     * @param useProvidedKeypoints automatically generated
154     */
155    public void detectAndCompute(Mat image, Mat mask, MatOfKeyPoint keypoints, Mat descriptors, boolean useProvidedKeypoints) {
156        Mat keypoints_mat = keypoints;
157        detectAndCompute_0(nativeObj, image.nativeObj, mask.nativeObj, keypoints_mat.nativeObj, descriptors.nativeObj, useProvidedKeypoints);
158    }
159
160    /**
161     * Detects keypoints and computes the descriptors
162     * @param image automatically generated
163     * @param mask automatically generated
164     * @param keypoints automatically generated
165     * @param descriptors automatically generated
166     */
167    public void detectAndCompute(Mat image, Mat mask, MatOfKeyPoint keypoints, Mat descriptors) {
168        Mat keypoints_mat = keypoints;
169        detectAndCompute_1(nativeObj, image.nativeObj, mask.nativeObj, keypoints_mat.nativeObj, descriptors.nativeObj);
170    }
171
172
173    //
174    // C++:  int cv::Feature2D::descriptorSize()
175    //
176
177    public int descriptorSize() {
178        return descriptorSize_0(nativeObj);
179    }
180
181
182    //
183    // C++:  int cv::Feature2D::descriptorType()
184    //
185
186    public int descriptorType() {
187        return descriptorType_0(nativeObj);
188    }
189
190
191    //
192    // C++:  int cv::Feature2D::defaultNorm()
193    //
194
195    public int defaultNorm() {
196        return defaultNorm_0(nativeObj);
197    }
198
199
200    //
201    // C++:  void cv::Feature2D::write(String fileName)
202    //
203
204    public void write(String fileName) {
205        write_0(nativeObj, fileName);
206    }
207
208
209    //
210    // C++:  void cv::Feature2D::read(String fileName)
211    //
212
213    public void read(String fileName) {
214        read_0(nativeObj, fileName);
215    }
216
217
218    //
219    // C++:  void cv::Feature2D::read(FileNode arg1)
220    //
221
222    // Unknown type 'FileNode' (I), skipping the function
223
224
225    //
226    // C++:  bool cv::Feature2D::empty()
227    //
228
229    public boolean empty() {
230        return empty_0(nativeObj);
231    }
232
233
234    //
235    // C++:  String cv::Feature2D::getDefaultName()
236    //
237
238    public String getDefaultName() {
239        return getDefaultName_0(nativeObj);
240    }
241
242
243    //
244    // C++:  void cv::Feature2D::write(Ptr_FileStorage fs, String name = String())
245    //
246
247    // Unknown type 'Ptr_FileStorage' (I), skipping the function
248
249
250    @Override
251    protected void finalize() throws Throwable {
252        delete(nativeObj);
253    }
254
255
256
257    // C++:  void cv::Feature2D::detect(Mat image, vector_KeyPoint& keypoints, Mat mask = Mat())
258    private static native void detect_0(long nativeObj, long image_nativeObj, long keypoints_mat_nativeObj, long mask_nativeObj);
259    private static native void detect_1(long nativeObj, long image_nativeObj, long keypoints_mat_nativeObj);
260
261    // C++:  void cv::Feature2D::detect(vector_Mat images, vector_vector_KeyPoint& keypoints, vector_Mat masks = vector_Mat())
262    private static native void detect_2(long nativeObj, long images_mat_nativeObj, long keypoints_mat_nativeObj, long masks_mat_nativeObj);
263    private static native void detect_3(long nativeObj, long images_mat_nativeObj, long keypoints_mat_nativeObj);
264
265    // C++:  void cv::Feature2D::compute(Mat image, vector_KeyPoint& keypoints, Mat& descriptors)
266    private static native void compute_0(long nativeObj, long image_nativeObj, long keypoints_mat_nativeObj, long descriptors_nativeObj);
267
268    // C++:  void cv::Feature2D::compute(vector_Mat images, vector_vector_KeyPoint& keypoints, vector_Mat& descriptors)
269    private static native void compute_1(long nativeObj, long images_mat_nativeObj, long keypoints_mat_nativeObj, long descriptors_mat_nativeObj);
270
271    // C++:  void cv::Feature2D::detectAndCompute(Mat image, Mat mask, vector_KeyPoint& keypoints, Mat& descriptors, bool useProvidedKeypoints = false)
272    private static native void detectAndCompute_0(long nativeObj, long image_nativeObj, long mask_nativeObj, long keypoints_mat_nativeObj, long descriptors_nativeObj, boolean useProvidedKeypoints);
273    private static native void detectAndCompute_1(long nativeObj, long image_nativeObj, long mask_nativeObj, long keypoints_mat_nativeObj, long descriptors_nativeObj);
274
275    // C++:  int cv::Feature2D::descriptorSize()
276    private static native int descriptorSize_0(long nativeObj);
277
278    // C++:  int cv::Feature2D::descriptorType()
279    private static native int descriptorType_0(long nativeObj);
280
281    // C++:  int cv::Feature2D::defaultNorm()
282    private static native int defaultNorm_0(long nativeObj);
283
284    // C++:  void cv::Feature2D::write(String fileName)
285    private static native void write_0(long nativeObj, String fileName);
286
287    // C++:  void cv::Feature2D::read(String fileName)
288    private static native void read_0(long nativeObj, String fileName);
289
290    // C++:  bool cv::Feature2D::empty()
291    private static native boolean empty_0(long nativeObj);
292
293    // C++:  String cv::Feature2D::getDefaultName()
294    private static native String getDefaultName_0(long nativeObj);
295
296    // native support for java finalize()
297    private static native void delete(long nativeObj);
298
299}