detect

package
v0.0.0-...-4b72d78 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2020 License: GPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CamStatusInactive = errors.New("Camera is inactive")

Functions

This section is empty.

Types

type Config

type Config struct {
	Cameras        []*camera.Cam
	StickDeviceNum int
	GraphFileName  string
	GraphLabels    []string
	AlertLabels    []string
	GraphWidth     int
	GraphHeight    int
}

type Detector

type Detector struct {
	Cameras      []*camera.Cam
	Captures     []*gocv.VideoCapture
	CapturesLock sync.Mutex
	Graph        *ncs.Graph
	GraphLabels  []string
	AlertLabels  []string
	NCSDevice    *ncs.Stick
	Frame        gocv.Mat
	FrameRaw     gocv.Mat
	FrameResized gocv.Mat
	FrameFP32    gocv.Mat
	GraphWidth   int
	GraphHeight  int
	SubMat       gocv.Mat
	MulMat       gocv.Mat
}

func New

func New(config Config) (*Detector, error)

func (*Detector) AnnotateNextFrame

func (d *Detector) AnnotateNextFrame(camIndex int) (string, []byte, error)

func (*Detector) CamRead

func (d *Detector) CamRead(camIndex int, frame *gocv.Mat) error

func (*Detector) Close

func (d *Detector) Close()

func (*Detector) DetectNextFrame

func (d *Detector) DetectNextFrame(camIndex int) (*frame.FrameDetectResult, error)

func (*Detector) ParseResult

func (d *Detector) ParseResult(data []byte) ([]*frame.Box, error)

a. First fp16 value holds the number of valid detections = num_valid. b. The next 6 values are unused. c. The next (7 * num_valid) values contain the valid detections data

Each group of 7 values will describe an object/box These 7 values in order.
The values are:
  0: image_id (always 0)
  1: class_id (this is an index into labels)
  2: score (this is the probability for the class)
  3: box left location within image as number between 0.0 and 1.0
  4: box top location within image as number between 0.0 and 1.0
  5: box right location within image as number between 0.0 and 1.0
  6: box bottom location within image as number between 0.0 and 1.0

func (*Detector) SnapshotNextFrame

func (d *Detector) SnapshotNextFrame(camIndex int) ([]byte, error)

func (*Detector) ToggleFeeds

func (d *Detector) ToggleFeeds() error

Turn on and off camera feeds depending on whether they are active or not

Jump to

Keyboard shortcuts

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