Documentation
¶
Index ¶
- Constants
- Variables
- func ConfigureUI(p *Project, httpAddress string)
- func OpenInBrowser(l net.Listener) error
- func Radians(a, b Point) float64
- func RadiansToDegrees(rad float64) (deg float64)
- type Analyzer
- type BBox
- type Calibration
- type FrameAnalysis
- type FramePosition
- type Iterator
- func (p *Iterator) Close()
- func (i *Iterator) Duration() time.Duration
- func (i *Iterator) DurationMs() time.Duration
- func (i *Iterator) Error() error
- func (i *Iterator) Frame() int
- func (i *Iterator) Image() image.Image
- func (i *Iterator) IsKeyFrame() bool
- func (i *Iterator) Next() bool
- func (i *Iterator) Seek(d time.Duration) error
- func (i *Iterator) VideoResolution() string
- type Mask
- type Masks
- type Point
- type Position
- type Project
- type Response
- type Settings
- type VehiclePosition
Constants ¶
View Source
const SkipRotate = 0.00001
Variables ¶
View Source
var Template *template.Template
Functions ¶
func ConfigureUI ¶
exposes a UI for configuration and exits on save or cancel
func OpenInBrowser ¶
func RadiansToDegrees ¶
Types ¶
type Analyzer ¶
type Calibration ¶
type Calibration struct {
Seek float64 `json:"seek"`
A Point `json:"a"`
B Point `json:"b"`
Inches float64 `json:"inches"`
}
func ParseCalibration ¶
func ParseCalibration(s string) (c *Calibration)
func (*Calibration) Pretty ¶
func (c *Calibration) Pretty() string
func (*Calibration) String ¶
func (c *Calibration) String() string
type FrameAnalysis ¶
type FrameAnalysis struct {
Timestamp time.Duration `json:"ts"`
Base template.URL `json:"base,omitempty"` // first frame
BaseGif template.URL `json:"base_gif,omitempty"`
Highlight template.URL `json:"highlight,omitempty"` // frame - bg
HighlightGif template.URL `json:"highlight_gif,omitempty"`
Colored template.URL `json:"colored,omitempty"` // detected items in highlight
ColoredGif template.URL `json:"colored_gif,omitempty"`
Positions []labelimg.Label `json:"positions,omitempty"`
// contains filtered or unexported fields
}
func (*FrameAnalysis) Calculate ¶
func (f *FrameAnalysis) Calculate(bg *image.RGBA, blurRadius, contiguousPixels, minMass int, tolerance uint8)
func (FrameAnalysis) NeedsMore ¶
func (f FrameAnalysis) NeedsMore() bool
type FramePosition ¶
type Iterator ¶
type Iterator struct {
// contains filtered or unexported fields
}
func NewIterator ¶
func (*Iterator) DurationMs ¶
func (*Iterator) IsKeyFrame ¶
func (*Iterator) VideoResolution ¶
type Mask ¶
type Point ¶
func ParsePoint ¶
type Position ¶
type Position struct {
X float64 `json:"x"`
Y float64 `json:"y"`
Mass int `json:"mass"`
XSpan []int `json:"xspan"` // [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16]
YSpan []int `json:"yspan"`
}
Position matches Position in position.jl
type Project ¶
type Project struct {
Filename string `json:"filename"` // Filename is not relative to Dir
Dir string `json:"dir,omitempty"`
Settings `json:"settings"`
Duration time.Duration `json:"duration,omitempty"`
VideoResolution string `json:"video_resolution,omitempty"`
Frames int64 `json:"frames,omitempty"`
Seek float64 `json:"-"`
Step int `json:"-"`
Response Response `json:"-"`
Err error `json:"-"`
}
func LoadProject ¶
LoadProject loads a project from a JSON file
func NewProject ¶
NewProject starst a project for the specified video file
type Response ¶
type Response struct {
PreCroppedResolution string `json:"pre_cropped_resolution,omitempty"`
CroppedResolution string `json:"cropped_resolution,omitempty"`
OverviewGif template.URL `json:"overview_gif,omitempty"`
Step4Img template.URL `json:"step_4_img,omitempty"` // mask
Step4MaskImg template.URL `json:"step_4_mask_img,omitempty"`
BackgroundImg template.URL `json:"background_img,omitempty"`
FrameAnalysis []FrameAnalysis `json:"frame_analysis,omitempty"`
VehiclePositions []VehiclePosition
Step6Img template.URL `json:"step_6_img,omitempty"`
DebugImages []template.URL
}
type Settings ¶
type Settings struct {
PreCrop *BBox `json:"pre_crop,omitempty"`
Rotate float64 `json:"rotate,omitempty"` // radians
PostCrop *BBox `json:"post_crop,omitempty"`
Masks Masks `json:"masks,omitempty"`
Tolerance uint8 `json:"tolerance,omitempty"`
Blur int `json:"blur,omitempty"`
ContiguousPixels int `json:"contiguous_pixels,omitempty"`
MinMass int `json:"min_mass,omitempty"`
Calibrations []*Calibration `json:"-"`
}
Settings are the user configurable options
type VehiclePosition ¶
func ClosestPosition ¶
func ClosestPosition(point image.Point, v []VehiclePosition) VehiclePosition
func TrackVehicles ¶
func TrackVehicles(frames []FramePosition) []VehiclePosition
TrackVehicles tracks detected objects and correlates across frames based on logic from identifyvehicles from https://github.com/mbauman/TrafficSpeed/blob/master/TrafficSpeed.ipynb
Click to show internal directories.
Click to hide internal directories.