mirror of
https://github.com/opencv/opencv.git
synced 2026-07-29 23:33:05 +04:00
Merge pull request #23790 from asmorkalov:as/qrcode_aruco_js
JS bindings for Aruco-based QR code detector
This commit is contained in:
@@ -90,6 +90,8 @@ using namespace cv;
|
||||
using namespace cv::segmentation; // FIXIT
|
||||
|
||||
using namespace cv::aruco;
|
||||
typedef aruco::DetectorParameters aruco_DetectorParameters;
|
||||
typedef QRCodeDetectorAruco::Params QRCodeDetectorAruco_Params;
|
||||
|
||||
#ifdef HAVE_OPENCV_DNN
|
||||
using namespace cv::dnn;
|
||||
|
||||
@@ -200,6 +200,27 @@ QUnit.test('QR code detect and decode', function (assert) {
|
||||
|
||||
}
|
||||
});
|
||||
QUnit.test('Aruco-based QR code detect', function (assert) {
|
||||
{
|
||||
let qrcode_params = new cv.QRCodeDetectorAruco_Params();
|
||||
let detector = new cv.QRCodeDetectorAruco();
|
||||
let mat = cv.Mat.ones(800, 600, cv.CV_8U);
|
||||
assert.ok(mat);
|
||||
|
||||
detector.setDetectorParameters(qrcode_params);
|
||||
|
||||
let points = new cv.Mat();
|
||||
let qrCodeFound = detector.detect(mat, points);
|
||||
assert.equal(points.rows, 0)
|
||||
assert.equal(points.cols, 0)
|
||||
assert.equal(qrCodeFound, false);
|
||||
|
||||
qrcode_params.delete();
|
||||
detector.delete();
|
||||
points.delete();
|
||||
mat.delete();
|
||||
}
|
||||
});
|
||||
QUnit.test('Aruco detector', function (assert) {
|
||||
{
|
||||
let dictionary = cv.getPredefinedDictionary(cv.DICT_4X4_50);
|
||||
|
||||
Reference in New Issue
Block a user