1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-31 00:03:03 +04:00

JS bindings for bar code detector.

This commit is contained in:
Alexander Smorkalov
2023-06-14 16:53:32 +03:00
parent 463cd09811
commit 538b13aeec
4 changed files with 26 additions and 6 deletions
+21
View File
@@ -221,6 +221,27 @@ QUnit.test('Aruco-based QR code detect', function (assert) {
mat.delete();
}
});
QUnit.test('Bar code detect', function (assert) {
{
let detector = new cv.barcode_BarcodeDetector();
let mat = cv.Mat.ones(800, 600, cv.CV_8U);
assert.ok(mat);
let points = new cv.Mat();
let codeFound = detector.detect(mat, points);
assert.equal(points.rows, 0)
assert.equal(points.cols, 0)
assert.equal(codeFound, false);
codeContent = detector.detectAndDecode(mat);
assert.equal(typeof codeContent, 'string');
assert.equal(codeContent, '');
detector.delete();
points.delete();
mat.delete();
}
});
QUnit.test('Aruco detector', function (assert) {
{
let dictionary = cv.getPredefinedDictionary(cv.DICT_4X4_50);