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 QRCodeDetector
012
013public class QRCodeDetector {
014
015    protected final long nativeObj;
016    protected QRCodeDetector(long addr) { nativeObj = addr; }
017
018    public long getNativeObjAddr() { return nativeObj; }
019
020    // internal usage only
021    public static QRCodeDetector __fromPtr__(long addr) { return new QRCodeDetector(addr); }
022
023    //
024    // C++:   cv::QRCodeDetector::QRCodeDetector()
025    //
026
027    public QRCodeDetector() {
028        nativeObj = QRCodeDetector_0();
029    }
030
031
032    //
033    // C++:  void cv::QRCodeDetector::setEpsX(double epsX)
034    //
035
036    /**
037     * sets the epsilon used during the horizontal scan of QR code stop marker detection.
038     *      @param epsX Epsilon neighborhood, which allows you to determine the horizontal pattern
039     *      of the scheme 1:1:3:1:1 according to QR code standard.
040     */
041    public void setEpsX(double epsX) {
042        setEpsX_0(nativeObj, epsX);
043    }
044
045
046    //
047    // C++:  void cv::QRCodeDetector::setEpsY(double epsY)
048    //
049
050    /**
051     * sets the epsilon used during the vertical scan of QR code stop marker detection.
052     *      @param epsY Epsilon neighborhood, which allows you to determine the vertical pattern
053     *      of the scheme 1:1:3:1:1 according to QR code standard.
054     */
055    public void setEpsY(double epsY) {
056        setEpsY_0(nativeObj, epsY);
057    }
058
059
060    //
061    // C++:  bool cv::QRCodeDetector::detect(Mat img, Mat& points)
062    //
063
064    /**
065     * Detects QR code in image and returns the quadrangle containing the code.
066     *      @param img grayscale or color (BGR) image containing (or not) QR code.
067     *      @param points Output vector of vertices of the minimum-area quadrangle containing the code.
068     * @return automatically generated
069     */
070    public boolean detect(Mat img, Mat points) {
071        return detect_0(nativeObj, img.nativeObj, points.nativeObj);
072    }
073
074
075    //
076    // C++:  string cv::QRCodeDetector::decode(Mat img, Mat points, Mat& straight_qrcode = Mat())
077    //
078
079    /**
080     * Decodes QR code in image once it's found by the detect() method.
081     *
082     *      Returns UTF8-encoded output string or empty string if the code cannot be decoded.
083     *      @param img grayscale or color (BGR) image containing QR code.
084     *      @param points Quadrangle vertices found by detect() method (or some other algorithm).
085     *      @param straight_qrcode The optional output image containing rectified and binarized QR code
086     * @return automatically generated
087     */
088    public String decode(Mat img, Mat points, Mat straight_qrcode) {
089        return decode_0(nativeObj, img.nativeObj, points.nativeObj, straight_qrcode.nativeObj);
090    }
091
092    /**
093     * Decodes QR code in image once it's found by the detect() method.
094     *
095     *      Returns UTF8-encoded output string or empty string if the code cannot be decoded.
096     *      @param img grayscale or color (BGR) image containing QR code.
097     *      @param points Quadrangle vertices found by detect() method (or some other algorithm).
098     * @return automatically generated
099     */
100    public String decode(Mat img, Mat points) {
101        return decode_1(nativeObj, img.nativeObj, points.nativeObj);
102    }
103
104
105    //
106    // C++:  String cv::QRCodeDetector::decodeCurved(Mat img, Mat points, Mat& straight_qrcode = Mat())
107    //
108
109    /**
110     * Decodes QR code on a curved surface in image once it's found by the detect() method.
111     *
112     *      Returns UTF8-encoded output string or empty string if the code cannot be decoded.
113     *      @param img grayscale or color (BGR) image containing QR code.
114     *      @param points Quadrangle vertices found by detect() method (or some other algorithm).
115     *      @param straight_qrcode The optional output image containing rectified and binarized QR code
116     * @return automatically generated
117     */
118    public String decodeCurved(Mat img, Mat points, Mat straight_qrcode) {
119        return decodeCurved_0(nativeObj, img.nativeObj, points.nativeObj, straight_qrcode.nativeObj);
120    }
121
122    /**
123     * Decodes QR code on a curved surface in image once it's found by the detect() method.
124     *
125     *      Returns UTF8-encoded output string or empty string if the code cannot be decoded.
126     *      @param img grayscale or color (BGR) image containing QR code.
127     *      @param points Quadrangle vertices found by detect() method (or some other algorithm).
128     * @return automatically generated
129     */
130    public String decodeCurved(Mat img, Mat points) {
131        return decodeCurved_1(nativeObj, img.nativeObj, points.nativeObj);
132    }
133
134
135    //
136    // C++:  string cv::QRCodeDetector::detectAndDecode(Mat img, Mat& points = Mat(), Mat& straight_qrcode = Mat())
137    //
138
139    /**
140     * Both detects and decodes QR code
141     *
142     *      @param img grayscale or color (BGR) image containing QR code.
143     *      @param points optional output array of vertices of the found QR code quadrangle. Will be empty if not found.
144     *      @param straight_qrcode The optional output image containing rectified and binarized QR code
145     * @return automatically generated
146     */
147    public String detectAndDecode(Mat img, Mat points, Mat straight_qrcode) {
148        return detectAndDecode_0(nativeObj, img.nativeObj, points.nativeObj, straight_qrcode.nativeObj);
149    }
150
151    /**
152     * Both detects and decodes QR code
153     *
154     *      @param img grayscale or color (BGR) image containing QR code.
155     *      @param points optional output array of vertices of the found QR code quadrangle. Will be empty if not found.
156     * @return automatically generated
157     */
158    public String detectAndDecode(Mat img, Mat points) {
159        return detectAndDecode_1(nativeObj, img.nativeObj, points.nativeObj);
160    }
161
162    /**
163     * Both detects and decodes QR code
164     *
165     *      @param img grayscale or color (BGR) image containing QR code.
166     * @return automatically generated
167     */
168    public String detectAndDecode(Mat img) {
169        return detectAndDecode_2(nativeObj, img.nativeObj);
170    }
171
172
173    //
174    // C++:  string cv::QRCodeDetector::detectAndDecodeCurved(Mat img, Mat& points = Mat(), Mat& straight_qrcode = Mat())
175    //
176
177    /**
178     * Both detects and decodes QR code on a curved surface
179     *
180     *      @param img grayscale or color (BGR) image containing QR code.
181     *      @param points optional output array of vertices of the found QR code quadrangle. Will be empty if not found.
182     *      @param straight_qrcode The optional output image containing rectified and binarized QR code
183     * @return automatically generated
184     */
185    public String detectAndDecodeCurved(Mat img, Mat points, Mat straight_qrcode) {
186        return detectAndDecodeCurved_0(nativeObj, img.nativeObj, points.nativeObj, straight_qrcode.nativeObj);
187    }
188
189    /**
190     * Both detects and decodes QR code on a curved surface
191     *
192     *      @param img grayscale or color (BGR) image containing QR code.
193     *      @param points optional output array of vertices of the found QR code quadrangle. Will be empty if not found.
194     * @return automatically generated
195     */
196    public String detectAndDecodeCurved(Mat img, Mat points) {
197        return detectAndDecodeCurved_1(nativeObj, img.nativeObj, points.nativeObj);
198    }
199
200    /**
201     * Both detects and decodes QR code on a curved surface
202     *
203     *      @param img grayscale or color (BGR) image containing QR code.
204     * @return automatically generated
205     */
206    public String detectAndDecodeCurved(Mat img) {
207        return detectAndDecodeCurved_2(nativeObj, img.nativeObj);
208    }
209
210
211    //
212    // C++:  bool cv::QRCodeDetector::detectMulti(Mat img, Mat& points)
213    //
214
215    /**
216     * Detects QR codes in image and returns the vector of the quadrangles containing the codes.
217     *      @param img grayscale or color (BGR) image containing (or not) QR codes.
218     *      @param points Output vector of vector of vertices of the minimum-area quadrangle containing the codes.
219     * @return automatically generated
220     */
221    public boolean detectMulti(Mat img, Mat points) {
222        return detectMulti_0(nativeObj, img.nativeObj, points.nativeObj);
223    }
224
225
226    //
227    // C++:  bool cv::QRCodeDetector::decodeMulti(Mat img, Mat points, vector_string& decoded_info, vector_Mat& straight_qrcode = vector_Mat())
228    //
229
230    /**
231     * Decodes QR codes in image once it's found by the detect() method.
232     *      @param img grayscale or color (BGR) image containing QR codes.
233     *      @param decoded_info UTF8-encoded output vector of string or empty vector of string if the codes cannot be decoded.
234     *      @param points vector of Quadrangle vertices found by detect() method (or some other algorithm).
235     *      @param straight_qrcode The optional output vector of images containing rectified and binarized QR codes
236     * @return automatically generated
237     */
238    public boolean decodeMulti(Mat img, Mat points, List<String> decoded_info, List<Mat> straight_qrcode) {
239        Mat straight_qrcode_mat = new Mat();
240        boolean retVal = decodeMulti_0(nativeObj, img.nativeObj, points.nativeObj, decoded_info, straight_qrcode_mat.nativeObj);
241        Converters.Mat_to_vector_Mat(straight_qrcode_mat, straight_qrcode);
242        straight_qrcode_mat.release();
243        return retVal;
244    }
245
246    /**
247     * Decodes QR codes in image once it's found by the detect() method.
248     *      @param img grayscale or color (BGR) image containing QR codes.
249     *      @param decoded_info UTF8-encoded output vector of string or empty vector of string if the codes cannot be decoded.
250     *      @param points vector of Quadrangle vertices found by detect() method (or some other algorithm).
251     * @return automatically generated
252     */
253    public boolean decodeMulti(Mat img, Mat points, List<String> decoded_info) {
254        return decodeMulti_1(nativeObj, img.nativeObj, points.nativeObj, decoded_info);
255    }
256
257
258    //
259    // C++:  bool cv::QRCodeDetector::detectAndDecodeMulti(Mat img, vector_string& decoded_info, Mat& points = Mat(), vector_Mat& straight_qrcode = vector_Mat())
260    //
261
262    /**
263     * Both detects and decodes QR codes
264     *     @param img grayscale or color (BGR) image containing QR codes.
265     *     @param decoded_info UTF8-encoded output vector of string or empty vector of string if the codes cannot be decoded.
266     *     @param points optional output vector of vertices of the found QR code quadrangles. Will be empty if not found.
267     *     @param straight_qrcode The optional output vector of images containing rectified and binarized QR codes
268     * @return automatically generated
269     */
270    public boolean detectAndDecodeMulti(Mat img, List<String> decoded_info, Mat points, List<Mat> straight_qrcode) {
271        Mat straight_qrcode_mat = new Mat();
272        boolean retVal = detectAndDecodeMulti_0(nativeObj, img.nativeObj, decoded_info, points.nativeObj, straight_qrcode_mat.nativeObj);
273        Converters.Mat_to_vector_Mat(straight_qrcode_mat, straight_qrcode);
274        straight_qrcode_mat.release();
275        return retVal;
276    }
277
278    /**
279     * Both detects and decodes QR codes
280     *     @param img grayscale or color (BGR) image containing QR codes.
281     *     @param decoded_info UTF8-encoded output vector of string or empty vector of string if the codes cannot be decoded.
282     *     @param points optional output vector of vertices of the found QR code quadrangles. Will be empty if not found.
283     * @return automatically generated
284     */
285    public boolean detectAndDecodeMulti(Mat img, List<String> decoded_info, Mat points) {
286        return detectAndDecodeMulti_1(nativeObj, img.nativeObj, decoded_info, points.nativeObj);
287    }
288
289    /**
290     * Both detects and decodes QR codes
291     *     @param img grayscale or color (BGR) image containing QR codes.
292     *     @param decoded_info UTF8-encoded output vector of string or empty vector of string if the codes cannot be decoded.
293     * @return automatically generated
294     */
295    public boolean detectAndDecodeMulti(Mat img, List<String> decoded_info) {
296        return detectAndDecodeMulti_2(nativeObj, img.nativeObj, decoded_info);
297    }
298
299
300    @Override
301    protected void finalize() throws Throwable {
302        delete(nativeObj);
303    }
304
305
306
307    // C++:   cv::QRCodeDetector::QRCodeDetector()
308    private static native long QRCodeDetector_0();
309
310    // C++:  void cv::QRCodeDetector::setEpsX(double epsX)
311    private static native void setEpsX_0(long nativeObj, double epsX);
312
313    // C++:  void cv::QRCodeDetector::setEpsY(double epsY)
314    private static native void setEpsY_0(long nativeObj, double epsY);
315
316    // C++:  bool cv::QRCodeDetector::detect(Mat img, Mat& points)
317    private static native boolean detect_0(long nativeObj, long img_nativeObj, long points_nativeObj);
318
319    // C++:  string cv::QRCodeDetector::decode(Mat img, Mat points, Mat& straight_qrcode = Mat())
320    private static native String decode_0(long nativeObj, long img_nativeObj, long points_nativeObj, long straight_qrcode_nativeObj);
321    private static native String decode_1(long nativeObj, long img_nativeObj, long points_nativeObj);
322
323    // C++:  String cv::QRCodeDetector::decodeCurved(Mat img, Mat points, Mat& straight_qrcode = Mat())
324    private static native String decodeCurved_0(long nativeObj, long img_nativeObj, long points_nativeObj, long straight_qrcode_nativeObj);
325    private static native String decodeCurved_1(long nativeObj, long img_nativeObj, long points_nativeObj);
326
327    // C++:  string cv::QRCodeDetector::detectAndDecode(Mat img, Mat& points = Mat(), Mat& straight_qrcode = Mat())
328    private static native String detectAndDecode_0(long nativeObj, long img_nativeObj, long points_nativeObj, long straight_qrcode_nativeObj);
329    private static native String detectAndDecode_1(long nativeObj, long img_nativeObj, long points_nativeObj);
330    private static native String detectAndDecode_2(long nativeObj, long img_nativeObj);
331
332    // C++:  string cv::QRCodeDetector::detectAndDecodeCurved(Mat img, Mat& points = Mat(), Mat& straight_qrcode = Mat())
333    private static native String detectAndDecodeCurved_0(long nativeObj, long img_nativeObj, long points_nativeObj, long straight_qrcode_nativeObj);
334    private static native String detectAndDecodeCurved_1(long nativeObj, long img_nativeObj, long points_nativeObj);
335    private static native String detectAndDecodeCurved_2(long nativeObj, long img_nativeObj);
336
337    // C++:  bool cv::QRCodeDetector::detectMulti(Mat img, Mat& points)
338    private static native boolean detectMulti_0(long nativeObj, long img_nativeObj, long points_nativeObj);
339
340    // C++:  bool cv::QRCodeDetector::decodeMulti(Mat img, Mat points, vector_string& decoded_info, vector_Mat& straight_qrcode = vector_Mat())
341    private static native boolean decodeMulti_0(long nativeObj, long img_nativeObj, long points_nativeObj, List<String> decoded_info, long straight_qrcode_mat_nativeObj);
342    private static native boolean decodeMulti_1(long nativeObj, long img_nativeObj, long points_nativeObj, List<String> decoded_info);
343
344    // C++:  bool cv::QRCodeDetector::detectAndDecodeMulti(Mat img, vector_string& decoded_info, Mat& points = Mat(), vector_Mat& straight_qrcode = vector_Mat())
345    private static native boolean detectAndDecodeMulti_0(long nativeObj, long img_nativeObj, List<String> decoded_info, long points_nativeObj, long straight_qrcode_mat_nativeObj);
346    private static native boolean detectAndDecodeMulti_1(long nativeObj, long img_nativeObj, List<String> decoded_info, long points_nativeObj);
347    private static native boolean detectAndDecodeMulti_2(long nativeObj, long img_nativeObj, List<String> decoded_info);
348
349    // native support for java finalize()
350    private static native void delete(long nativeObj);
351
352}