Documentation
¶
Index ¶
- func ConvertImageToColouring(filename string, outputFilename string, sigma float64, upperThreshold int, ...)
- func DiscreteGaussian(n int, t float64) float64
- func GaussianBlur(img *image.Gray, sigma float64) *image.Gray
- func GaussianBlurColour(img *image.RGBA, sigma float64) *image.RGBA
- func GrayscaleImage(img image.Image) *image.Gray
- func InvertGrayscaleImage(img *image.Gray) *image.Gray
- func KMeansImage(img *image.RGBA, k int) *image.RGBA
- func ModBesselI0(x float64) (ans float64)
- func ModBesselI1(x float64) (ans float64)
- func ModBesselIn(n int, x float64) (ans float64)
- func ModBesselK0(x float64) float64
- func ModBesselK1(x float64) float64
- func ModBesselKn(n int, x float64) float64
- func PixelNonmaxSuppression(ig *ImageGradients, x, y, distance int) bool
- func RgbToGray(c color.RGBA) color.Gray
- func RunColourImageProc(filename string, outputFilename string)
- func RunKMeansImage(filename string, outputFilename string, k int)
- func RunSeparateColourImageProc()
- func SeparateColourSobelFilter(img *image.RGBA) (*ImageGradients, *ImageGradients, *ImageGradients)
- func ThickenLineAtPixel(img *image.Gray, x, y, thickness int, col color.Gray)
- func ThickenLinesByDarkness(src *image.Gray, thickerThreshold uint8, thinnerThreshold uint8) *image.Gray
- type DiscreteGaussianKernel1D
- type GradientDirection
- type HSVA
- type ImageGradients
- func (ig *ImageGradients) BasicThresholdSuppression() *ImageGradients
- func (ig *ImageGradients) FollowEdge(x, y, upper, lower int, accEdges sets.Set[image.Point])
- func (ig *ImageGradients) GrayscaleImage() *image.Gray
- func (ig *ImageGradients) LineFollowingThresholdSuppression(upperThreshold, lowerThreshold int) *ImageGradients
- func (ig *ImageGradients) NeighbourOverThreshold(x, y, thr int) bool
- func (ig *ImageGradients) NonmaxSuppression(distance int) *ImageGradients
- type KMeansClusters
- func (kmc *KMeansClusters) AssignClusterMeanValues(img *image.RGBA) *image.RGBA
- func (kmc *KMeansClusters) AssignClusters(img *image.RGBA)
- func (kmc *KMeansClusters) CalculateMeans(img *image.RGBA)
- func (kmc *KMeansClusters) DistToMean(meanIdx int, px color.RGBA) float64
- func (kmc *KMeansClusters) PartlyRandomiseMeans()
- func (kmc *KMeansClusters) RandomiseMeans()
- type Mean
- type Pixel
- type SobelKernel
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConvertImageToColouring ¶
func DiscreteGaussian ¶
t of Discrete Gaussian is σ² of continuous Gaussian, i.e. the variance (square of standard deviation)
func ModBesselI0 ¶
ModBesselI0 returns the modified Bessel function I0(x) for any real x.
func ModBesselI1 ¶
ModBesselI1 returns the modified Bessel function I1(x) for any real x.
func ModBesselIn ¶
ModBesselIn returns the modified Bessel function In(x) for any real x and n ≥ 0
func ModBesselK0 ¶
ModBesselK0 returns the modified Bessel function K0(x) for positive real x.
Special cases: K0(x=0) = +Inf K0(x<0) = NaN
func ModBesselK1 ¶
ModBesselK1 returns the modified Bessel function K1(x) for positive real x.
Special cases: K0(x=0) = +Inf K0(x<0) = NaN
func ModBesselKn ¶
ModBesselKn returns the modified Bessel function Kn(x) for positive x and n ≥ 0
func PixelNonmaxSuppression ¶
func PixelNonmaxSuppression(ig *ImageGradients, x, y, distance int) bool
Returns True if a pixel should be retained during non-max suppression, and False if it should be discarded.
func RunColourImageProc ¶
[todo] -- add root app CLI options to colour processing
func RunKMeansImage ¶
func RunSeparateColourImageProc ¶
func RunSeparateColourImageProc()
func SeparateColourSobelFilter ¶
func SeparateColourSobelFilter(img *image.RGBA) ( *ImageGradients, *ImageGradients, *ImageGradients)
func ThickenLineAtPixel ¶
Types ¶
type DiscreteGaussianKernel1D ¶
type DiscreteGaussianKernel1D struct { Size int Variance float64 ScalingFactor float64 Elements []float64 }
func CreateDiscreteGaussianKernel ¶
func CreateDiscreteGaussianKernel(sigma float64) *DiscreteGaussianKernel1D
func (DiscreteGaussianKernel1D) String ¶
func (dgk DiscreteGaussianKernel1D) String() string
type GradientDirection ¶
type GradientDirection uint8
func CalcGradientDirection ¶
func CalcGradientDirection(x, y int) GradientDirection
type ImageGradients ¶
type ImageGradients struct { Value [][]int Direction [][]GradientDirection X int Y int }
func ColourSobelFilter ¶
func ColourSobelFilter(img *image.RGBA) *ImageGradients
func CreateImageGradients ¶
func CreateImageGradients(x, y int) *ImageGradients
func SobelFilter ¶
func SobelFilter(img *image.Gray) *ImageGradients
func (*ImageGradients) BasicThresholdSuppression ¶
func (ig *ImageGradients) BasicThresholdSuppression() *ImageGradients
func (*ImageGradients) FollowEdge ¶
func (*ImageGradients) GrayscaleImage ¶
func (ig *ImageGradients) GrayscaleImage() *image.Gray
func (*ImageGradients) LineFollowingThresholdSuppression ¶
func (ig *ImageGradients) LineFollowingThresholdSuppression(upperThreshold, lowerThreshold int) *ImageGradients
func (*ImageGradients) NeighbourOverThreshold ¶
func (ig *ImageGradients) NeighbourOverThreshold(x, y, thr int) bool
func (*ImageGradients) NonmaxSuppression ¶
func (ig *ImageGradients) NonmaxSuppression(distance int) *ImageGradients
type KMeansClusters ¶
func InitKMeans ¶
func InitKMeans(k int) *KMeansClusters
func (*KMeansClusters) AssignClusterMeanValues ¶
func (kmc *KMeansClusters) AssignClusterMeanValues(img *image.RGBA) *image.RGBA
func (*KMeansClusters) AssignClusters ¶
func (kmc *KMeansClusters) AssignClusters(img *image.RGBA)
func (*KMeansClusters) CalculateMeans ¶
func (kmc *KMeansClusters) CalculateMeans(img *image.RGBA)
func (*KMeansClusters) DistToMean ¶
func (kmc *KMeansClusters) DistToMean(meanIdx int, px color.RGBA) float64
func (*KMeansClusters) PartlyRandomiseMeans ¶
func (kmc *KMeansClusters) PartlyRandomiseMeans()
func (*KMeansClusters) RandomiseMeans ¶
func (kmc *KMeansClusters) RandomiseMeans()
type SobelKernel ¶
func CreateSobelKernel ¶
func CreateSobelKernel(dir string) *SobelKernel