Official websites use .gov
A .gov website belongs to an official government organization in the United States.

Secure .gov websites use HTTPS
A lock ( ) or https:// means you’ve safely connected to the .gov website. Share sensitive information only on official, secure websites.

ISIS Documentation

kuwahara

Filter a cube, smoothing but preserving edges

Kuwahara is a edge preserving smoothing filter. This is accomplished through examining the four quadrants surrounding a pixel, selecting the one with the smallest variance, and using its average as the resultant pixel value. In the case where two or more variances are equivalent, the average from the first quadrant encountered with an equivalent variance will be used.

Categories


History

Mackenzie Boyd2009-05-19 Original version
Mackenzie Boyd2009-05-20 Added examples, test
Mackenzie Boyd2009-06-04 Fixed images in documentation
Mackenzie Boyd2009-06-09 Made ostruthdata for samson only to handle problem with rounding errors

Parameters

Files

Use this parameter to select the input cube. All bands within the file will be filtered.
Type cube
File Mode input
Filter *.cub

This file will contain the results of the filter.
Type cube
File Mode output
Filter *.cub

Boxcar size

This parameter sets the width, or number of samples, to have the filter process. This must be an odd number. The larger this is the larger the details that will be smoothed. A wide and short filter will do mostly horizantal smoothing, a tall and narrow filter mostly vertical.
Type integer
Default 5
Minimum 1 (inclusive)
Odd This value must be an odd number

This parameter sets the number of lines to be processed by the filter. This must be an odd number. Larger sizes will smooth larger features. A wide and short filter will do mostly horizantal smoothing, a tall and narrow filter mostly vertical.
Type integer
Default 5
Minimum 1 (inclusive)
Odd This value must be an odd number

Example 1

Example of usage of the kuwahara filter to smooth and perserve edges.

Kuwahara filter is put to use here, smoothing while preserving edges. Here is a image which shows the exact quadrants used in a 5x5. Each quadrant is then a 3x3 with some overlap on the next.
          
        

Command Line

This example will filter the image using a 5x5 boxcar with subunit size of 3x3. The size in this case is unnecessray since 5 is default, but for other sizes a different, odd numbed, could be placed there.
kuwahara from=peaks.cub to=smooth.cub samples=5 lines=5

GUI Screenshot

kuwahara gui

Example GUI

kuwahara gui

Screenshot of the GUI with parameters set to perform the kuwahara filter with a 5x5 boxcar on the image peaks.cub.

Input Image

The image before the filter

Input image before kuwahara filter

The image before the filter

Parameter Name: FROM

This is the image as it was taken originally.

Output Image

The image after the filter

Output image after being smoother by kuwahara filter.

The image after the filter

Parameter Name: TO

As you can observe, the image has been smoothed, but still retains the edges present in the original image.