1 2 // 3 // This file is auto-generated. Please don't modify it! 4 // 5 package org.opencv.ml; 6 7 import org.opencv.core.Mat; 8 9 // C++: class KNearest 10 //javadoc: KNearest 11 public class KNearest extends StatModel { 12 KNearest(long addr)13 protected KNearest(long addr) { super(addr); } 14 15 16 public static final int 17 BRUTE_FORCE = 1, 18 KDTREE = 2; 19 20 21 // 22 // C++: void setDefaultK(int val) 23 // 24 25 //javadoc: KNearest::setDefaultK(val) setDefaultK(int val)26 public void setDefaultK(int val) 27 { 28 29 setDefaultK_0(nativeObj, val); 30 31 return; 32 } 33 34 35 // 36 // C++: int getDefaultK() 37 // 38 39 //javadoc: KNearest::getDefaultK() getDefaultK()40 public int getDefaultK() 41 { 42 43 int retVal = getDefaultK_0(nativeObj); 44 45 return retVal; 46 } 47 48 49 // 50 // C++: bool getIsClassifier() 51 // 52 53 //javadoc: KNearest::getIsClassifier() getIsClassifier()54 public boolean getIsClassifier() 55 { 56 57 boolean retVal = getIsClassifier_0(nativeObj); 58 59 return retVal; 60 } 61 62 63 // 64 // C++: void setIsClassifier(bool val) 65 // 66 67 //javadoc: KNearest::setIsClassifier(val) setIsClassifier(boolean val)68 public void setIsClassifier(boolean val) 69 { 70 71 setIsClassifier_0(nativeObj, val); 72 73 return; 74 } 75 76 77 // 78 // C++: int getEmax() 79 // 80 81 //javadoc: KNearest::getEmax() getEmax()82 public int getEmax() 83 { 84 85 int retVal = getEmax_0(nativeObj); 86 87 return retVal; 88 } 89 90 91 // 92 // C++: void setEmax(int val) 93 // 94 95 //javadoc: KNearest::setEmax(val) setEmax(int val)96 public void setEmax(int val) 97 { 98 99 setEmax_0(nativeObj, val); 100 101 return; 102 } 103 104 105 // 106 // C++: int getAlgorithmType() 107 // 108 109 //javadoc: KNearest::getAlgorithmType() getAlgorithmType()110 public int getAlgorithmType() 111 { 112 113 int retVal = getAlgorithmType_0(nativeObj); 114 115 return retVal; 116 } 117 118 119 // 120 // C++: void setAlgorithmType(int val) 121 // 122 123 //javadoc: KNearest::setAlgorithmType(val) setAlgorithmType(int val)124 public void setAlgorithmType(int val) 125 { 126 127 setAlgorithmType_0(nativeObj, val); 128 129 return; 130 } 131 132 133 // 134 // C++: float findNearest(Mat samples, int k, Mat& results, Mat& neighborResponses = Mat(), Mat& dist = Mat()) 135 // 136 137 //javadoc: KNearest::findNearest(samples, k, results, neighborResponses, dist) findNearest(Mat samples, int k, Mat results, Mat neighborResponses, Mat dist)138 public float findNearest(Mat samples, int k, Mat results, Mat neighborResponses, Mat dist) 139 { 140 141 float retVal = findNearest_0(nativeObj, samples.nativeObj, k, results.nativeObj, neighborResponses.nativeObj, dist.nativeObj); 142 143 return retVal; 144 } 145 146 //javadoc: KNearest::findNearest(samples, k, results) findNearest(Mat samples, int k, Mat results)147 public float findNearest(Mat samples, int k, Mat results) 148 { 149 150 float retVal = findNearest_1(nativeObj, samples.nativeObj, k, results.nativeObj); 151 152 return retVal; 153 } 154 155 156 // 157 // C++: static Ptr_KNearest create() 158 // 159 160 //javadoc: KNearest::create() create()161 public static KNearest create() 162 { 163 164 KNearest retVal = new KNearest(create_0()); 165 166 return retVal; 167 } 168 169 170 @Override finalize()171 protected void finalize() throws Throwable { 172 delete(nativeObj); 173 } 174 175 176 177 // C++: void setDefaultK(int val) setDefaultK_0(long nativeObj, int val)178 private static native void setDefaultK_0(long nativeObj, int val); 179 180 // C++: int getDefaultK() getDefaultK_0(long nativeObj)181 private static native int getDefaultK_0(long nativeObj); 182 183 // C++: bool getIsClassifier() getIsClassifier_0(long nativeObj)184 private static native boolean getIsClassifier_0(long nativeObj); 185 186 // C++: void setIsClassifier(bool val) setIsClassifier_0(long nativeObj, boolean val)187 private static native void setIsClassifier_0(long nativeObj, boolean val); 188 189 // C++: int getEmax() getEmax_0(long nativeObj)190 private static native int getEmax_0(long nativeObj); 191 192 // C++: void setEmax(int val) setEmax_0(long nativeObj, int val)193 private static native void setEmax_0(long nativeObj, int val); 194 195 // C++: int getAlgorithmType() getAlgorithmType_0(long nativeObj)196 private static native int getAlgorithmType_0(long nativeObj); 197 198 // C++: void setAlgorithmType(int val) setAlgorithmType_0(long nativeObj, int val)199 private static native void setAlgorithmType_0(long nativeObj, int val); 200 201 // C++: float findNearest(Mat samples, int k, Mat& results, Mat& neighborResponses = Mat(), Mat& dist = Mat()) findNearest_0(long nativeObj, long samples_nativeObj, int k, long results_nativeObj, long neighborResponses_nativeObj, long dist_nativeObj)202 private static native float findNearest_0(long nativeObj, long samples_nativeObj, int k, long results_nativeObj, long neighborResponses_nativeObj, long dist_nativeObj); findNearest_1(long nativeObj, long samples_nativeObj, int k, long results_nativeObj)203 private static native float findNearest_1(long nativeObj, long samples_nativeObj, int k, long results_nativeObj); 204 205 // C++: static Ptr_KNearest create() create_0()206 private static native long create_0(); 207 208 // native support for java finalize() delete(long nativeObj)209 private static native void delete(long nativeObj); 210 211 } 212