Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commite964404

Browse files
author
Alex
committed
use inner class Params, add Params to objc ignore list
1 parent1ec09d1 commite964404

File tree

3 files changed

+44
-37
lines changed

3 files changed

+44
-37
lines changed

‎modules/objdetect/include/opencv2/objdetect.hpp‎

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -871,48 +871,48 @@ class CV_EXPORTS_W QRCodeDetector : public QRCodeDetectorBase
871871
OutputArray straight_qrcode = noArray());
872872
};
873873

874-
structCV_EXPORTS_W_SIMPLE QrWithArucoParams {
875-
CV_WRAPQrWithArucoParams();
874+
classCV_EXPORTS_W QRCodeDetectorAruco : public QRCodeDetectorBase {
875+
public:
876+
structCV_EXPORTS_W_SIMPLE Params {
877+
CV_WRAPParams();
876878

877-
/** @brief The minimum allowed pixel size of a QR module in the smallest image in the image pyramid, default 4.f*/
878-
CV_PROP_RWfloat minModuleSizeInPyramid;
879+
/** @brief The minimum allowed pixel size of a QR module in the smallest image in the image pyramid, default 4.f*/
880+
CV_PROP_RWfloat minModuleSizeInPyramid;
879881

880-
/** @brief The maximum allowed relative rotation for finder patterns in the same QR code, default pi/12*/
881-
CV_PROP_RWfloat maxRotation;
882+
/** @brief The maximum allowed relative rotation for finder patterns in the same QR code, default pi/12*/
883+
CV_PROP_RWfloat maxRotation;
882884

883-
/** @brief The maximum allowed relative mismatch in module sizes for finder patterns in the same QR code, default 1.75f*/
884-
CV_PROP_RWfloat maxModuleSizeMismatch;
885+
/** @brief The maximum allowed relative mismatch in module sizes for finder patterns in the same QR code, default 1.75f*/
886+
CV_PROP_RWfloat maxModuleSizeMismatch;
885887

886-
/** @brief The maximum allowed module relative mismatch for timing pattern module, default 2.f
887-
*
888-
* If relative mismatch of timing pattern module more this value, penalty points will be added.
889-
* If a lot of penalty points are added, QR code will be rejected.*/
890-
CV_PROP_RWfloat maxTimingPatternMismatch;
888+
/** @brief The maximum allowed module relative mismatch for timing pattern module, default 2.f
889+
*
890+
* If relative mismatch of timing pattern module more this value, penalty points will be added.
891+
* If a lot of penalty points are added, QR code will be rejected.*/
892+
CV_PROP_RWfloat maxTimingPatternMismatch;
891893

892-
/** @brief The maximum allowed percentage of penalty points out of total pins in timing pattern, default 0.4f*/
893-
CV_PROP_RWfloat maxPenalties;
894+
/** @brief The maximum allowed percentage of penalty points out of total pins in timing pattern, default 0.4f*/
895+
CV_PROP_RWfloat maxPenalties;
894896

895-
/** @brief The maximum allowed relative color mismatch in the timing pattern, default 0.2f*/
896-
CV_PROP_RWfloat maxColorsMismatch;
897+
/** @brief The maximum allowed relative color mismatch in the timing pattern, default 0.2f*/
898+
CV_PROP_RWfloat maxColorsMismatch;
897899

898-
/** @brief The algorithm find QR codes with almost minimum timing pattern score and minimum size, default 0.9f
899-
*
900-
* The QR code with the minimum "timing pattern score" and minimum "size" is selected as the best QR code.
901-
* If for the current QR code "timing pattern score" * scaleTimingPatternScore < "previous timing pattern score" and "size" < "previous size", then
902-
* current QR code set as the best QR code.*/
903-
CV_PROP_RWfloat scaleTimingPatternScore;
904-
};
900+
/** @brief The algorithm find QR codes with almost minimum timing pattern score and minimum size, default 0.9f
901+
*
902+
* The QR code with the minimum "timing pattern score" and minimum "size" is selected as the best QR code.
903+
* If for the current QR code "timing pattern score" * scaleTimingPatternScore < "previous timing pattern score" and "size" < "previous size", then
904+
* current QR code set as the best QR code.*/
905+
CV_PROP_RWfloat scaleTimingPatternScore;
906+
};
905907

906-
classCV_EXPORTS_W QRCodeDetectorAruco : public QRCodeDetectorBase {
907-
public:
908908
/** @brief QR code detector constructor for Aruco-based algorithm. See #cv::QrWithArucoParams*/
909-
CV_WRAPQRCodeDetectorAruco(constQrWithArucoParams& params =QrWithArucoParams());
909+
CV_WRAPQRCodeDetectorAruco(constQRCodeDetectorAruco::Params& params =QRCodeDetectorAruco::Params());
910910

911911
/** @brief Detector parameters setter. See #cv::QrWithArucoParams*/
912-
CV_WRAPQrWithArucoParamsgetDetectorParameters();
912+
CV_WRAPQRCodeDetectorAruco::ParamsgetDetectorParameters();
913913

914914
/** @brief Detector parameters getter. See #cv::QrWithArucoParams*/
915-
CV_WRAPvoidsetDetectorParameters(constQrWithArucoParams& params);
915+
CV_WRAPvoidsetDetectorParameters(constQRCodeDetectorAruco::Params& params);
916916

917917
/** @brief Aruco detector parameters are used to search for the finder patterns.*/
918918
CV_WRAP aruco::DetectorParametersgetArucoParameters();
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"ManualFuncs" : {
3+
"QRCodeDetectorAruco": {
4+
"getDetectorParameters": {"declaration" : [""],"implementation" : [""] }
5+
}
6+
}
7+
}

‎modules/objdetect/src/qrcode.cpp‎

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4044,7 +4044,7 @@ void QRCodeDetector::setUseAlignmentMarkers(bool useAlignmentMarkers) {
40444044
(std::static_pointer_cast<ImplContour>)(p)->useAlignmentMarkers = useAlignmentMarkers;
40454045
}
40464046

4047-
QrWithArucoParams::QrWithArucoParams() {
4047+
QRCodeDetectorAruco::Params::Params() {
40484048
minModuleSizeInPyramid =4.f;
40494049
maxRotation = (float)CV_PI/12.f;
40504050
maxModuleSizeMismatch =1.75f;
@@ -4271,7 +4271,7 @@ struct QRCode {
42714271
}
42724272

42734273
static QRCodecheckCompatibilityPattern(const FinderPatternInfo &_pattern1,const FinderPatternInfo& _pattern2,const FinderPatternInfo& _pattern3,
4274-
Point3i& index,constQrWithArucoParams& qrDetectorParameters) {
4274+
Point3i& index,constQRCodeDetectorAruco::Params& qrDetectorParameters) {
42754275
FinderPatternInfo pattern1 = _pattern1, pattern2 = _pattern2, pattern3 = _pattern3;
42764276
Point2f centerQR;
42774277
float distance = std::numeric_limits<float>::max();
@@ -4348,7 +4348,7 @@ struct QRCode {
43484348
return qrcode;
43494349
}
43504350

4351-
intcalculateScoreByTimingPattern(Mat &img,constQrWithArucoParams& params) {
4351+
intcalculateScoreByTimingPattern(Mat &img,constQRCodeDetectorAruco::Params& params) {
43524352
constint minModulesInTimingPattern =4;
43534353

43544354
const Point3i v1 = centerPattern.getTimingPatternScore(rightPattern.getTimingStart(FinderPatternInfo::CENTER),
@@ -4396,7 +4396,7 @@ struct QRCode {
43964396

43974397
static
43984398
vector<QRCode>analyzeFinderPatterns(const vector<vector<Point2f> > &corners,const Mat& img,
4399-
constQrWithArucoParams& qrDetectorParameters) {
4399+
constQRCodeDetectorAruco::Params& qrDetectorParameters) {
44004400
vector<QRCode> qrCodes;
44014401
vector<FinderPatternInfo> patterns;
44024402
if (img.empty())
@@ -4474,7 +4474,7 @@ vector<QRCode> analyzeFinderPatterns(const vector<vector<Point2f> > &corners, co
44744474
}
44754475

44764476
structPimplQRAruco :publicImplContour {
4477-
QrWithArucoParams qrParams;
4477+
QRCodeDetectorAruco::Params qrParams;
44784478
aruco::ArucoDetector arucoDetector;
44794479
aruco::DetectorParameters arucoParams;
44804480

@@ -4538,16 +4538,16 @@ struct PimplQRAruco : public ImplContour {
45384538
}
45394539
};
45404540

4541-
QRCodeDetectorAruco::QRCodeDetectorAruco(constQrWithArucoParams& params) {
4541+
QRCodeDetectorAruco::QRCodeDetectorAruco(constQRCodeDetectorAruco::Params& params) {
45424542
p =newPimplQRAruco();
45434543
(std::static_pointer_cast<PimplQRAruco>(p))->qrParams = params;
45444544
}
45454545

4546-
QrWithArucoParamsQRCodeDetectorAruco::getDetectorParameters() {
4546+
QRCodeDetectorAruco::ParamsQRCodeDetectorAruco::getDetectorParameters() {
45474547
return (std::static_pointer_cast<PimplQRAruco>(p))->qrParams;
45484548
}
45494549

4550-
voidQRCodeDetectorAruco::setDetectorParameters(constQrWithArucoParams& params) {
4550+
voidQRCodeDetectorAruco::setDetectorParameters(constQRCodeDetectorAruco::Params& params) {
45514551
(std::static_pointer_cast<PimplQRAruco>(p))->qrParams = params;
45524552
}
45534553

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp