opencvl

package module
v0.0.0-...-2c6a140 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2021 License: MIT Imports: 7 Imported by: 0

README

opencvl

A pipeline-based system for layering OpenCV and OpenCL image transforms.

Unit Tests

Use the videos flag to run the tests with videos! This generates the mandelbrot and burning ship sets with some zooming! There are also benchmarks for each.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Layer

type Layer interface {
	Type() string
	// contains filtered or unexported methods
}

Layer is a layer of an OpenCVL pipeline

func NewOpenCLLayer

func NewOpenCLLayer(program string, kernelName string, platform, device int) (Layer, error)

NewOpenCLLayer creates a new OpenCL layer

func NewOpenCVLayer

func NewOpenCVLayer(process func(mat gocv.Mat, args ...interface{}) gocv.Mat) Layer

NewOpenCVLayer creates a new opencv layer, given the process function

type Pipeline

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

Pipeline contains all necessary data for a opencvl pipeline

func BlurPipeline

func BlurPipeline(xblur, yblur int) Pipeline

BlurPipeline performs a gaussian blur, given the magnitude of the blur on the x and y axis

func HSLCorrectPipeline

func HSLCorrectPipeline(hchange, schange, lchange float64) Pipeline

HSLCorrectPipeline does an HSL color correction pipeline

func InvertPipeline

func InvertPipeline() Pipeline

InvertPipeline inverts an image

func NewPipeline

func NewPipeline() Pipeline

NewPipeline creates a new Pipeline

func RotatePipeline

func RotatePipeline(x, y int, rotation float64) Pipeline

RotatePipeline rotates an image

func TranslatePipeline

func TranslatePipeline(xchange, ychange int) (Pipeline, error)

TranslatePipeline translates an image

func (*Pipeline) AddLayer

func (p *Pipeline) AddLayer(layer Layer) error

AddLayer adds a layer to a pipeline

func (*Pipeline) AddPipeline

func (p *Pipeline) AddPipeline(pipeline Pipeline) error

AddPipeline allows you to add a pipeline inside of another pipeline

func (*Pipeline) Build

func (p *Pipeline) Build() error

Build compiles the pipeline

func (*Pipeline) Cleanup

func (p *Pipeline) Cleanup()

Cleanup cleans up the arguments (only applies to OpenCL layers)

func (*Pipeline) ExecuteOnImage

func (p *Pipeline) ExecuteOnImage(img *image.RGBA, timeDat ...int) (*image.RGBA, error)

ExecuteOnImage executes the pipeline on an image

func (*Pipeline) ExecuteOnVideo

func (p *Pipeline) ExecuteOnVideo(file string, outFile string) error

ExecuteOnVideo executes the pipeline on every frame of a video and encodes it into a new video

func (*Pipeline) SetOpenCLArgs

func (p *Pipeline) SetOpenCLArgs(args ...interface{}) error

SetOpenCLArgs sets the arguments for all OpenCL layers

func (*Pipeline) SetOpenCVArgs

func (p *Pipeline) SetOpenCVArgs(args ...interface{})

SetOpenCVArgs sets the arguments for all OpenCV layers

Jump to

Keyboard shortcuts

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