Documentation
¶
Overview ¶
Image Layer Decomposition in pure Go
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type LayerBuilder ¶
type LayerBuilder struct {
InputImage image.Image
Rgb rgb32
Lab lab32
Clusters labelImage
SuperPixels []superpixel
LLEWeightMatrix *mat.Dense
L *mat.Dense
PixelWeights []float64
Palette []colorful.Color
}
func NewLayerBuilder ¶
func NewLayerBuilder(input image.Image, palette []colorful.Color) *LayerBuilder
func (*LayerBuilder) Build ¶
func (lb *LayerBuilder) Build(opt Options)
func (*LayerBuilder) GrayLayers ¶
func (lb *LayerBuilder) GrayLayers() []*image.Gray
func (*LayerBuilder) RGBALayers ¶
func (lb *LayerBuilder) RGBALayers() []*image.NRGBA
func (*LayerBuilder) Reconstruct ¶
func (lb *LayerBuilder) Reconstruct(grayLayers []*image.Gray) *image.RGBA
type Options ¶
type Options struct {
// Number of SLIC regions.
// Image-size dependent: larger images usually need higher values.
// Ideal start: ~area/(40^2) (roughly 300-1200 for common inputs).
// Too low => larger regions => blockier alpha transitions.
NumSuperpixels int
// Neighbor count for superpixel manifold graph W.
// Ideal start: 24-40.
// Too low can over-localize layers; too high can over-smooth boundaries.
LLENeighbors int
// Per-pixel interpolation neighbors from superpixels. Most direct blockiness control:
// lower values (especially 1-4) can create visible region boundaries.
// Ideal start: 12-20.
PixelNeighbors int
// Manifold smoothness weight in solveFullSystem.
// Ideal start: 0.18-0.30. Lower => weaker cross-region smoothing.
Lm float64
// Reconstruction weight in solveFullSystem.
// Ideal start: ~1.0 (0.8-1.2). Lower => weaker color fitting, more seed-like alphas.
Lr float64
// Alpha magnitude regularization.
// Ideal start: 0.01-0.03. Higher pushes alphas toward 0 and can produce sparse blobs.
Lu float64
}
func DefaultOptions ¶
func DefaultOptions() Options
func OptionsFromSize ¶
Click to show internal directories.
Click to hide internal directories.
