stretch

package
v0.2.6 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2023 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApplyUnsharpMask

func ApplyUnsharpMask(res, data, blurred []float32, gain float32, min, max, absThreshold float32)

Applies unsharp mask to 2D image given bz data and width, using provided radius for Gauss filter and gain for combination. Results are clipped to min..max. Pixels below the threshold are left unchanged. Overwrites tmp, and returns the result in res

func Convolve1DX

func Convolve1DX(res, data []float32, width int, kernel []float32)

Convolve the given 2D image provided by data and with with the given convolution kernel along the x axis, and store the result in res

func Convolve1DY

func Convolve1DY(res, data []float32, width int, kernel []float32)

Convolve the given 2D image provided by data and with with the given convolution kernel along the y axis, and store the result in res

func GaussFilter2D

func GaussFilter2D(res, tmp, data []float32, width int, sigma float32)

Generate a convolution kernel for a 2D gauss filter of given standard deviation, and applies it to the 2D image given by data and width. Overwrites tmp and returns the result in res.

func GaussianDefiniteIntegral

func GaussianDefiniteIntegral(mu, sigma, x float32) float32

Returns the definite integral of the gaussian function with midpoint mu and standard deviation sigma for input x

func GaussianKernel1D

func GaussianKernel1D(sigma float32) (kernel []float32)

Generates a 1D gaussian kernel for the given sigma. Based on symbolic integration via error function

func UnsharpMask

func UnsharpMask(data []float32, width int, sigma float32, gain float32, min, max, absThreshold float32) []float32

Applies unsharp mask to 2D image given bz data and width, using provided radius for Gauss filter and gain for combination. Results are clipped to min..max. Pixels below the threshold are left unchanged. Returns results in a newly allocated array

Types

type OpGamma

type OpGamma struct {
	ops.OpUnaryBase
	Gamma float32 `json:"gamma"`
}

func NewOpGamma

func NewOpGamma(gamma float32) *OpGamma

func NewOpGammaDefault

func NewOpGammaDefault() *OpGamma

func (*OpGamma) Apply

func (op *OpGamma) Apply(f *fits.Image, c *ops.Context) (result *fits.Image, err error)

func (*OpGamma) UnmarshalJSON

func (op *OpGamma) UnmarshalJSON(data []byte) error

Unmarshal the type from JSON with default values for missing entries

type OpGammaPP

type OpGammaPP struct {
	ops.OpUnaryBase
	Gamma float32 `json:"gamma"`
	Sigma float32 `json:"sigma"`
}

func NewOpGammaPP

func NewOpGammaPP(gamma, sigma float32) *OpGammaPP

func NewOpGammaPPDefault

func NewOpGammaPPDefault() *OpGammaPP

func (*OpGammaPP) Apply

func (op *OpGammaPP) Apply(f *fits.Image, c *ops.Context) (result *fits.Image, err error)

func (*OpGammaPP) UnmarshalJSON

func (op *OpGammaPP) UnmarshalJSON(data []byte) error

Unmarshal the type from JSON with default values for missing entries

type OpMidtones

type OpMidtones struct {
	ops.OpUnaryBase
	Mid   float32 `json:"mid"`
	Black float32 `json:"black"`
}

func NewOpMidtones

func NewOpMidtones(mid, black float32) *OpMidtones

func NewOpMidtonesDefault

func NewOpMidtonesDefault() *OpMidtones

func (*OpMidtones) Apply

func (op *OpMidtones) Apply(f *fits.Image, c *ops.Context) (result *fits.Image, err error)

func (*OpMidtones) UnmarshalJSON

func (op *OpMidtones) UnmarshalJSON(data []byte) error

Unmarshal the type from JSON with default values for missing entries

type OpNormalizeRange

type OpNormalizeRange struct {
	ops.OpUnaryBase
}

Normalizes the image range to [0, 1]. Takes one input, produces one output

func NewOpNormalizeRange

func NewOpNormalizeRange() *OpNormalizeRange

func NewOpNormalizeRangeDefault

func NewOpNormalizeRangeDefault() *OpNormalizeRange

func (*OpNormalizeRange) Apply

func (op *OpNormalizeRange) Apply(f *fits.Image, c *ops.Context) (result *fits.Image, err error)

func (*OpNormalizeRange) UnmarshalJSON

func (op *OpNormalizeRange) UnmarshalJSON(data []byte) error

Unmarshal the type from JSON with default values for missing entries

type OpScaleBlack

type OpScaleBlack struct {
	ops.OpUnaryBase
	Location float32 `json:"location"`
}

func NewOpScaleBlack

func NewOpScaleBlack(location float32) *OpScaleBlack

func NewOpScaleBlackDefault

func NewOpScaleBlackDefault() *OpScaleBlack

func (*OpScaleBlack) Apply

func (op *OpScaleBlack) Apply(f *fits.Image, c *ops.Context) (result *fits.Image, err error)

func (*OpScaleBlack) UnmarshalJSON

func (op *OpScaleBlack) UnmarshalJSON(data []byte) error

Unmarshal the type from JSON with default values for missing entries

type OpStretchIterative

type OpStretchIterative struct {
	ops.OpUnaryBase
	Location float32 `json:"location"`
	Scale    float32 `json:"scale"`
}

func NewOpStretchIterative

func NewOpStretchIterative(loc float32, scale float32) *OpStretchIterative

must be called /100

func NewOpStretchIterativeDefault

func NewOpStretchIterativeDefault() *OpStretchIterative

func (*OpStretchIterative) Apply

func (op *OpStretchIterative) Apply(f *fits.Image, c *ops.Context) (result *fits.Image, err error)

func (*OpStretchIterative) UnmarshalJSON

func (op *OpStretchIterative) UnmarshalJSON(data []byte) error

Unmarshal the type from JSON with default values for missing entries

type OpUnsharpMask

type OpUnsharpMask struct {
	ops.OpUnaryBase
	Sigma     float32 `json:"sigma"`
	Gain      float32 `json:"gain"`
	Threshold float32 `json:"threshold"`
}

func NewOpUnsharpMask

func NewOpUnsharpMask(sigma, gain, threshold float32) *OpUnsharpMask

func NewOpUnsharpMaskDefault

func NewOpUnsharpMaskDefault() *OpUnsharpMask

func (*OpUnsharpMask) Apply

func (op *OpUnsharpMask) Apply(f *fits.Image, c *ops.Context) (result *fits.Image, err error)

func (*OpUnsharpMask) UnmarshalJSON

func (op *OpUnsharpMask) UnmarshalJSON(data []byte) error

Unmarshal the type from JSON with default values for missing entries

Jump to

Keyboard shortcuts

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