1 2 // 3 // This file is auto-generated. Please don't modify it! 4 // 5 package org.opencv.features2d; 6 7 import java.lang.String; 8 import java.util.ArrayList; 9 import java.util.List; 10 import org.opencv.core.Mat; 11 import org.opencv.core.MatOfKeyPoint; 12 import org.opencv.utils.Converters; 13 14 // C++: class javaFeatureDetector 15 //javadoc: javaFeatureDetector 16 public class FeatureDetector { 17 18 protected final long nativeObj; FeatureDetector(long addr)19 protected FeatureDetector(long addr) { nativeObj = addr; } 20 21 22 private static final int 23 GRIDDETECTOR = 1000, 24 PYRAMIDDETECTOR = 2000, 25 DYNAMICDETECTOR = 3000; 26 27 28 public static final int 29 FAST = 1, 30 STAR = 2, 31 SIFT = 3, 32 SURF = 4, 33 ORB = 5, 34 MSER = 6, 35 GFTT = 7, 36 HARRIS = 8, 37 SIMPLEBLOB = 9, 38 DENSE = 10, 39 BRISK = 11, 40 AKAZE = 12, 41 GRID_FAST = GRIDDETECTOR + FAST, 42 GRID_STAR = GRIDDETECTOR + STAR, 43 GRID_SIFT = GRIDDETECTOR + SIFT, 44 GRID_SURF = GRIDDETECTOR + SURF, 45 GRID_ORB = GRIDDETECTOR + ORB, 46 GRID_MSER = GRIDDETECTOR + MSER, 47 GRID_GFTT = GRIDDETECTOR + GFTT, 48 GRID_HARRIS = GRIDDETECTOR + HARRIS, 49 GRID_SIMPLEBLOB = GRIDDETECTOR + SIMPLEBLOB, 50 GRID_DENSE = GRIDDETECTOR + DENSE, 51 GRID_BRISK = GRIDDETECTOR + BRISK, 52 GRID_AKAZE = GRIDDETECTOR + AKAZE, 53 PYRAMID_FAST = PYRAMIDDETECTOR + FAST, 54 PYRAMID_STAR = PYRAMIDDETECTOR + STAR, 55 PYRAMID_SIFT = PYRAMIDDETECTOR + SIFT, 56 PYRAMID_SURF = PYRAMIDDETECTOR + SURF, 57 PYRAMID_ORB = PYRAMIDDETECTOR + ORB, 58 PYRAMID_MSER = PYRAMIDDETECTOR + MSER, 59 PYRAMID_GFTT = PYRAMIDDETECTOR + GFTT, 60 PYRAMID_HARRIS = PYRAMIDDETECTOR + HARRIS, 61 PYRAMID_SIMPLEBLOB = PYRAMIDDETECTOR + SIMPLEBLOB, 62 PYRAMID_DENSE = PYRAMIDDETECTOR + DENSE, 63 PYRAMID_BRISK = PYRAMIDDETECTOR + BRISK, 64 PYRAMID_AKAZE = PYRAMIDDETECTOR + AKAZE, 65 DYNAMIC_FAST = DYNAMICDETECTOR + FAST, 66 DYNAMIC_STAR = DYNAMICDETECTOR + STAR, 67 DYNAMIC_SIFT = DYNAMICDETECTOR + SIFT, 68 DYNAMIC_SURF = DYNAMICDETECTOR + SURF, 69 DYNAMIC_ORB = DYNAMICDETECTOR + ORB, 70 DYNAMIC_MSER = DYNAMICDETECTOR + MSER, 71 DYNAMIC_GFTT = DYNAMICDETECTOR + GFTT, 72 DYNAMIC_HARRIS = DYNAMICDETECTOR + HARRIS, 73 DYNAMIC_SIMPLEBLOB = DYNAMICDETECTOR + SIMPLEBLOB, 74 DYNAMIC_DENSE = DYNAMICDETECTOR + DENSE, 75 DYNAMIC_BRISK = DYNAMICDETECTOR + BRISK, 76 DYNAMIC_AKAZE = DYNAMICDETECTOR + AKAZE; 77 78 79 // 80 // C++: void detect(Mat image, vector_KeyPoint& keypoints, Mat mask = Mat()) 81 // 82 83 //javadoc: javaFeatureDetector::detect(image, keypoints, mask) detect(Mat image, MatOfKeyPoint keypoints, Mat mask)84 public void detect(Mat image, MatOfKeyPoint keypoints, Mat mask) 85 { 86 Mat keypoints_mat = keypoints; 87 detect_0(nativeObj, image.nativeObj, keypoints_mat.nativeObj, mask.nativeObj); 88 89 return; 90 } 91 92 //javadoc: javaFeatureDetector::detect(image, keypoints) detect(Mat image, MatOfKeyPoint keypoints)93 public void detect(Mat image, MatOfKeyPoint keypoints) 94 { 95 Mat keypoints_mat = keypoints; 96 detect_1(nativeObj, image.nativeObj, keypoints_mat.nativeObj); 97 98 return; 99 } 100 101 102 // 103 // C++: void detect(vector_Mat images, vector_vector_KeyPoint& keypoints, vector_Mat masks = std::vector<Mat>()) 104 // 105 106 //javadoc: javaFeatureDetector::detect(images, keypoints, masks) detect(List<Mat> images, List<MatOfKeyPoint> keypoints, List<Mat> masks)107 public void detect(List<Mat> images, List<MatOfKeyPoint> keypoints, List<Mat> masks) 108 { 109 Mat images_mat = Converters.vector_Mat_to_Mat(images); 110 Mat keypoints_mat = new Mat(); 111 Mat masks_mat = Converters.vector_Mat_to_Mat(masks); 112 detect_2(nativeObj, images_mat.nativeObj, keypoints_mat.nativeObj, masks_mat.nativeObj); 113 Converters.Mat_to_vector_vector_KeyPoint(keypoints_mat, keypoints); 114 keypoints_mat.release(); 115 return; 116 } 117 118 //javadoc: javaFeatureDetector::detect(images, keypoints) detect(List<Mat> images, List<MatOfKeyPoint> keypoints)119 public void detect(List<Mat> images, List<MatOfKeyPoint> keypoints) 120 { 121 Mat images_mat = Converters.vector_Mat_to_Mat(images); 122 Mat keypoints_mat = new Mat(); 123 detect_3(nativeObj, images_mat.nativeObj, keypoints_mat.nativeObj); 124 Converters.Mat_to_vector_vector_KeyPoint(keypoints_mat, keypoints); 125 keypoints_mat.release(); 126 return; 127 } 128 129 130 // 131 // C++: bool empty() 132 // 133 134 //javadoc: javaFeatureDetector::empty() empty()135 public boolean empty() 136 { 137 138 boolean retVal = empty_0(nativeObj); 139 140 return retVal; 141 } 142 143 144 // 145 // C++: static javaFeatureDetector* create(int detectorType) 146 // 147 148 //javadoc: javaFeatureDetector::create(detectorType) create(int detectorType)149 public static FeatureDetector create(int detectorType) 150 { 151 152 FeatureDetector retVal = new FeatureDetector(create_0(detectorType)); 153 154 return retVal; 155 } 156 157 158 // 159 // C++: void write(String fileName) 160 // 161 162 //javadoc: javaFeatureDetector::write(fileName) write(String fileName)163 public void write(String fileName) 164 { 165 166 write_0(nativeObj, fileName); 167 168 return; 169 } 170 171 172 // 173 // C++: void read(String fileName) 174 // 175 176 //javadoc: javaFeatureDetector::read(fileName) read(String fileName)177 public void read(String fileName) 178 { 179 180 read_0(nativeObj, fileName); 181 182 return; 183 } 184 185 186 @Override finalize()187 protected void finalize() throws Throwable { 188 delete(nativeObj); 189 } 190 191 192 193 // C++: void detect(Mat image, vector_KeyPoint& keypoints, Mat mask = Mat()) detect_0(long nativeObj, long image_nativeObj, long keypoints_mat_nativeObj, long mask_nativeObj)194 private static native void detect_0(long nativeObj, long image_nativeObj, long keypoints_mat_nativeObj, long mask_nativeObj); detect_1(long nativeObj, long image_nativeObj, long keypoints_mat_nativeObj)195 private static native void detect_1(long nativeObj, long image_nativeObj, long keypoints_mat_nativeObj); 196 197 // C++: void detect(vector_Mat images, vector_vector_KeyPoint& keypoints, vector_Mat masks = std::vector<Mat>()) detect_2(long nativeObj, long images_mat_nativeObj, long keypoints_mat_nativeObj, long masks_mat_nativeObj)198 private static native void detect_2(long nativeObj, long images_mat_nativeObj, long keypoints_mat_nativeObj, long masks_mat_nativeObj); detect_3(long nativeObj, long images_mat_nativeObj, long keypoints_mat_nativeObj)199 private static native void detect_3(long nativeObj, long images_mat_nativeObj, long keypoints_mat_nativeObj); 200 201 // C++: bool empty() empty_0(long nativeObj)202 private static native boolean empty_0(long nativeObj); 203 204 // C++: static javaFeatureDetector* create(int detectorType) create_0(int detectorType)205 private static native long create_0(int detectorType); 206 207 // C++: void write(String fileName) write_0(long nativeObj, String fileName)208 private static native void write_0(long nativeObj, String fileName); 209 210 // C++: void read(String fileName) read_0(long nativeObj, String fileName)211 private static native void read_0(long nativeObj, String fileName); 212 213 // native support for java finalize() delete(long nativeObj)214 private static native void delete(long nativeObj); 215 216 } 217