Package References

General function

ImageSmooth.SmoothAPI.smoothFunction
smooth(img, fₛ::AbstractImageSmoothAlgorithm, args...; kwargs...)

Smooth img using algorithm fₛ

Output

The return image imgₛ is an Array{Gray{N0f8}} forGrayimage, andArray{RGB{N0f8}}forRGB` image.

Examples

Just simply pass the input image and algorithm to smooth

fₛ = L0Smooth()

imgₛ = smooth(img, fₛ)

This reads as "smooth image img using smoothing algorithm fₛ".

See also smooth! for in-place smoothing.

source
ImageSmooth.SmoothAPI.smooth!Function
smooth!(out::GenericImage, img::GenericImage, fₛ::AbstractImageSmoothAlgorithm, args...; kwargs...)

Smooth img::GenericImage using algorithm fₛ

Output

out will be changed in place.

Examples

Just simply pass an algorithm to smooth!:

# First generate an algorithm instance
fₛ = L0Smooth()

## For Gray or RGB images
imgₛ = similar(img)

smooth!(imgₛ, img, fₛ)

See also: smooth

source

Algorithm

ImageSmooth.SmoothAPI.AbstractImageSmoothAlgorithmType
AbstractImageSmoothAlgorithm <: AbstractImageFilter

The root type for ImageSmooth package.

Any image smoothing algorithm shall subtype it to support smooth and smooth! APIs.

Examples

All algorithm in ImageSmooth are called in the following pattern, take L0Smooth <: AbstractImageSmoothAlgorithm as an example:

# First generate an algorithm instance
fₛ = L0Smooth()

# Then pass the algorithm to `smooth`
imgₛ = smooth(img, fₛ)

# Or use in-place version `smooth!`
imgₛ = similar(img)

smooth!(imgₛ, img, fₛ)

Some algorithms also receive parameters to control the smoothing process and to get an expected smooth degree.

# You could explicit specify it
f = L0Smooth(λ=0.04, κ=1.5, βmax=1e6)

# Or infer the default value
f = L0Smooth()

For more examples, please check smooth and smooth! and concret algorithms.

source