camera

package module
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2021 License: Apache-2.0 Imports: 1 Imported by: 9

README

Golang lib for camera capture

Go Reference Go goreleaser GitHub go.mod Go version of a Go module GoReportCard GitHub license GitHub release

Demo

demo screen capture

Install

go get -u github.com/bububa/camera

Requirements

  • libjpeg-turbo (use -tags jpeg to build without CGo)
  • On Linux/RPi native Go V4L implementation is used to capture images.

Build tags

  • cv4 - build with OpenCV 4.x (gocv)
  • jpeg - build with native Go image/jpeg instead of libjpeg-turbo
  • android - build for Android

Documentation

Overview

Package camera implement different camera devices

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Camera

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

Camera represents camera

func NewCamera

func NewCamera(device Device) *Camera

NewCamera returns new Camera for given device

func (*Camera) Close

func (c *Camera) Close() error

Close to close the camera

func (*Camera) Read

func (c *Camera) Read() (image.Image, error)

Start device start recording

func (*Camera) Start

func (c *Camera) Start() error

Start device start recording

type Device

type Device interface {
	Start() error
	Read() (image.Image, error)
	Close() error
	GetProperty(int) float64
	SetProperty(int, float64)
}

Device defines device interface

type Options

type Options struct {
	// Index device index
	Index int
	// Width frame width
	Width float64
	// Height frame height
	Height float64
	// Delay delay between two frames in milliseconds
	Delay int
}

Options device options

Directories

Path Synopsis
Package image utils.
Package image utils.
Package linux implement linux device
Package linux implement linux device

Jump to

Keyboard shortcuts

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