filter

package
v0.0.0-...-55f88ab Latest Latest
Warning

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

Go to latest
Published: May 1, 2019 License: AGPL-3.0 Imports: 2 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApplyFilters

func ApplyFilters(frame *gocv.Mat, filters []Filter) error

ApplyFilters Applies a chain of manipulations on a frame. The order of manipulations is the same as the slice. Will stop midway if errors encountered.

func CreateFrames

func CreateFrames(frame gocv.Mat, filters []Filter) ([]gocv.Mat, error)

CreateFrames Applies a slice of Filters, to produce a slice of frames. The order of frames produces has to be the same as the order of input filters. It will not complete if errors in filters will be encountered.

Types

type CvtColor

type CvtColor struct {
	// contains filtered or unexported fields
}

CvtColor implements OpenCV's Color conversion feature

func CreateCvtColorFilter

func CreateCvtColorFilter(convCode gocv.ColorConversionCode) CvtColor

CreateCvtColorFilter creates a filter with color spec

func (CvtColor) Apply

func (cvt CvtColor) Apply(frame *gocv.Mat) error

Apply performs convert on given image

func (CvtColor) Produce

func (cvt CvtColor) Produce(frame gocv.Mat) (gocv.Mat, error)

Produce returns a frame with conversion applied

type Filter

type Filter interface {

	//Produce Responsible for allocating a new frame with manipulations on it
	Produce(gocv.Mat) (gocv.Mat, error)

	//Manipulate Responsible for changing an existing frame
	Apply(*gocv.Mat) error
}

Filter Defines a computation on a frame, that may do either noise removal or something else.

type LineApply

type LineApply struct {
}

LineApply Applies white lines of full height of window when white pixel found

func CreateLineApplyFilter

func CreateLineApplyFilter() LineApply

CreateLineApplyFilter Creates LineApply filter with settings

func (LineApply) Apply

func (la LineApply) Apply(frame *gocv.Mat) error

Apply Applies white lines to frame

func (LineApply) Produce

func (la LineApply) Produce(frame gocv.Mat) (gocv.Mat, error)

Produce Creates new frame with lines applied

type Noise

type Noise struct {
	// contains filtered or unexported fields
}

Noise Removes moving noise pixels, Should ease detection

func CreateNoiseFilter

func CreateNoiseFilter(referenceFrame *gocv.Mat, frameNumber *int) Noise

CreateNoiseFilter Creates noise filter

func (Noise) Apply

func (nf Noise) Apply(frame *gocv.Mat) error

Apply Applies noise reduction to frame

func (Noise) Produce

func (nf Noise) Produce(frame gocv.Mat) (gocv.Mat, error)

Produce Produces new frame with noise reduced

type Subtract

type Subtract struct {
	// contains filtered or unexported fields
}

Subtract Is a background subtractor, used to find movement

func CreateSubtractFilter

func CreateSubtractFilter(region *image.Rectangle) Subtract

CreateSubtractFilter Creates subtract filter with settings

func (Subtract) Apply

func (s Subtract) Apply(frame *gocv.Mat) error

Apply Applies background subtraction to frame

func (Subtract) Produce

func (s Subtract) Produce(frame gocv.Mat) (gocv.Mat, error)

Produce Produces a new frame with background subtracted

type Threshold

type Threshold struct {
	// contains filtered or unexported fields
}

Threshold implements OpenCV's threshold as a filter

func CreateThesholdFilter

func CreateThesholdFilter(thresh float32, maxValue float32, threshType gocv.ThresholdType) Threshold

CreateThesholdFilter returns a configured filter

func (Threshold) Apply

func (thresh Threshold) Apply(frame *gocv.Mat) error

Apply performs thresholding on given frame

func (Threshold) Produce

func (thresh Threshold) Produce(frame gocv.Mat) (gocv.Mat, error)

Produce creates a frame with threshold applied

type Vertical

type Vertical struct {
}

Vertical Finds vertical element of a a frame

func CreateVerticalFilter

func CreateVerticalFilter() Vertical

CreateVerticalFilter Creates a Vertical filter

func (Vertical) Apply

func (vf Vertical) Apply(frame *gocv.Mat) error

Apply Applies vertical element filter to frame

func (Vertical) Produce

func (vf Vertical) Produce(frame gocv.Mat) (gocv.Mat, error)

Produce Produces a frame with vertical line filter applied

Jump to

Keyboard shortcuts

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