mirror of
https://github.com/koush/scrypted.git
synced 2026-05-05 22:00:27 +01:00
videoanalysis: add support for lpr on smart motion sensor
This commit is contained in:
4
plugins/objectdetector/package-lock.json
generated
4
plugins/objectdetector/package-lock.json
generated
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "@scrypted/objectdetector",
|
||||
"version": "0.1.33",
|
||||
"version": "0.1.34",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "@scrypted/objectdetector",
|
||||
"version": "0.1.33",
|
||||
"version": "0.1.34",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@scrypted/common": "file:../../common",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@scrypted/objectdetector",
|
||||
"version": "0.1.33",
|
||||
"version": "0.1.34",
|
||||
"description": "Scrypted Video Analysis Plugin. Installed alongside a detection service like OpenCV or TensorFlow.",
|
||||
"author": "Scrypted",
|
||||
"license": "Apache-2.0",
|
||||
|
||||
@@ -45,13 +45,15 @@ export class SmartMotionSensor extends ScryptedDeviceBase implements Settings, R
|
||||
defaultValue: 0.7,
|
||||
},
|
||||
labels: {
|
||||
group: 'Recognition',
|
||||
title: 'Labels',
|
||||
description: 'The labels that will trigger this smart motion sensor.',
|
||||
description: 'The labels (license numbers, names) that will trigger this smart motion sensor.',
|
||||
multiple: true,
|
||||
combobox: true,
|
||||
choices: [],
|
||||
},
|
||||
labelDistance: {
|
||||
group: 'Recognition',
|
||||
title: 'Label Distance',
|
||||
description: 'The maximum edit distance between the detected label and the desired label. Ie, a distance of 1 will match "abcde" to "abcbe" or "abcd".',
|
||||
type: 'number',
|
||||
@@ -198,11 +200,10 @@ export class SmartMotionSensor extends ScryptedDeviceBase implements Settings, R
|
||||
this.console.warn('Camera does not provide Zones in detection event. Zone filter will not be applied.');
|
||||
}
|
||||
}
|
||||
if (d.movement && !d.movement.moving)
|
||||
return false;
|
||||
|
||||
// when not searching for a label, validate the object is moving.
|
||||
if (!labels?.length)
|
||||
return true;
|
||||
return !d.movement || d.movement.moving;
|
||||
|
||||
if (!d.label)
|
||||
return false;
|
||||
@@ -215,6 +216,7 @@ export class SmartMotionSensor extends ScryptedDeviceBase implements Settings, R
|
||||
continue;
|
||||
if (levenshteinDistance(label, du) <= labelDistance)
|
||||
return true;
|
||||
this.console.log('No label does not match.', label, du);
|
||||
}
|
||||
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user