Home

Quick Links

Software Manual
GitHub
API Reference

Documentation Versions

Public Release
8.3.0
8.2.0
8.1.0
8.0.0
7.2.0
7.1.0
7.0.0
6.0.0
3.9.0
3.5.0
USGS

ISIS Application Documentation


minmax

Printer Friendly View | TOC | Home

Apply a minimum or maximum filter to a cube

Overview Parameters Example 1 Example 2

Description

This program will apply a minimum or maximum filter to a cube. Using the "max" option, the pixel with the highest DN in the NxM size boxcar will be output. Using the "min" option, the pixel with the lowest DN in the NxM boxcar will be output. With either option, more extreme DNs will be more noticeable in the output image.

The boxcar will be N samples long by M lines high. Assuming a 3 x 3 boxcar
    		V1  V2  V3
		V4  V5  V6
		V7  V8  V9
    
the program will first substitute an extremely high or low internal value for ISIS. This essentially zeroes out the process in such a way that one of the values in the current boxcar will be supplied as the output pixel, instead of an output pixel from a previous boxcar. Assume that the MAX option is being used on the model boxcar shown above.This value is then compared to the first pixel in the boxcar. This would be the value substituted for "V1". If V1 is greater than the internal value (this will be the case unless V1 is a special pixel) then the new output pixel will tenatively be set to V1. V1 is then compared to V2, and the greater pixel is again set to the temporary maximum. This process continues until the temporary maximum is compared to all of the values in the boxcar, at which point it is set as the output value.

Categories


History

Drew Davidson2004-07-23 Original version
Drew Davidson2004-07-26 Added application test
Drew Davidson2004-08-16 Added examples

Parameter Groups

Files

Name Description
FROM Input cube
TO Output cube

Boxcar Size

Name Description
LINES Boxcar Lines
SAMPLES Boxcar Samples

Filter Type

Name Description
FILTERType of filter (minimum, maximum)
X

Files: FROM


Description

Use this parameter to select the filename. All bands within the file will have the filter applied.

Type cube
File Mode input
Filter *.cub
Close Window
X

Files: TO


Description

This file will contain the filtered output.

Type cube
File Mode output
Pixel Type real
Close Window
X

Boxcar Size: LINES


Description

Use this parameter to select the number of lines in the boxcar. Higher values take longer, and intensify the results in the vertical direction. The default value is three.

Type integer
Default 3
Minimum 1 (inclusive)
Close Window
X

Boxcar Size: SAMPLES


Description

Use this parameter to select the number of samples in the boxcar. Higher values take longer, and intensify the results in the horizontal direction. The default value is three.

Type integer
Default 3
Minimum 1 (inclusive)
Close Window
X

Filter Type: FILTER


Description

Use this parameter to choose the filter type. The possibilities include min, which finds the lowest DN in the boxcar and max, which finds the highest DN in the boxcar.

Type string
Default MIN
Option List:
Option Brief Description
MINMinimum filter The minimum filter uses a variable kernel to find the pixel with the lowest DN in the boxcar.
MAXMaximum filter The maximum filter uses a variable kernel to find the pixel with the greatest DN in the boxcar
Close Window

Example 1

Minimum 3x3

Description

Use the minimum option to enlarge dark areas (low DN pixels) and shrink light areas (high DN pixels).

Command Line

minmax from= peaks.cub to=darkcube.cub lines=3 samples=3 filter=min
In this example the "lines" and "samples" are both 3, making a 3 x 3 boxcar. The minimum filter is selected, so as to essentially darken the output.

GUI Screenshot

minmax gui

Example GUI

Screenshot of the GUI with parameters set to perform the minimum filter with a 3 x 3 boxcar.

Input Image

The image before the filter

Input image before minmax.

Parameter Name: FROM

This is the image as it was taken originally. Take note of the size of areas with high DNs, such as on top of mountains and in the lower right corner of the image.

Output Image

The image after the filter

Output image after minmax

Parameter Name: TO

The filtered image. A side-effect of the program is a slight blur to the image, but notice the change in the details described above. the mountain tops have lost some area, while the dark region at the base has expanded. Also note the reduced intensity of the brightness in the lower right corner.


Example 2

Maximum 2x2

Description

Use the maximum option to enlarge bright areas (pixels with high DNs) and shrink dark areas (pixels with low DNs).

Command Line

minmax from= peaks.cub to=lightcube.cub lines=2 samples=2 filter=max
In this example both the "lines" and "samples" options are set to 2. This will make the program run faster than the 3 x 3 boxcar featured in example 1. The effect of the filter will also be somewhat less dramatic than with a 3 x 3 boxcar.

GUI Screenshot

minmax gui

Example GUI

Screenshot of the GUI with parameters set to perform the maximum filter with a 2 x 2 boxcar.

Input Image

The image before the filter

Input image before minmax.

Parameter Name: FROM

This is the image as it was taken originally. Take note of the size of areas with high DNs. In particular, notice the man-made lights in the lower right corner of the image and the bright spots on top of the mountain.

Output Image

The image after the filter

Output image after minmax

Parameter Name: TO

The filtered image. Just as in example 1, the image is blurred slightly. Unlike the first example, bright areas are now enlarged and the brightness that would have been shrunk using the minimum filter is now expanded. Again, note the peaks of the mountains and the man-made lights in the lower right corner.