Documentation ¶
Index ¶
- Constants
- type AnalysisState
- type Monitor
- func (m *Monitor) AddWatcher(cameraID int64) chan *AnalysisState
- func (m *Monitor) AddWatcherAllCameras() chan *AnalysisState
- func (m *Monitor) AllClasses() []string
- func (m *Monitor) Close()
- func (m *Monitor) DetectedClasses() []string
- func (m *Monitor) LatestFrame(cameraID int64) (*cimg.Image, *nn.DetectionResult, *AnalysisState, error)
- func (m *Monitor) RemoveWatcher(cameraID int64, ch chan *AnalysisState)
- func (m *Monitor) RemoveWatcherAllCameras(ch chan *AnalysisState)
- func (m *Monitor) SetCameras(cameras []*camera.Camera)
- type TrackedObject
Constants ¶
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 ¶
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 ¶
Return the list of all classes that the NN detects
func (*Monitor) DetectedClasses ¶
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 ¶
Set cameras and start monitoring