Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork56.4k
Add detect qr with aruco#23264
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Add detect qr with aruco#23264
Changes from15 commits
f3d07b530e0bf3958ef8fa59425cfca39341ec09d1e964404e02369bb9d1942e97cb72866289e8d8edc7563c2390c3ec4af2ff342c05217dFile filter
Filter by extension
Conversations
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -45,6 +45,7 @@ | ||
| #define OPENCV_OBJDETECT_HPP | ||
| #include "opencv2/core.hpp" | ||
| #include "opencv2/objdetect/aruco_detector.hpp" | ||
| /** | ||
| @defgroup objdetect Object Detection | ||
| @@ -763,28 +764,15 @@ class CV_EXPORTS_W QRCodeEncoder { | ||
| }; | ||
| class CV_EXPORTS_W_SIMPLE QRCodeDetectorBase { | ||
| public: | ||
Contributor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. As mentioned on team meetings, we have to follow Constructors / destructors / assignment / move operators should be defined explicitly. ContributorAuthor
| ||
| //CV_DEPRECATED_EXTERNAL // avoid using in C++ code, will be moved to "protected" (need to fix bindings first) | ||
| QRCodeDetectorBase(); | ||
| QRCodeDetectorBase(const QRCodeDetectorBase&) = default; | ||
| QRCodeDetectorBase(QRCodeDetectorBase&&) = default; | ||
| QRCodeDetectorBase& operator=(const QRCodeDetectorBase&) = default; | ||
| QRCodeDetectorBase& operator=(QRCodeDetectorBase&&) = default; | ||
| /** @brief Detects QR code in image and returns the quadrangle containing the code. | ||
| @param img grayscale or color (BGR) image containing (or not) QR code. | ||
| @@ -801,15 +789,6 @@ class CV_EXPORTS_W QRCodeDetector | ||
| */ | ||
| CV_WRAP std::string decode(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. | ||
| @@ -819,14 +798,6 @@ class CV_EXPORTS_W QRCodeDetector | ||
| CV_WRAP std::string detectAndDecode(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. | ||
| @@ -860,18 +831,109 @@ class CV_EXPORTS_W QRCodeDetector | ||
| OutputArray points = noArray(), | ||
| OutputArrayOfArrays straight_qrcode = noArray() | ||
| ) const; | ||
| struct Impl; | ||
| protected: | ||
| Ptr<Impl> p; | ||
| }; | ||
| class CV_EXPORTS_W_SIMPLE QRCodeDetector : public QRCodeDetectorBase | ||
| { | ||
| public: | ||
| CV_WRAP QRCodeDetector(); | ||
| /** @brief sets the epsilon used during the horizontal scan of QR code stop marker detection. | ||
| @param epsX Epsilon neighborhood, which allows you to determine the horizontal pattern | ||
| of the scheme 1:1:3:1:1 according to QR code standard. | ||
| */ | ||
| CV_WRAP QRCodeDetector& setEpsX(double epsX); | ||
| /** @brief sets the epsilon used during the vertical scan of QR code stop marker detection. | ||
| @param epsY Epsilon neighborhood, which allows you to determine the vertical pattern | ||
| of the scheme 1:1:3:1:1 according to QR code standard. | ||
| */ | ||
| CV_WRAP QRCodeDetector& setEpsY(double epsY); | ||
| /** @brief use markers to improve the position of the corners of the QR code | ||
| * | ||
| * alignmentMarkers using by default | ||
| */ | ||
| CV_WRAP QRCodeDetector& setUseAlignmentMarkers(bool useAlignmentMarkers); | ||
| /** @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 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 std::string detectAndDecodeCurved(InputArray img, OutputArray points=noArray(), | ||
| OutputArray straight_qrcode = noArray()); | ||
| }; | ||
| class CV_EXPORTS_W_SIMPLE QRCodeDetectorAruco : public QRCodeDetectorBase { | ||
| public: | ||
| CV_WRAP QRCodeDetectorAruco(); | ||
| struct CV_EXPORTS_W_SIMPLE Params { | ||
| CV_WRAP Params(); | ||
| /** @brief The minimum allowed pixel size of a QR module in the smallest image in the image pyramid, default 4.f */ | ||
| CV_PROP_RW float minModuleSizeInPyramid; | ||
| /** @brief The maximum allowed relative rotation for finder patterns in the same QR code, default pi/12 */ | ||
| CV_PROP_RW float maxRotation; | ||
| /** @brief The maximum allowed relative mismatch in module sizes for finder patterns in the same QR code, default 1.75f */ | ||
| CV_PROP_RW float maxModuleSizeMismatch; | ||
| /** @brief The maximum allowed module relative mismatch for timing pattern module, default 2.f | ||
| * | ||
| * If relative mismatch of timing pattern module more this value, penalty points will be added. | ||
| * If a lot of penalty points are added, QR code will be rejected. */ | ||
| CV_PROP_RW float maxTimingPatternMismatch; | ||
| /** @brief The maximum allowed percentage of penalty points out of total pins in timing pattern, default 0.4f */ | ||
| CV_PROP_RW float maxPenalties; | ||
| /** @brief The maximum allowed relative color mismatch in the timing pattern, default 0.2f*/ | ||
| CV_PROP_RW float maxColorsMismatch; | ||
| /** @brief The algorithm find QR codes with almost minimum timing pattern score and minimum size, default 0.9f | ||
| * | ||
| * The QR code with the minimum "timing pattern score" and minimum "size" is selected as the best QR code. | ||
| * If for the current QR code "timing pattern score" * scaleTimingPatternScore < "previous timing pattern score" and "size" < "previous size", then | ||
| * current QR code set as the best QR code. */ | ||
| CV_PROP_RW float scaleTimingPatternScore; | ||
| }; | ||
| /** @brief QR code detector constructor for Aruco-based algorithm. See cv::QRCodeDetectorAruco::Params */ | ||
| CV_WRAP explicit QRCodeDetectorAruco(const QRCodeDetectorAruco::Params& params); | ||
| /** @brief Detector parameters getter. See cv::QRCodeDetectorAruco::Params */ | ||
| CV_WRAP const QRCodeDetectorAruco::Params& getDetectorParameters() const; | ||
| /** @brief Detector parameters setter. See cv::QRCodeDetectorAruco::Params */ | ||
| CV_WRAP QRCodeDetectorAruco& setDetectorParameters(const QRCodeDetectorAruco::Params& params); | ||
| /** @brief Aruco detector parameters are used to search for the finder patterns. */ | ||
| CV_WRAP aruco::DetectorParameters getArucoParameters(); | ||
| /** @brief Aruco detector parameters are used to search for the finder patterns. */ | ||
| CV_WRAP void setArucoParameters(const aruco::DetectorParameters& params); | ||
| }; | ||
| //! @} | ||
| } | ||
| #include "opencv2/objdetect/detection_based_tracker.hpp" | ||
| #include "opencv2/objdetect/face.hpp" | ||
| #include "opencv2/objdetect/charuco_detector.hpp" | ||
| #endif | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| { | ||
| "ManualFuncs" : { | ||
| "QRCodeDetectorAruco": { | ||
| "getDetectorParameters": {"declaration" : [""],"implementation" : [""] } | ||
| } | ||
| } | ||
| } |
Uh oh!
There was an error while loading.Please reload this page.
