videoanalysis: add support for lpr on smart motion sensor

This commit is contained in:
Koushik Dutta
2024-04-17 08:26:53 -07:00
parent 3abb6472a7
commit 1c8fd2399d
3 changed files with 9 additions and 7 deletions

View File

@@ -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",

View File

@@ -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",

View File

@@ -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;