Home

User Documentation

Getting Started
Learn More
Explore in Detail
Get Inspired

Contributor Documentation

Getting Started
Learn More
Explore in Detail
Get Inspired

Quick Links

Software Manual
AstroDiscuss
GitHub
API Reference

Documentation Versions


ISIS 2

Documentation
Tutorials
Technical Documents
USGS

ISIS Application Documentation


gauss

Standard View | TOC | Home

Filter a cube through a kernel using Gaussian weight

Description
Categories
Groups
Examples
History


Description

This program calculates weight based on the bell-shaped Gaussian curve. The weight is then applied to an image kernel in such a way as to create a filter that will move a weighted average through the image. The end result is a blurred image with reduced detail and noise. The Gaussian function that determines the weight for all of the values in the kernel is as follows
                                                  /   x^2+y^2   \
                                               - |  -----------  |
                G(x,y) =           1              \ 2(STDDEV)^2 /
      			    --------------- e^
			    2(pi)(STDDEV)^2
  
This formula creates a kernel that then runs through the image. The center of the kernel is at (0,0). This means that a 3x3 boxcar will be of the form
        The kernel coordinates
  (-2,-2) (-1,-2) (0,-2) (1,-2) (2,-2)
  (-2,-1) (-1,-1) (0,-1) (1,-1)	(2,-1)
  (-2, 0) (-1, 0) (0, 0) (1, 0) (2, 0)
  (-2, 1) (-1, 1) (0, 1) (1, 1) (2, 1)
  (-2, 2) (-1, 2) (0, 2) (1, 2) (2, 2)

          The kernel values (approx)
       1   4   7   4   1
       4   16  26  16  4
       7   26  41  26  7     x 1/273
       4   16  26  16  4
       1   4   7   4   1
  

Categories


Related Objects and Documents

Applications


Parameter Groups

Files

Name Description
FROM Input cube to be filtered
TO Output cube

boxcar

Name Description
SIZESize of one side of the boxcar

Standard Deviation

Name Description
STDDEVStandard Deviation

Files: FROM

Description

Use this parameter to select the filename. All bands within the file will be filtered.

Type cube
File Mode input
Filter *.cub

Files: TO

Description

This file will contain the results of the filter, a blurred version of the input file.

Type cube
File Mode output

boxcar: SIZE

Description

This is the user specified size of the boxcar that will move through the image. The boxcar must be square, so the default value of 3 will result in a 3 x 3 boxcar. A value of five would result in a 5 x 5 boxcar moving through the image.

Type integer
Default 3
Odd This value must be an odd number

Standard Deviation: STDDEV

Description

At the most basic level, standard deviation can be thought of in this context as the intensity of the blur being applied to the image. The higher this value, the more noise and detail will be removed. At a deeper level, standard deviation is described as the average distance from any single measurement of a set to the mean of that set.

Type double
Default 1.0
Minimum 0 (exclusive)

Examples


Example 1

Using a 3 x 3 boxcar

Description

This example shows the use of the default standard deviation (1.0) and the default boxcar size (3). Since the boxcar must be square in this program, this means that a 3 x 3 boxcar will be used.

Command Line

gauss from= peaks.cub to=gauss3x3.cub size=3 STDDEV= 1.0
This example uses all of the default values specified by the program

GUI Screenshot

gauss gui

Example GUI

Screenshot of the GUI with parameters set to perform Gaussian smoothing with a 3 x 3 boxcar.

Input Image

The image before the filter

Input image before gauss.

Parameter Name: FROM

This is the image as it was taken originally.

Output Image

The image after the filter

Output image after gauss

Parameter Name: TO

This is the image after the gauss filter. Edges of the image are now much softer. Detail and noise has been removed.


Example 2

Using a 5 x 5 boxcar

Description

This example shows the use of a larger standard deviation (2.0) and the larger boxcar (5). As with the last example, the single value of 5 will be applied to both the line size and sample size of the boxcar.

Command Line

gauss from= peaks.cub to=bigblur.cub size=5 STDDEV= 2.0
This example will create a more dramatic blur, as everything is larger than in the first example

GUI Screenshot

gauss gui

Example GUI

Screenshot of the GUI with parameters set to perform Gaussian smoothing with a 5 x 5 boxcar and 2.0 as the standard deviation.

Input Image

The image before the filter

Input image before gauss.

Parameter Name: FROM

This is the image as it was taken originally.

Output Image

The image after the filter

Output image after gauss

Parameter Name: TO

This is the image after the gauss filter. Edges of the image are now much softer. The blur is much more noticeable on account both of the larger boxcar and the larger standard deviation.


History

Drew Davidson2004-08-05 Original version
Drew Davidson2004-08-06 Added application test
Drew Davidson2004-08-16 Added examples
Drew Davidson2005-06-27 Fixed bug in boxcar size
Brendan George2006-09-21 Documentation fixes
Kaitlyn Lee2018-02-15 Removed the cout that was outputting e to the terminal. Fixes #5198.