Skip to content

Commit

Permalink
Merge pull request opencv#18003 from APrigarina:curved_qrcodes_decoding
Browse files Browse the repository at this point in the history
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
  • Loading branch information
APrigarina authored Oct 23, 2020
1 parent 71462d9 commit c71f271
Show file tree
Hide file tree
Showing 3 changed files with 1,617 additions and 198 deletions.
29 changes: 28 additions & 1 deletion modules/objdetect/include/opencv2/objdetect.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -702,14 +702,33 @@ class CV_EXPORTS_W QRCodeDetector
*/
CV_WRAP cv::String decode(InputArray img, InputArray points, OutputArray straight_qrcode = noArray());

/** @brief Decodes QR code on a curved surface in image once it's found by the detect() method.
Returns UTF8-encoded output string or empty string if the code cannot be decoded.
@param img grayscale or color (BGR) image containing QR code.
@param points Quadrangle vertices found by detect() method (or some other algorithm).
@param straight_qrcode The optional output image containing rectified and binarized QR code
*/
CV_WRAP cv::String decodeCurved(InputArray img, InputArray points, OutputArray straight_qrcode = noArray());

/** @brief Both detects and decodes QR code
@param img grayscale or color (BGR) image containing QR code.
@param points optional output array of vertices of the found QR code quadrangle. Will be empty if not found.
@param straight_qrcode The optional output image containing rectified and binarized QR code
*/
CV_WRAP cv::String detectAndDecode(InputArray img, OutputArray points=noArray(),
OutputArray straight_qrcode = noArray());
OutputArray straight_qrcode = noArray());

/** @brief Both detects and decodes QR code on a curved surface
@param img grayscale or color (BGR) image containing QR code.
@param points optional output array of vertices of the found QR code quadrangle. Will be empty if not found.
@param straight_qrcode The optional output image containing rectified and binarized QR code
*/
CV_WRAP cv::String detectAndDecodeCurved(InputArray img, OutputArray points=noArray(),
OutputArray straight_qrcode = noArray());

/** @brief Detects QR codes in image and returns the vector of the quadrangles containing the codes.
@param img grayscale or color (BGR) image containing (or not) QR codes.
@param points Output vector of vector of vertices of the minimum-area quadrangle containing the codes.
Expand Down Expand Up @@ -801,6 +820,14 @@ CV_EXPORTS bool detectQRCode(InputArray in, std::vector<Point> &points, double e
*/
CV_EXPORTS bool decodeQRCode(InputArray in, InputArray points, std::string &decoded_info, OutputArray straight_qrcode = noArray());

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

//! @} objdetect
}

Expand Down
Loading

0 comments on commit c71f271

Please sign in to comment.