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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user