Skip to content

Commit c71f271

Browse files
authored
Merge pull request opencv#18003 from APrigarina:curved_qrcodes_decoding
Detection and decoding of curved QR-codes * temp changes for curved qrcodes * added api for curved qr code decoding * fixed prototypes * refactored curved qr code decoding * refactored curved qr code decoding 2nd part * refactored curved qr code decoding 3rd part * refactored curved qr code decoding 4th part * added tests for curved qr code decoding * refactored curved qr code decoding 5th part
1 parent 71462d9 commit c71f271

File tree

3 files changed

+1617
-198
lines changed

3 files changed

+1617
-198
lines changed

modules/objdetect/include/opencv2/objdetect.hpp

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -702,14 +702,33 @@ class CV_EXPORTS_W QRCodeDetector
702702
*/
703703
CV_WRAP cv::String decode(InputArray img, InputArray points, OutputArray straight_qrcode = noArray());
704704

705+
/** @brief Decodes QR code on a curved surface in image once it's found by the detect() method.
706+
707+
Returns UTF8-encoded output string or empty string if the code cannot be decoded.
708+
@param img grayscale or color (BGR) image containing QR code.
709+
@param points Quadrangle vertices found by detect() method (or some other algorithm).
710+
@param straight_qrcode The optional output image containing rectified and binarized QR code
711+
*/
712+
CV_WRAP cv::String decodeCurved(InputArray img, InputArray points, OutputArray straight_qrcode = noArray());
713+
705714
/** @brief Both detects and decodes QR code
706715
707716
@param img grayscale or color (BGR) image containing QR code.
708717
@param points optional output array of vertices of the found QR code quadrangle. Will be empty if not found.
709718
@param straight_qrcode The optional output image containing rectified and binarized QR code
710719
*/
711720
CV_WRAP cv::String detectAndDecode(InputArray img, OutputArray points=noArray(),
712-
OutputArray straight_qrcode = noArray());
721+
OutputArray straight_qrcode = noArray());
722+
723+
/** @brief Both detects and decodes QR code on a curved surface
724+
725+
@param img grayscale or color (BGR) image containing QR code.
726+
@param points optional output array of vertices of the found QR code quadrangle. Will be empty if not found.
727+
@param straight_qrcode The optional output image containing rectified and binarized QR code
728+
*/
729+
CV_WRAP cv::String detectAndDecodeCurved(InputArray img, OutputArray points=noArray(),
730+
OutputArray straight_qrcode = noArray());
731+
713732
/** @brief Detects QR codes in image and returns the vector of the quadrangles containing the codes.
714733
@param img grayscale or color (BGR) image containing (or not) QR codes.
715734
@param points Output vector of vector of vertices of the minimum-area quadrangle containing the codes.
@@ -801,6 +820,14 @@ CV_EXPORTS bool detectQRCode(InputArray in, std::vector<Point> &points, double e
801820
*/
802821
CV_EXPORTS bool decodeQRCode(InputArray in, InputArray points, std::string &decoded_info, OutputArray straight_qrcode = noArray());
803822

823+
/** @brief Decode QR code on a curved surface in image and return text that is encrypted in QR code.
824+
@param in Matrix of the type CV_8UC1 containing an image where QR code are detected.
825+
@param points Input vector of vertices of a quadrangle of minimal area that describes QR code.
826+
@param decoded_info String information that is encrypted in QR code.
827+
@param straight_qrcode Matrix of the type CV_8UC1 containing an binary straight QR code.
828+
*/
829+
CV_EXPORTS bool decodeCurvedQRCode(InputArray in, InputArray points, std::string &decoded_info, OutputArray straight_qrcode = noArray());
830+
804831
//! @} objdetect
805832
}
806833

0 commit comments

Comments
 (0)