segmentator

package
v0.0.0-...-4e82b2a Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2018 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Gx - Brightness = |Gx|.
	GX = iota
	// Gy - Brightness = |Gy|.
	GY = iota
	// GxGy - Brightness = |Gx| + |Gy|
	GXGY = iota
	// SqrtGxGy - Brightness = sqrt(Gx^2 + Gy^2)
	SQRTGXGY = iota
)

do-parameters for FGEDSobel.

View Source
const (
	// DOMIN - Brightness = Min(Red, Green, Blue).
	DOMIN = iota
	// DOMAX - Brightness = Max(Red, Green, Blue).
	DOMAX = iota
)

do-parameters for GSDecomposition

View Source
const (
	// RED - Brightness = Red
	RED = iota
	// GREEN - Brightness = Green
	GREEN = iota
	// BLUE - Brightness = Blue
	BLUE = iota
)

color-parameters for GSSingleColor

Variables

This section is empty.

Functions

func FGEDCustomOperator

func FGEDCustomOperator(img Image, operator [][]int) (err error)

FGEDCustomOperator uses programmers operator for finding edges.

func FGEDCustomOperators

func FGEDCustomOperators(img Image, GxOp, GyOp [][]int, do int) (err error)

FGEDCustomOperators uses programmers operators for finding Gx and Gy.

func FGEDLaplacian4

func FGEDLaplacian4(img Image) (err error)

FGEDLaplacian4 uses 4-connected Laplacian for finding edges.

func FGEDLaplacian8

func FGEDLaplacian8(img Image) (err error)

FGEDLaplacian8 uses 8-connected Laplacian for finding edges.

func FGEDPrevitt

func FGEDPrevitt(img Image, do int) (err error)

FGEDPrevitt uses Previtt operators for finding Gx and Gy.

func FGEDRoberts

func FGEDRoberts(img Image, do int) (err error)

FGEDRoberts uses Roberts operators for fingding Gx and Gy.

func FGEDScharr

func FGEDScharr(img Image, do int) (err error)

FGEDScharr uses Scharr operators for finding Gx and Gy.

func FGEDSobel

func FGEDSobel(img Image, do int) (err error)

FGEDSobel uses Sobel operators for finding Gx and Gy.

func FGPCIterative

func FGPCIterative(img Image) (threshold int)

FGPCIterative is a simple binarization method.

func FGPCOtsuThresholding2

func FGPCOtsuThresholding2(img Image) (threshold int)

FGPCOtsuThresholding2 uses Otsu method for image binarization.

func FGPCThreshold

func FGPCThreshold(img Image, thresholds []int, colors []Pixel) (err error)

FGPCCustomThreshold uses custom thresholds to segmentate image.

func GSAveraging

func GSAveraging(img Image)

GSAveraging - Brightness = (Red + Green + Blue) / 3.

func GSDecomposition

func GSDecomposition(img Image, do int) (err error)

GSDecomposition - Brightness = Min or Max(Red, Green, Blue).

func GSDesaturation

func GSDesaturation(img Image)

GSDesaturation - Brightness = ( Max(Red, Green, Blue) + Min(Red, Green, Blue) ) / 2.

func GSLuma

func GSLuma(img Image)

GSLuma - Brightness = (Red * 0.2126 + Green * 0.7152 + Blue * 0.0722).

func GSSingleColor

func GSSingleColor(img Image, color int) (err error)

GSSingleColor - Brightness = Red or Green or Blue

func SaveImage

func SaveImage(path, name string, img Image) (err error)

SaveImage saves an image with specified name

Types

type Image

type Image struct {
	Pixels [][]Pixel
	Width  int
	Height int
	Path   string
	Name   string
}

Image contains pixel matrix, name and format of original image.

func LoadImage

func LoadImage(path, name string) (img Image, err error)

LoadImage loads an image with specified name.

type Pixel

type Pixel struct {
	R int
	G int
	B int
	A int
}

Pixel contains RGBA codes.

Jump to

Keyboard shortcuts

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