vision

package module
v0.0.0-...-960f649 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2015 License: BSD-3-Clause Imports: 6 Imported by: 2

README

go-vision GoSearch

Computer vision related functions in Go.

Documentation

Overview

Package vision provides some basic operation on computer vision.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ImageFromFile

func ImageFromFile(fn string) (image.Image, error)

func SaveImageAsPng

func SaveImageAsPng(m image.Image, fn string) error

Types

type GrayImage

type GrayImage struct {
	Size
	Pixels []byte
}

func (*GrayImage) AsImage

func (m *GrayImage) AsImage() image.Image

AsImage returns an image.Image representing the current GrayImage

func (GrayImage) Fill

func (m GrayImage) Fill(vl byte)

Fills assigns all pixels of the image by a value.

func (*GrayImage) LoadFromFile

func (m *GrayImage) LoadFromFile(fn string) error

LoadFromFile sets the contents of the image from an image file.

func (*GrayImage) Resize

func (m *GrayImage) Resize(sz Size)

Resize sets the size of the GrayImage to a specific value. Pixels is also updated accordingly.

func (*GrayImage) SetImage

func (m *GrayImage) SetImage(img image.Image)

SetImage sets the contents of the GrayImage from an image.Image.

func (*GrayImage) String

func (m *GrayImage) String() string

type IntGrayImage

type IntGrayImage struct {
	Size
	Pixels []int
}

IntGrayImage represents a gray image with each element an int.

func (IntGrayImage) Fill

func (m IntGrayImage) Fill(vl int)

Fills assigns all pixels of the image by a value.

func (*IntGrayImage) Resize

func (m *IntGrayImage) Resize(sz Size)

Resize sets the size of the image to a specific value. Pixels is also updated accordingly.

type IntRGB

type IntRGB [3]int

type RGB

type RGB [3]byte

type RGBImage

type RGBImage struct {
	Size
	Pixels []RGB
}

func (RGBImage) AsImage

func (m RGBImage) AsImage() image.Image

AsImage returns an image.Image representing the current RGBImage

func (RGBImage) Fill

func (m RGBImage) Fill(vl RGB)

Fills assigns all pixels of the image by a value.

func (*RGBImage) LoadFromFile

func (m *RGBImage) LoadFromFile(fn string) error

LoadFromFile sets the contents of the image from an image file.

func (*RGBImage) Resize

func (m *RGBImage) Resize(sz Size)

Resize sets the size of the RGBImage to a specific value. Pixels is also updated accordingly.

func (*RGBImage) SetImage

func (m *RGBImage) SetImage(img image.Image)

SetImage sets the contents of the RGBImage from an image.Image.

type Size

type Size struct {
	Width  int
	Height int
}

func (Size) Area

func (sz Size) Area() int

Jump to

Keyboard shortcuts

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