core

package
v0.0.0-...-1688700 Latest Latest
Warning

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

Go to latest
Published: Dec 25, 2018 License: GPL-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FULLCIRCLE float64 = 360
	HALFCIRCLE float64 = 180
	K          float64 = 8
	PI         float64 = math.Pi
)

Constant

Variables

This section is empty.

Functions

func Blur

func Blur(imgsrc image.Image, radius float64) image.Image

Blur image.

func Divid

func Divid(bounds image.Rectangle, s int) []image.Rectangle

Divid split rectangle into s*s cell.

func DrawLine

func DrawLine(p image.Point, angle float64, length int, imgsrc image.Image, c color.Color) *image.RGBA

DrawLine draw a line in image.

func DrawSquare

func DrawSquare(img image.Image, r image.Rectangle, density int, c color.Color) image.Image

DrawSquare to draw squareline in a given image.

func Ft

func Ft(t float64) float64

Ft function

func Gabor

func Gabor(x, y int, lambda float64) []float64

Gabor filter.

G(θ, λ, ϕ, σ, γ, x,y) = exp(x'^2+(y^2*y'^2)/2σ^2) * exp(i(2PI*x'/ γ + ϕ))
where
	x' = x*cosθ + y*sinθ
	y' = x*sinθ + y*cosθ
	σ  = sigma of gaussian envelope	= Pi
	γ  = gamma spatial aspect ratio	= 1
	ϕ  = phi phase offset			= 0
	θ  = theta angle				= i*Pi/K
	λ  = lambda						> 0.2*img

func GaborFilter

func GaborFilter(imgsrc image.Image, bounds image.Rectangle)

func GaborFilterKernel

func GaborFilterKernel(period, phase, angle float64, size int, imgsrc image.Image) [][]float64

func Gaussian

func Gaussian(x, y int, sigma float64) float64

Gaussian formula.

G(x, y) = (1/2PI*sigma^2)(exp(-x^2+y^2/2sigma^2))

func GaussianBlur

func GaussianBlur(imgsrc image.Image, kernel, radius int) image.Image

GaussianBlur blur image with gauss formula.

func Intensity

func Intensity(rgb RGB) float64

Intensity equation to give the intensity of a pixel (RGB)

func IntensityFeatures

func IntensityFeatures(imgsrc image.Image) image.Image

func Intensityrgb

func Intensityrgb(rgb RGB) (uint8, uint8, uint8)

Intensityrgb equation to give the intensity of a pixel (RGB)

func Magnitude

func Magnitude(x, y float64) float64

Magnitude calculate the magnitude of two points

f(x, y) = sqrt(c^2 + y^2)

func Orientation

func Orientation()

Orientation working on it.

func OrientationXY

func OrientationXY(x, y float64) float64

OrientationXY calculate orientation of two points

f(x, y) = atan2(x, y) * 180 / 3.14 % 360

func RGBChannel

func RGBChannel(imgsrc image.Image, channel string) image.Image

Types

type ImageInfo

type ImageInfo struct {
	Wg sync.WaitGroup
	sync.RWMutex
	Format   string
	Name     string
	Bounds   image.Rectangle
	Scalsize int
	Cellsize int
}

ImageInfo image information.

func NewImageInfo

func NewImageInfo(f, n string, b image.Rectangle, s, c int) *ImageInfo

NewImageInfo return ImageInfo struct.

func (*ImageInfo) Grayscale

func (i *ImageInfo) Grayscale(imgsrc image.Image) image.Image

Grayscale gray scale image

func (*ImageInfo) Save

func (i *ImageInfo) Save(name string, imgsrc image.Image)

Save save image into directory

func (*ImageInfo) Scale

func (i *ImageInfo) Scale(imgsrc image.Image) image.Image

Scale reduce image into i.scalsize defind in ImageInfo.

type Img

type Img struct {
	Image image.Image
	Name  string
}

Img

type LAB

type LAB struct {
	L, A, B float64
}

LAB is CieLab color

func RGBAtoCieLAB

func RGBAtoCieLAB(rgba color.RGBA) LAB

RGBAtoCieLAB convert rgb to CieLAB using https://hrcak.srce.hr/file/193994 page 3/8

func XYZtoCieLAB

func XYZtoCieLAB(xyz XYZ) LAB

XYZtoCieLAB convert xyz to Cie*L*a*b Reference: https://www.mathworks.com/help/images/ref/xyz2lab.html using D65:[0.9504, 1.0000, 1.0888]

type RGB

type RGB struct {
	R, G, B float64
}

RGB color without Alpha

func RGBAtoRGB

func RGBAtoRGB(rgba color.RGBA) RGB

RGBAtoRGB convert rgba to rgb with a black background.

type RGBY

type RGBY struct {
	R, G, B, Y float64
}

RGBY Red, Green, Blue and Yellow color

func RGBtoRGBY

func RGBtoRGBY(rgb RGB) RGBY

RGBtoRGBY Convert RGB to Red, Green, Blue and Yellow

type XYZ

type XYZ struct {
	X, Y, Z float64
}

XYZ is an additive color space based on how the eye intereprets stimulus from light.

func RGBtoXYZ

func RGBtoXYZ(rgb RGB) XYZ

RGBtoXYZ convert rgb to xyz. source sRGB to XYZ: http://cs.haifa.ac.il/hagit/courses/ist/Lectures/Demos/ColorApplet2/t_convert.html

Jump to

Keyboard shortcuts

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