mirror of
https://github.com/opencv/opencv.git
synced 2025-06-07 17:44:04 +08:00
fixed setArucoParameters/getArucoParameters
This commit is contained in:
parent
12aa0fe898
commit
9e7ec59a41
@ -854,7 +854,7 @@ public:
|
|||||||
CV_WRAP QRCodeDetectorAruco& setDetectorParameters(const QRCodeDetectorAruco::Params& params);
|
CV_WRAP QRCodeDetectorAruco& setDetectorParameters(const QRCodeDetectorAruco::Params& params);
|
||||||
|
|
||||||
/** @brief Aruco detector parameters are used to search for the finder patterns. */
|
/** @brief Aruco detector parameters are used to search for the finder patterns. */
|
||||||
CV_WRAP aruco::DetectorParameters getArucoParameters();
|
CV_WRAP const aruco::DetectorParameters& getArucoParameters() const;
|
||||||
|
|
||||||
/** @brief Aruco detector parameters are used to search for the finder patterns. */
|
/** @brief Aruco detector parameters are used to search for the finder patterns. */
|
||||||
CV_WRAP void setArucoParameters(const aruco::DetectorParameters& params);
|
CV_WRAP void setArucoParameters(const aruco::DetectorParameters& params);
|
||||||
|
@ -4615,13 +4615,13 @@ vector<QRCode> analyzeFinderPatterns(const vector<vector<Point2f> > &corners, co
|
|||||||
struct PimplQRAruco : public ImplContour {
|
struct PimplQRAruco : public ImplContour {
|
||||||
QRCodeDetectorAruco::Params qrParams;
|
QRCodeDetectorAruco::Params qrParams;
|
||||||
aruco::ArucoDetector arucoDetector;
|
aruco::ArucoDetector arucoDetector;
|
||||||
aruco::DetectorParameters arucoParams;
|
|
||||||
|
|
||||||
PimplQRAruco() {
|
PimplQRAruco() {
|
||||||
Mat bits = Mat::ones(Size(5, 5), CV_8UC1);
|
Mat bits = Mat::ones(Size(5, 5), CV_8UC1);
|
||||||
Mat(bits, Rect(1, 1, 3, 3)).setTo(Scalar(0));
|
Mat(bits, Rect(1, 1, 3, 3)).setTo(Scalar(0));
|
||||||
Mat byteList = aruco::Dictionary::getByteListFromBits(bits);
|
Mat byteList = aruco::Dictionary::getByteListFromBits(bits);
|
||||||
aruco::Dictionary dictionary = aruco::Dictionary(byteList, 5, 4);
|
aruco::Dictionary dictionary = aruco::Dictionary(byteList, 5, 4);
|
||||||
|
aruco::DetectorParameters arucoParams;
|
||||||
arucoParams.minMarkerPerimeterRate = 0.02;
|
arucoParams.minMarkerPerimeterRate = 0.02;
|
||||||
arucoDetector = aruco::ArucoDetector(dictionary, arucoParams);
|
arucoDetector = aruco::ArucoDetector(dictionary, arucoParams);
|
||||||
}
|
}
|
||||||
@ -4695,12 +4695,12 @@ QRCodeDetectorAruco& QRCodeDetectorAruco::setDetectorParameters(const QRCodeDete
|
|||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
aruco::DetectorParameters QRCodeDetectorAruco::getArucoParameters() {
|
const aruco::DetectorParameters& QRCodeDetectorAruco::getArucoParameters() const {
|
||||||
return std::dynamic_pointer_cast<PimplQRAruco>(p)->arucoParams;
|
return std::dynamic_pointer_cast<PimplQRAruco>(p)->arucoDetector.getDetectorParameters();
|
||||||
}
|
}
|
||||||
|
|
||||||
void QRCodeDetectorAruco::setArucoParameters(const aruco::DetectorParameters& params) {
|
void QRCodeDetectorAruco::setArucoParameters(const aruco::DetectorParameters& params) {
|
||||||
std::dynamic_pointer_cast<PimplQRAruco>(p)->arucoParams = params;
|
std::dynamic_pointer_cast<PimplQRAruco>(p)->arucoDetector.setDetectorParameters(params);
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
Loading…
Reference in New Issue
Block a user