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 BarcodeDetector 012 013public class BarcodeDetector extends GraphicalCodeDetector { 014 015 protected BarcodeDetector(long addr) { super(addr); } 016 017 // internal usage only 018 public static BarcodeDetector __fromPtr__(long addr) { return new BarcodeDetector(addr); } 019 020 // 021 // C++: cv::barcode::BarcodeDetector::BarcodeDetector() 022 // 023 024 /** 025 * Initialize the BarcodeDetector. 026 */ 027 public BarcodeDetector() { 028 super(BarcodeDetector_0()); 029 } 030 031 032 // 033 // C++: cv::barcode::BarcodeDetector::BarcodeDetector(string prototxt_path, string model_path) 034 // 035 036 /** 037 * Initialize the BarcodeDetector. 038 * 039 * Parameters allow to load _optional_ Super Resolution DNN model for better quality. 040 * @param prototxt_path prototxt file path for the super resolution model 041 * @param model_path model file path for the super resolution model 042 */ 043 public BarcodeDetector(String prototxt_path, String model_path) { 044 super(BarcodeDetector_1(prototxt_path, model_path)); 045 } 046 047 048 // 049 // C++: bool cv::barcode::BarcodeDetector::decodeWithType(Mat img, Mat points, vector_string& decoded_info, vector_string& decoded_type) 050 // 051 052 /** 053 * Decodes barcode in image once it's found by the detect() method. 054 * 055 * @param img grayscale or color (BGR) image containing bar code. 056 * @param points vector of rotated rectangle vertices found by detect() method (or some other algorithm). 057 * For N detected barcodes, the dimensions of this array should be [N][4]. 058 * Order of four points in vector<Point2f> is bottomLeft, topLeft, topRight, bottomRight. 059 * @param decoded_info UTF8-encoded output vector of string or empty vector of string if the codes cannot be decoded. 060 * @param decoded_type vector strings, specifies the type of these barcodes 061 * @return true if at least one valid barcode have been found 062 */ 063 public boolean decodeWithType(Mat img, Mat points, List<String> decoded_info, List<String> decoded_type) { 064 return decodeWithType_0(nativeObj, img.nativeObj, points.nativeObj, decoded_info, decoded_type); 065 } 066 067 068 // 069 // C++: bool cv::barcode::BarcodeDetector::detectAndDecodeWithType(Mat img, vector_string& decoded_info, vector_string& decoded_type, Mat& points = Mat()) 070 // 071 072 /** 073 * Both detects and decodes barcode 074 * 075 * @param img grayscale or color (BGR) image containing barcode. 076 * @param decoded_info UTF8-encoded output vector of string(s) or empty vector of string if the codes cannot be decoded. 077 * @param decoded_type vector of strings, specifies the type of these barcodes 078 * @param points optional output vector of vertices of the found barcode rectangle. Will be empty if not found. 079 * @return true if at least one valid barcode have been found 080 */ 081 public boolean detectAndDecodeWithType(Mat img, List<String> decoded_info, List<String> decoded_type, Mat points) { 082 return detectAndDecodeWithType_0(nativeObj, img.nativeObj, decoded_info, decoded_type, points.nativeObj); 083 } 084 085 /** 086 * Both detects and decodes barcode 087 * 088 * @param img grayscale or color (BGR) image containing barcode. 089 * @param decoded_info UTF8-encoded output vector of string(s) or empty vector of string if the codes cannot be decoded. 090 * @param decoded_type vector of strings, specifies the type of these barcodes 091 * @return true if at least one valid barcode have been found 092 */ 093 public boolean detectAndDecodeWithType(Mat img, List<String> decoded_info, List<String> decoded_type) { 094 return detectAndDecodeWithType_1(nativeObj, img.nativeObj, decoded_info, decoded_type); 095 } 096 097 098 @Override 099 protected void finalize() throws Throwable { 100 delete(nativeObj); 101 } 102 103 104 105 // C++: cv::barcode::BarcodeDetector::BarcodeDetector() 106 private static native long BarcodeDetector_0(); 107 108 // C++: cv::barcode::BarcodeDetector::BarcodeDetector(string prototxt_path, string model_path) 109 private static native long BarcodeDetector_1(String prototxt_path, String model_path); 110 111 // C++: bool cv::barcode::BarcodeDetector::decodeWithType(Mat img, Mat points, vector_string& decoded_info, vector_string& decoded_type) 112 private static native boolean decodeWithType_0(long nativeObj, long img_nativeObj, long points_nativeObj, List<String> decoded_info, List<String> decoded_type); 113 114 // C++: bool cv::barcode::BarcodeDetector::detectAndDecodeWithType(Mat img, vector_string& decoded_info, vector_string& decoded_type, Mat& points = Mat()) 115 private static native boolean detectAndDecodeWithType_0(long nativeObj, long img_nativeObj, List<String> decoded_info, List<String> decoded_type, long points_nativeObj); 116 private static native boolean detectAndDecodeWithType_1(long nativeObj, long img_nativeObj, List<String> decoded_info, List<String> decoded_type); 117 118 // native support for java finalize() 119 private static native void delete(long nativeObj); 120 121}