fisheye

package
v0.0.0-...-5672997 Latest Latest
Warning

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

Go to latest
Published: May 25, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrDetectDistance = errors.New("fisheye: can not detect distance")
)

Functions

func ApplyFishEye

func ApplyFishEye(dest draw.Image, src image.Image, distance int) draw.Image

ApplyFishEye applies the fish eye effect to the image.

func FindDistance

func FindDistance(src image.Image, testRowIndex int) (image.Image, int)

FindDistance finds the distance of the fish eye effect.

func GenFile

func GenFile(path string, testRowIndex int) (image.Image, error)

func MakeNoise

func MakeNoise(img image.Image, distance int, factory func() draw.Image) draw.Image

MakeNoise applies the fish eye effect to the image, and then tries to remove the fish eye effect from the image.

The image will be used as the input for training the model.

func RemoveFishEye

func RemoveFishEye(dest draw.Image, src image.Image, distance int) draw.Image

RemoveFishEye try to remove the fish eye effect from the image. The image still be loss some pixels at the center

func WhitePoints

func WhitePoints(src image.Image, y int) int

WhitePoints returns the number of white points at the y-axis.

Types

type FisheyePreprocessor

type FisheyePreprocessor struct {
	TestRowIndex int
}

func NewPreprocessor

func NewPreprocessor() *FisheyePreprocessor

func (*FisheyePreprocessor) Transform

func (p *FisheyePreprocessor) Transform(_ context.Context, img image.Image) (image.Image, error)

Transform implements the Preprocessor interface.

Jump to

Keyboard shortcuts

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