forked from Github/frigate
New mask/zone editor and motion tuner (#11020)
* initial working konva * working multi polygons * multi zones * clean up * new zone dialog * clean up * relative coordinates and colors * fix color order * better motion tuner * objects for zones * progress * merge dev * edit pane * motion and object masks * filtering * add objects and unsaved to type * motion tuner, edit controls, tooltips * object and motion edit panes * polygon item component, switch color, object form, hover cards * working zone edit pane * working motion masks * object masks and deletion of all types * use FilterSwitch * motion tuner fixes and tweaks * clean up * tweaks * spaces in camera name * tweaks * allow dragging of points while drawing polygon * turn off editing mode when switching camera * limit interpolated coordinates and use crosshair cursor * padding * fix tooltip trigger for icons * konva tweaks * consolidate * fix top menu items on mobile
This commit is contained in:
31
web/src/types/canvas.ts
Normal file
31
web/src/types/canvas.ts
Normal file
@@ -0,0 +1,31 @@
|
||||
export type PolygonType = "zone" | "motion_mask" | "object_mask";
|
||||
|
||||
export type Polygon = {
|
||||
typeIndex: number;
|
||||
camera: string;
|
||||
name: string;
|
||||
type: PolygonType;
|
||||
objects: string[];
|
||||
points: number[][];
|
||||
isFinished: boolean;
|
||||
// isUnsaved: boolean;
|
||||
color: number[];
|
||||
};
|
||||
|
||||
export type ZoneFormValuesType = {
|
||||
name: string;
|
||||
inertia: number;
|
||||
loitering_time: number;
|
||||
isFinished: boolean;
|
||||
objects: string[];
|
||||
review_alerts: boolean;
|
||||
review_detections: boolean;
|
||||
};
|
||||
|
||||
export type ObjectMaskFormValuesType = {
|
||||
objects: string;
|
||||
polygon: {
|
||||
isFinished: boolean;
|
||||
name: string;
|
||||
};
|
||||
};
|
||||
@@ -21,6 +21,14 @@ export interface BirdseyeConfig {
|
||||
width: number;
|
||||
}
|
||||
|
||||
export const ATTRIBUTE_LABELS = [
|
||||
"amazon",
|
||||
"face",
|
||||
"fedex",
|
||||
"license_plate",
|
||||
"ups",
|
||||
];
|
||||
|
||||
export interface CameraConfig {
|
||||
audio: {
|
||||
enabled: boolean;
|
||||
@@ -106,7 +114,7 @@ export interface CameraConfig {
|
||||
objects: {
|
||||
filters: {
|
||||
[objectName: string]: {
|
||||
mask: string | null;
|
||||
mask: string[] | null;
|
||||
max_area: number;
|
||||
max_ratio: number;
|
||||
min_area: number;
|
||||
@@ -163,6 +171,14 @@ export interface CameraConfig {
|
||||
};
|
||||
sync_recordings: boolean;
|
||||
};
|
||||
review: {
|
||||
alerts: {
|
||||
required_zones: string[];
|
||||
};
|
||||
detections: {
|
||||
required_zones: string[];
|
||||
};
|
||||
};
|
||||
rtmp: {
|
||||
enabled: boolean;
|
||||
};
|
||||
@@ -199,7 +215,9 @@ export interface CameraConfig {
|
||||
coordinates: string;
|
||||
filters: Record<string, unknown>;
|
||||
inertia: number;
|
||||
loitering_time: number;
|
||||
objects: string[];
|
||||
color: number[];
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -327,7 +345,7 @@ export interface FrigateConfig {
|
||||
objects: {
|
||||
filters: {
|
||||
[objectName: string]: {
|
||||
mask: string | null;
|
||||
mask: string[] | null;
|
||||
max_area: number;
|
||||
max_ratio: number;
|
||||
min_area: number;
|
||||
@@ -336,7 +354,7 @@ export interface FrigateConfig {
|
||||
threshold: number;
|
||||
};
|
||||
};
|
||||
mask: string;
|
||||
mask: string[];
|
||||
track: string[];
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user