Merge pull request #22814 from AleksandrPanov:log_qr_version

log QR version and corners
This commit is contained in:
Alexander Smorkalov 2022-11-17 11:02:11 +03:00 committed by GitHub
commit 08906ddd4b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -8,6 +8,7 @@
#include "precomp.hpp" #include "precomp.hpp"
#include "opencv2/objdetect.hpp" #include "opencv2/objdetect.hpp"
#include "opencv2/calib3d.hpp" #include "opencv2/calib3d.hpp"
#include <opencv2/core/utils/logger.hpp>
#ifdef HAVE_QUIRC #ifdef HAVE_QUIRC
#include "quirc.h" #include "quirc.h"
@ -2360,6 +2361,9 @@ bool QRDecode::versionDefinition()
version = saturate_cast<uint8_t>((std::min(transition_x, transition_y) - 1) * 0.25 - 1); version = saturate_cast<uint8_t>((std::min(transition_x, transition_y) - 1) * 0.25 - 1);
if ( !( 0 < version && version <= 40 ) ) { return false; } if ( !( 0 < version && version <= 40 ) ) { return false; }
version_size = 21 + (version - 1) * 4; version_size = 21 + (version - 1) * 4;
CV_LOG_INFO(NULL, "QR corners: " << original_points[0] << " " << original_points[1] << " " << original_points[2] <<
" " << original_points[3]);
CV_LOG_INFO(NULL, "QR version: " << (int)version);
return true; return true;
} }