Documentation ¶
Index ¶
- type BinaryImage
- func (bi BinaryImage) At(x, y int) color.Color
- func (bi BinaryImage) Bounds() image.Rectangle
- func (bi BinaryImage) Clone() (clone BinaryImage)
- func (bi BinaryImage) ColorModel() color.Model
- func (bi BinaryImage) Invert()
- func (bi BinaryImage) Set(x, y int, c color.Color)
- func (bi BinaryImage) SetBinary(x, y int, color bool)
- type ColorImage
- func (i ColorImage) At(x, y int) color.Color
- func (i ColorImage) Bounds() image.Rectangle
- func (i ColorImage) ColorModel() color.Model
- func (i ColorImage) ConcatBottom(ci ColorImage) ColorImage
- func (i ColorImage) ConcatRight(ci ColorImage) ColorImage
- func (i ColorImage) Contract(scale float64, offset float64) (ci ColorImage)
- func (i ColorImage) Set(x, y int, c color.Color)
- func (i ColorImage) WithCols(start, end int) ColorImage
- func (i ColorImage) WithRows(start, end int) ColorImage
- type Evaluation
- type FilterOptions
- type FilterType
- type GrayImage
- func (gi GrayImage) At(x, y int) color.Color
- func (gi GrayImage) AtGray(x, y int) uint8
- func (gi GrayImage) Bounds() image.Rectangle
- func (gi GrayImage) Clone() (i GrayImage)
- func (gi GrayImage) ColorModel() color.Model
- func (i GrayImage) Contract(scale float64, offset float64) (gi GrayImage)
- func (gi GrayImage) Filter(ft FilterType, fo *FilterOptions) (i GrayImage)
- func (gi GrayImage) Select(min, max uint8) GrayImage
- func (gi GrayImage) Set(x, y int, c color.Color)
- func (gi GrayImage) SetGray(x, y int, gray uint8)
- type Histogram
- type RGBAScanner
- type Scanner
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BinaryImage ¶
type BinaryImage [][]bool
BinaryImage is an image with logical values
func NewBinary ¶
func NewBinary(img image.Image, div uint8) BinaryImage
NewBinary builds a binary image from an image.Image
func NewBinaryImage ¶
func NewBinaryImage(img GrayImage, div uint8) BinaryImage
NewBinaryImage returns a BinaryImage with img's size if the color is greater than div, it's set up to true
func (BinaryImage) At ¶
func (bi BinaryImage) At(x, y int) color.Color
At returns the related Color to the x,y position
func (BinaryImage) Bounds ¶
func (bi BinaryImage) Bounds() image.Rectangle
Bounds returns the size of the binary image
func (BinaryImage) Clone ¶
func (bi BinaryImage) Clone() (clone BinaryImage)
Clone returns a new instance of the binary image itself
func (BinaryImage) ColorModel ¶
func (bi BinaryImage) ColorModel() color.Model
ColorModel returns the model of color used in BinaryImage
func (BinaryImage) Invert ¶
func (bi BinaryImage) Invert()
func (BinaryImage) Set ¶
func (bi BinaryImage) Set(x, y int, c color.Color)
Set wheter a black or white color into the image
func (BinaryImage) SetBinary ¶
func (bi BinaryImage) SetBinary(x, y int, color bool)
SetBinary is a convenience method to set directly a logical value
type ColorImage ¶
ColorImage describes a RGBA image which implements draw.Image
func Add ¶
func Add(base, addition draw.Image) (dest ColorImage)
Add sums an addition into an base image and returns the result in other image.
func Blue ¶
func Blue(img draw.Image) ColorImage
Blue remove red and green channels from the image and returns a new RGBA image with the result
func Green ¶
func Green(img draw.Image) ColorImage
Green remove red and blue channels from the image and returns a new RGBA image with the result
func NewColorFromImage ¶
func NewColorFromImage(img image.Image) ColorImage
NewColorFromImage recieves an image and returns a drawable RGBA image
func NewEmptyImage ¶
func NewEmptyImage(borders image.Rectangle) ColorImage
NewEmptyImage creates a rbga image which size is equal to img
func Red ¶
func Red(img draw.Image) ColorImage
Red remove blue and green channels from the image and returns a new RGBA image with the result
func (ColorImage) At ¶
func (i ColorImage) At(x, y int) color.Color
At returns a color in the position [x][y].
func (ColorImage) Bounds ¶
func (i ColorImage) Bounds() image.Rectangle
Bounds returns the size of the image
func (ColorImage) ColorModel ¶
func (i ColorImage) ColorModel() color.Model
ColorModel returns the color model used by this implementation
func (ColorImage) ConcatBottom ¶
func (i ColorImage) ConcatBottom(ci ColorImage) ColorImage
ConcatBottom expects a same-width image to concat at the bottom of i the result of the concatenation is returned
func (ColorImage) ConcatRight ¶
func (i ColorImage) ConcatRight(ci ColorImage) ColorImage
ConcatRight expects a same-heigth image to concat at the left of i the result of the concatenation is returned
func (ColorImage) Contract ¶
func (i ColorImage) Contract(scale float64, offset float64) (ci ColorImage)
Contract scales the color of the actual image to a specified range
func (ColorImage) Set ¶
func (i ColorImage) Set(x, y int, c color.Color)
Set a color into the position [x][y]
func (ColorImage) WithCols ¶
func (i ColorImage) WithCols(start, end int) ColorImage
WithCols slices the columns of an image and return the segment into another image
func (ColorImage) WithRows ¶
func (i ColorImage) WithRows(start, end int) ColorImage
WithRows slices the rows of an image and return the segment into another image
type Evaluation ¶
type FilterOptions ¶
FilterOptions defines options for a filter to apply
type FilterType ¶
type FilterType int
FilterType defines a kind of filter applied to an image
const ( //SaltAndPepper is the Salt & Pepper filter SaltAndPepper FilterType = 1 //Average filter applies an average filter for each pixel on the image Average FilterType = 2 //ArithmeticMean filter ArithmeticMean FilterType = 3 //HarmonicMean filter HarmonicMean FilterType = 4 //ContraharmonicMean filter ContraharmonicMean FilterType = 5 //Fashion filter Fashion FilterType = 6 //Minimum filter Minimum FilterType = 7 //Maximum filter Maximum FilterType = 8 )
func (FilterType) String ¶
func (ft FilterType) String() string
type GrayImage ¶
GrayImage describes a grayscale image which implements draw.Image
func NewEmptyGrayImage ¶
NewEmptyGrayImage creates an grayscale image with a size equals to the recieved Rectangle
func NewGrayImage ¶
NewGrayImage recieves an image and returns a drawable grayscale image
func (GrayImage) ColorModel ¶
ColorModel returns the color model used by this implementation
func (GrayImage) Filter ¶
func (gi GrayImage) Filter(ft FilterType, fo *FilterOptions) (i GrayImage)
Filter applies a filter to an image, with the options received
func (GrayImage) Select ¶
Select takes all the values inside gi between min and max inclusive and returns the result
type Histogram ¶
Histogram represents the occurrence of a level of color into an image.
func GetHistogram ¶
GetHistogram creates an histogram per channel, which counts the occurrences of a color
type RGBAScanner ¶
type RGBAScanner struct {
// contains filtered or unexported fields
}
func NewRGBAScanner ¶
func NewRGBAScanner(i image.Image, ev Evaluation) *RGBAScanner
func (*RGBAScanner) DrawObjects ¶
func (s *RGBAScanner) DrawObjects(c color.Color) (ci ColorImage)
DrawObjects draw each object found in a specified color inside ci
func (*RGBAScanner) Filter ¶
func (s *RGBAScanner) Filter(minSz int) int
Filter discarts from the object set, those which size is less than minSz
func (*RGBAScanner) SearchObjects ¶
func (s *RGBAScanner) SearchObjects() int
SearchObjects count the objects found in the image and save them for later use
type Scanner ¶
type Scanner struct {
// contains filtered or unexported fields
}
Scanner finds objects in a binary image.
func (*Scanner) DrawObjects ¶
func (s *Scanner) DrawObjects() (ci ColorImage)
DrawObjects draw each object found in a random color inside ci
func (*Scanner) SearchObjects ¶
SearchObjects count the objects found in the image and save them for later use