Documentation ¶
Index ¶
- Constants
- type Frame
- type FramesCollection
- func (frames *FramesCollection) Append(frame *Frame) error
- func (frames *FramesCollection) CalculateStatistics(movingMeanResolution int) FramesStatistics
- func (frames *FramesCollection) ExportCsvReport(file io.Writer) error
- func (frames *FramesCollection) ExportJsonReport(file io.Writer) error
- func (frames *FramesCollection) Get(frameNumber int) (*Frame, error)
- func (frames *FramesCollection) GetAll() []*Frame
- type FramesStatistics
Constants ¶
const ( // TODO: Implement different threshold for day/night. The brightness value can be used as the determinant. BinaryThresholdParam float64 = 0.784313725 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Frame ¶
type Frame struct { OrdinalNumber int `json:"ordinal-number"` ColorDifference float64 `json:"color-difference"` BinaryThresholdDifference float64 `json:"binary-threshold-difference"` Brightness float64 `json:"brightness"` }
Strucutre representing a single video frame and its calculated parameters. TODO: When it coms to BinaryThreshold we need to test which approach gives better results. Currently we are comparing the BT of the previous and current frame and than calcualte the white_pixels / all_pixels Alternatively we can just count the occurance of white pixels and return the non-normalized result
func CreateNewFrame ¶
Create a new frame instance by providing the current and previous frame images and the ordinal number of the frame.
type FramesCollection ¶
Structure representing the collection of video frames.
func CreateNewFramesCollection ¶
func CreateNewFramesCollection(frames int) *FramesCollection
Create a new frames collection with a given capacity of frames.
func (*FramesCollection) Append ¶
func (frames *FramesCollection) Append(frame *Frame) error
Add a new frame to the frames collection.
func (*FramesCollection) CalculateStatistics ¶
func (frames *FramesCollection) CalculateStatistics(movingMeanResolution int) FramesStatistics
Calculate the descriptive statistics values for the given frames collection.
func (*FramesCollection) ExportCsvReport ¶
func (frames *FramesCollection) ExportCsvReport(file io.Writer) error
Write the CSV format frames report to the provided writer which can be a file reference.
func (*FramesCollection) ExportJsonReport ¶
func (frames *FramesCollection) ExportJsonReport(file io.Writer) error
Write the JSON format frames report to the provided writer which can be a file reference.
func (*FramesCollection) Get ¶
func (frames *FramesCollection) Get(frameNumber int) (*Frame, error)
Get a frame from the frames collection by the frame ordinal number.
func (*FramesCollection) GetAll ¶
func (frames *FramesCollection) GetAll() []*Frame
Get all frames sorted by the frame ordinal number. TODO: Add tests
type FramesStatistics ¶
type FramesStatistics struct { BrightnessMean float64 `json:"brightness-mean"` BrightnessMovingMean []float64 `json:"brightness-moving-mean"` BrightnessStandardDeviation float64 `json:"brightness-standard-deviation"` BrightnessMax float64 `json:"brightness-max"` ColorDifferenceMean float64 `json:"color-difference-mean"` ColorDifferenceMovingMean []float64 `json:"color-difference-moving-mean"` ColorDifferenceStandardDeviation float64 `json:"color-difference-standard-deviation"` ColorDifferenceMax float64 `json:"color-difference-max"` BinaryThresholdDifferenceMean float64 `json:"binary-threshold-difference-mean"` BinaryThresholdDifferenceMovingMean []float64 `json:"binary-threshold-difference-moving-mean"` BinaryThresholdDifferenceStandardDeviation float64 `json:"binary-threshold-difference-standard-deviation"` BinaryThresholdDifferenceMax float64 `json:"binary-threshold-difference-max"` }
Structure containing frames descriptive statistics values.
func CreateNewFramesStatistics ¶
func CreateNewFramesStatistics(frames []*Frame, movingMeanResolution int) *FramesStatistics
TODO: movingMeanResolution validation > 1
func (*FramesStatistics) ExportCsvReport ¶
func (statistics *FramesStatistics) ExportCsvReport(file io.Writer) error
Write the CSV format statistics report to the provided writer which can be a file reference.
func (*FramesStatistics) ExportJsonReport ¶
func (statistics *FramesStatistics) ExportJsonReport(file io.Writer) error
Write the JSON format statistics report to the provided writer which can be a file reference.