sobel

package
v0.0.10 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2024 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Abs

func Abs(x int) uint32

Abs returns the absolute value of the given int.

func Filter

func Filter(img image.Image, flt FilterType) *image.Gray

func FilterGray

func FilterGray(grayImg *image.Gray, flt FilterType) (filtered *image.Gray)

for better optimization in case of input gray image

func FilterGrayFast

func FilterGrayFast(grayImg *image.Gray, flt FilterType) (filtered *image.Gray)

Benchmark_FilterGray 27336411 ns/op Benchmark_FilterGrayFast 19521755 ns/op for better optimization in case of input gray image

func FilterGrayMath

func FilterGrayMath(grayImg *image.Gray) (filtered *image.Gray)

func FilterGraySimd

func FilterGraySimd(grayImg *image.Gray) (filtered *image.Gray)

BenchmarkIT/Benchmark_FilterGraySimd-2 1032 1499811 ns/op malloc

BenchmarkIT/Benchmark_FilterGraySimd-2 501 2000184 ns/op dstX := make([]uint16, dstSize) dstXC := (*C.uint8_t)(unsafe.Pointer(&dstX[0]))

BenchmarkIT/Benchmark_FilterGraySimd-2 276 4853208 ns/op add flited filling

func FilterMath

func FilterMath(img image.Image, flt FilterType) *image.Gray

func FilterSimd

func FilterSimd(img image.Image, flt FilterType) *image.Gray

func FloorSqrt

func FloorSqrt(x uint32) (ans uint32)

https://www.geeksforgeeks.org/square-root-of-an-integer/ Time Complexity: O(Log x)

func FloorSqrtFast

func FloorSqrtFast(x uint32) (ans uint32)

func ISqrt

func ISqrt(n uint32) (x uint32)

ISqrt returns floor(sqrt(n)). Typical run time is few hundreds of ns. https://gitlab.com/cznic/mathutil/-/blob/master/mathutil.go

func ToGrayscale

func ToGrayscale(img image.Image) *image.Gray

Types

type FilterType

type FilterType int
const (
	Sobel FilterType = iota
	SobelFast
	Laplasian
	Shara
	Sharpen
)

Jump to

Keyboard shortcuts

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