transform

package
v0.0.0-...-be438f9 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ThreeByThree = []IJ{
	{0, 0}, {0, 1}, {0, 2},
	{1, 0}, {1, 1}, {1, 2},
	{2, 0}, {2, 1}, {2, 2},
}

ThreeByThree static iteration of nested 3x3

Functions

func ApplySigmoid

func ApplySigmoid(img *image.Gray, cfg *EdgeDetectConfig) (newImg *image.RGBA)

func DetectEdge

func DetectEdge(img *image.Gray) *image.Gray

DetectEdge for edge detection

func GetHist

func GetHist(img *image.Gray, cfg *EdgeDetectConfig) (newImg *image.RGBA)

func ImageToGray

func ImageToGray(img *image.RGBA) (newImage *image.Gray)

ImageToGray converts an RGBA image to Gray

Types

type EdgeDetectConfig

type EdgeDetectConfig struct {
	// Reg, Green, Blue factors for adjusting luminance
	RedFactor   float64
	GreenFactor float64
	BlueFactor  float64

	F         float64
	S         float64
	Tx        bool // set background to transparent?
	ShowAngle bool
}

func DefaultEdgeDetectConfig

func DefaultEdgeDetectConfig() *EdgeDetectConfig

type IJ

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

IJ because it is i,j

type MyKernel

type MyKernel [3][3]float64

MyKernel -- small matrix for convolving with the image to detect edges

var Gx MyKernel = [3][3]float64{
	{-1.0, 0.0, 1.0},
	{-2.0, 0.0, 2.0},
	{-1.0, 0.0, 1.0}}

Gx Horizontal Kernel var Gx Kernel = [3][3]int{{-1, 0, 1}, {-2, 0, 2}, {-1, 0, 1}}

var Gy MyKernel = [3][3]float64{
	{+1.0, +2.0, +1.0},
	{+0.0, +0.0, +0.0},
	{-1.0, -2.0, -1.0}}

Gy Vertical Kernel var Gy Kernel = [3][3]int{{1, 2, 1}, {0, 0, 0}, {-1, -2, -1}}

type Stats

type Stats struct {
	MaxCount      uint8
	HighestLumins uint8
	// contains filtered or unexported fields
}

func GrayScaleStats

func GrayScaleStats(img *image.Gray) (stats *Stats)

func NewStats

func NewStats() (s *Stats)

func (*Stats) Bump

func (s *Stats) Bump(y uint8)

func (*Stats) Histogram

func (s *Stats) Histogram(cfg *EdgeDetectConfig) (img *image.RGBA)

Jump to

Keyboard shortcuts

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