001// 002// This file is auto-generated. Please don't modify it! 003// 004package org.opencv.objdetect; 005 006import java.util.ArrayList; 007import java.util.List; 008import org.opencv.core.Mat; 009import org.opencv.utils.Converters; 010 011// C++: class GraphicalCodeDetector 012 013public class GraphicalCodeDetector { 014 015 protected final long nativeObj; 016 protected GraphicalCodeDetector(long addr) { nativeObj = addr; } 017 018 public long getNativeObjAddr() { return nativeObj; } 019 020 // internal usage only 021 public static GraphicalCodeDetector __fromPtr__(long addr) { return new GraphicalCodeDetector(addr); } 022 023 // 024 // C++: bool cv::GraphicalCodeDetector::detect(Mat img, Mat& points) 025 // 026 027 /** 028 * Detects graphical code in image and returns the quadrangle containing the code. 029 * @param img grayscale or color (BGR) image containing (or not) graphical code. 030 * @param points Output vector of vertices of the minimum-area quadrangle containing the code. 031 * @return automatically generated 032 */ 033 public boolean detect(Mat img, Mat points) { 034 return detect_0(nativeObj, img.nativeObj, points.nativeObj); 035 } 036 037 038 // 039 // C++: string cv::GraphicalCodeDetector::decode(Mat img, Mat points, Mat& straight_code = Mat()) 040 // 041 042 /** 043 * Decodes graphical code in image once it's found by the detect() method. 044 * 045 * Returns UTF8-encoded output string or empty string if the code cannot be decoded. 046 * @param img grayscale or color (BGR) image containing graphical code. 047 * @param points Quadrangle vertices found by detect() method (or some other algorithm). 048 * @param straight_code The optional output image containing binarized code, will be empty if not found. 049 * @return automatically generated 050 */ 051 public String decode(Mat img, Mat points, Mat straight_code) { 052 return decode_0(nativeObj, img.nativeObj, points.nativeObj, straight_code.nativeObj); 053 } 054 055 /** 056 * Decodes graphical code in image once it's found by the detect() method. 057 * 058 * Returns UTF8-encoded output string or empty string if the code cannot be decoded. 059 * @param img grayscale or color (BGR) image containing graphical code. 060 * @param points Quadrangle vertices found by detect() method (or some other algorithm). 061 * @return automatically generated 062 */ 063 public String decode(Mat img, Mat points) { 064 return decode_1(nativeObj, img.nativeObj, points.nativeObj); 065 } 066 067 068 // 069 // C++: string cv::GraphicalCodeDetector::detectAndDecode(Mat img, Mat& points = Mat(), Mat& straight_code = Mat()) 070 // 071 072 /** 073 * Both detects and decodes graphical code 074 * 075 * @param img grayscale or color (BGR) image containing graphical code. 076 * @param points optional output array of vertices of the found graphical code quadrangle, will be empty if not found. 077 * @param straight_code The optional output image containing binarized code 078 * @return automatically generated 079 */ 080 public String detectAndDecode(Mat img, Mat points, Mat straight_code) { 081 return detectAndDecode_0(nativeObj, img.nativeObj, points.nativeObj, straight_code.nativeObj); 082 } 083 084 /** 085 * Both detects and decodes graphical code 086 * 087 * @param img grayscale or color (BGR) image containing graphical code. 088 * @param points optional output array of vertices of the found graphical code quadrangle, will be empty if not found. 089 * @return automatically generated 090 */ 091 public String detectAndDecode(Mat img, Mat points) { 092 return detectAndDecode_1(nativeObj, img.nativeObj, points.nativeObj); 093 } 094 095 /** 096 * Both detects and decodes graphical code 097 * 098 * @param img grayscale or color (BGR) image containing graphical code. 099 * @return automatically generated 100 */ 101 public String detectAndDecode(Mat img) { 102 return detectAndDecode_2(nativeObj, img.nativeObj); 103 } 104 105 106 // 107 // C++: bool cv::GraphicalCodeDetector::detectMulti(Mat img, Mat& points) 108 // 109 110 /** 111 * Detects graphical codes in image and returns the vector of the quadrangles containing the codes. 112 * @param img grayscale or color (BGR) image containing (or not) graphical codes. 113 * @param points Output vector of vector of vertices of the minimum-area quadrangle containing the codes. 114 * @return automatically generated 115 */ 116 public boolean detectMulti(Mat img, Mat points) { 117 return detectMulti_0(nativeObj, img.nativeObj, points.nativeObj); 118 } 119 120 121 // 122 // C++: bool cv::GraphicalCodeDetector::decodeMulti(Mat img, Mat points, vector_string& decoded_info, vector_Mat& straight_code = vector_Mat()) 123 // 124 125 /** 126 * Decodes graphical codes in image once it's found by the detect() method. 127 * @param img grayscale or color (BGR) image containing graphical codes. 128 * @param decoded_info UTF8-encoded output vector of string or empty vector of string if the codes cannot be decoded. 129 * @param points vector of Quadrangle vertices found by detect() method (or some other algorithm). 130 * @param straight_code The optional output vector of images containing binarized codes 131 * @return automatically generated 132 */ 133 public boolean decodeMulti(Mat img, Mat points, List<String> decoded_info, List<Mat> straight_code) { 134 Mat straight_code_mat = new Mat(); 135 boolean retVal = decodeMulti_0(nativeObj, img.nativeObj, points.nativeObj, decoded_info, straight_code_mat.nativeObj); 136 Converters.Mat_to_vector_Mat(straight_code_mat, straight_code); 137 straight_code_mat.release(); 138 return retVal; 139 } 140 141 /** 142 * Decodes graphical codes in image once it's found by the detect() method. 143 * @param img grayscale or color (BGR) image containing graphical codes. 144 * @param decoded_info UTF8-encoded output vector of string or empty vector of string if the codes cannot be decoded. 145 * @param points vector of Quadrangle vertices found by detect() method (or some other algorithm). 146 * @return automatically generated 147 */ 148 public boolean decodeMulti(Mat img, Mat points, List<String> decoded_info) { 149 return decodeMulti_1(nativeObj, img.nativeObj, points.nativeObj, decoded_info); 150 } 151 152 153 // 154 // C++: bool cv::GraphicalCodeDetector::detectAndDecodeMulti(Mat img, vector_string& decoded_info, Mat& points = Mat(), vector_Mat& straight_code = vector_Mat()) 155 // 156 157 /** 158 * Both detects and decodes graphical codes 159 * @param img grayscale or color (BGR) image containing graphical codes. 160 * @param decoded_info UTF8-encoded output vector of string or empty vector of string if the codes cannot be decoded. 161 * @param points optional output vector of vertices of the found graphical code quadrangles. Will be empty if not found. 162 * @param straight_code The optional vector of images containing binarized codes 163 * @return automatically generated 164 */ 165 public boolean detectAndDecodeMulti(Mat img, List<String> decoded_info, Mat points, List<Mat> straight_code) { 166 Mat straight_code_mat = new Mat(); 167 boolean retVal = detectAndDecodeMulti_0(nativeObj, img.nativeObj, decoded_info, points.nativeObj, straight_code_mat.nativeObj); 168 Converters.Mat_to_vector_Mat(straight_code_mat, straight_code); 169 straight_code_mat.release(); 170 return retVal; 171 } 172 173 /** 174 * Both detects and decodes graphical codes 175 * @param img grayscale or color (BGR) image containing graphical codes. 176 * @param decoded_info UTF8-encoded output vector of string or empty vector of string if the codes cannot be decoded. 177 * @param points optional output vector of vertices of the found graphical code quadrangles. Will be empty if not found. 178 * @return automatically generated 179 */ 180 public boolean detectAndDecodeMulti(Mat img, List<String> decoded_info, Mat points) { 181 return detectAndDecodeMulti_1(nativeObj, img.nativeObj, decoded_info, points.nativeObj); 182 } 183 184 /** 185 * Both detects and decodes graphical codes 186 * @param img grayscale or color (BGR) image containing graphical codes. 187 * @param decoded_info UTF8-encoded output vector of string or empty vector of string if the codes cannot be decoded. 188 * @return automatically generated 189 */ 190 public boolean detectAndDecodeMulti(Mat img, List<String> decoded_info) { 191 return detectAndDecodeMulti_2(nativeObj, img.nativeObj, decoded_info); 192 } 193 194 195 @Override 196 protected void finalize() throws Throwable { 197 delete(nativeObj); 198 } 199 200 201 202 // C++: bool cv::GraphicalCodeDetector::detect(Mat img, Mat& points) 203 private static native boolean detect_0(long nativeObj, long img_nativeObj, long points_nativeObj); 204 205 // C++: string cv::GraphicalCodeDetector::decode(Mat img, Mat points, Mat& straight_code = Mat()) 206 private static native String decode_0(long nativeObj, long img_nativeObj, long points_nativeObj, long straight_code_nativeObj); 207 private static native String decode_1(long nativeObj, long img_nativeObj, long points_nativeObj); 208 209 // C++: string cv::GraphicalCodeDetector::detectAndDecode(Mat img, Mat& points = Mat(), Mat& straight_code = Mat()) 210 private static native String detectAndDecode_0(long nativeObj, long img_nativeObj, long points_nativeObj, long straight_code_nativeObj); 211 private static native String detectAndDecode_1(long nativeObj, long img_nativeObj, long points_nativeObj); 212 private static native String detectAndDecode_2(long nativeObj, long img_nativeObj); 213 214 // C++: bool cv::GraphicalCodeDetector::detectMulti(Mat img, Mat& points) 215 private static native boolean detectMulti_0(long nativeObj, long img_nativeObj, long points_nativeObj); 216 217 // C++: bool cv::GraphicalCodeDetector::decodeMulti(Mat img, Mat points, vector_string& decoded_info, vector_Mat& straight_code = vector_Mat()) 218 private static native boolean decodeMulti_0(long nativeObj, long img_nativeObj, long points_nativeObj, List<String> decoded_info, long straight_code_mat_nativeObj); 219 private static native boolean decodeMulti_1(long nativeObj, long img_nativeObj, long points_nativeObj, List<String> decoded_info); 220 221 // C++: bool cv::GraphicalCodeDetector::detectAndDecodeMulti(Mat img, vector_string& decoded_info, Mat& points = Mat(), vector_Mat& straight_code = vector_Mat()) 222 private static native boolean detectAndDecodeMulti_0(long nativeObj, long img_nativeObj, List<String> decoded_info, long points_nativeObj, long straight_code_mat_nativeObj); 223 private static native boolean detectAndDecodeMulti_1(long nativeObj, long img_nativeObj, List<String> decoded_info, long points_nativeObj); 224 private static native boolean detectAndDecodeMulti_2(long nativeObj, long img_nativeObj, List<String> decoded_info); 225 226 // native support for java finalize() 227 private static native void delete(long nativeObj); 228 229}