Skip to content

Smoothing Spatial Filter

Jeet edited this page Jul 28, 2022 · 1 revision

Command Line

Original image:

Original Image

5x5 uniform mask:

$~/go/bin/loomis -command smooth_spatial -i testdata/green-bee-eater-grayscale.jpg

Only 5x5 uniform mask is supported by command line at the moment

5x5 uniform mask

3x3 weighted mask:

3x3 weighted mask

Library Usage

newImage := pkg.SmoothingSpatialFilter(image, pkg.ThreeByThreeWeighted)

image is of type image.Image
second argument is a mask (samples below)

Masks:

3x3 uniform mask - ThreeByThreeUniform

Pixel Values Cell
1 1 1
1 1 1
1 1 1

5x5 uniform mask - FiveByFiveUniform

Pixel Values Cell Values Cell
1 1 1 1 1
1 1 1 1 1
1 1 1 1 1
1 1 1 1 1
1 1 1 1 1

3x3 weighted mask - ThreeByThreeWeighted

Pixel Values Cell
1 2 1
2 4 2
1 2 1

Clone this wiki locally