monitor

package
v0.0.0-...-c7835ec Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 1, 2024 License: MIT Imports: 20 Imported by: 0

README

'Genuine' field

In TrackedObject we have a Genuine field. This is an attempt at reducing false positives from the NN. We should aim to get rid of this kind of filtering, and rely solely on the neural network. End to end is always the goal!

Documentation

Index

Constants

View Source
const WatcherChannelSize = 100

SYNC-WATCHER-CHANNEL-SIZE

Variables

This section is empty.

Functions

This section is empty.

Types

type AnalysisState

type AnalysisState struct {
	CameraID int64               `json:"cameraID"`
	Input    *nn.DetectionResult `json:"input"`
	Objects  []TrackedObject     `json:"objects"`
}

Result of post-process analysis on the Object Detection neural network output SYNC-ANALYSIS-STATE

type Monitor

type Monitor struct {
	Log log.Log
	// contains filtered or unexported fields
}

func NewMonitor

func NewMonitor(logger log.Log) (*Monitor, error)

func (*Monitor) AddWatcher

func (m *Monitor) AddWatcher(cameraID int64) chan *AnalysisState

Register to receive detection results for a specific camera. You must be careful to ensure that your receiver always processes a result immediately, and keeps the channel drained. If you don't do this, then the monitor will freeze, and obviously that's a really bad thing to happen to a security system.

func (*Monitor) AddWatcherAllCameras

func (m *Monitor) AddWatcherAllCameras() chan *AnalysisState

Add a watcher that is interested in all camera activity

func (*Monitor) AllClasses

func (m *Monitor) AllClasses() []string

Return the list of all classes that the NN detects

func (*Monitor) Close

func (m *Monitor) Close()

Close the monitor object.

func (*Monitor) DetectedClasses

func (m *Monitor) DetectedClasses() []string

Return the list of classes that we're interested in

func (*Monitor) LatestFrame

func (m *Monitor) LatestFrame(cameraID int64) (*cimg.Image, *nn.DetectionResult, *AnalysisState, error)

Return the most recent frame and detection result for a camera

func (*Monitor) RemoveWatcher

func (m *Monitor) RemoveWatcher(cameraID int64, ch chan *AnalysisState)

Unregister from detection results for a specific camera

func (*Monitor) RemoveWatcherAllCameras

func (m *Monitor) RemoveWatcherAllCameras(ch chan *AnalysisState)

Unregister from detection results of all cameras

func (*Monitor) SetCameras

func (m *Monitor) SetCameras(cameras []*camera.Camera)

Set cameras and start monitoring

type TrackedObject

type TrackedObject struct {
	ID      uint32  `json:"id"`
	Class   int     `json:"class"`
	Box     nn.Rect `json:"box"`
	Genuine bool    `json:"genuine"`
}

An object that was detected by the Object Detector, and is now being tracked by a post-process SYNC-TRACKED-OBJECT

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL