Apply Image Filters
Lesson 1 of 1
Apply Image Filters
ENVI provides 26 image filtering tools with a wide range of uses, including smoothing, sharpening, edge detection, texture, Fast Fourier Transform (FFT), convolution, and morphology. Each has a different purpose. With most of them, you can preview their effect on a portion of the image, then apply the filters to the entire image.
This quick guide demonstrates a few commonly used filters. You will:
- •
Apply high-pass and directional filters to enhance the edges of features in a panchromatic image. * •
Apply an Enhanced Lee adaptive filter to despeckle and smooth a SAR image.
Open a Panchromatic Image
- 1
Select File > Open from the Menu bar. An Open dialog appears. 2. 2
Go to the "data" directory in your ENVI installation path.
Windows: C:\Program Files\NV5\ENVIxx\data (xx is the version number)
Linux: /user/local/NV5/envixx/data
Mac: /Applications/NV5/envixx/data
3. 3
Select the file qb_boulder_pan and click Open. The image is added to the Layer Manager and displayed in the Image window. This is a QuickBird panchromatic image of Boulder, Colorado. 4. 4
In the Go To field of the Toolbar, enter pixel coordinates 3009, 483 and press the Enter key. The view centers on a residential area with houses, streets, a tennis court, and a pond.

Apply a High-Pass Filter
High-pass filters are primarily used to sharpen images. The ENVI Toolbar has a Sharpen slider that you can use to sharpen images and enhance the edges of features, however, it is only for display purposes. If you save the image to a new ENVI-format file on disk, the display enhancements are not retained. A high-pass filter actually changes the pixel values of an image. You can optionally save the image to disk and further process it as needed.
High-pass filters are a type of convolution filter in which the brightness value at a given pixel is a function of some weighted average of the brightness of the surrounding pixels. They remove the low-frequency components of an image while retaining the high-frequency components. They use a kernel with a high central value, typically surrounded by negative weights. ENVI’s default high-pass filter looks like this:

- 1
In the Toolbox, expand the Filtersfolder and double-click High Pass Filter. The High Pass Filter dialog appears. 2. 2
Enable the Previewoption. The Add Back value controls the blending between the filtered result and the original image. The default value is 0.1, which is what you see here. Only 10% of the original image is retained, while 90% of the high pass filtered result is displayed.

- 3
Enter an Add Back value of 0.5. This produces a blended image that displays 50% of the original (unfiltered) image and 50% of the high pass filtered image.

- 4
Leave the default values of 3 for Kernel Size Cols and Rows. ENVI will use a sliding 3 x 3 kernel (like you saw in the diagram above) to determine the target value of each pixel. Increasing the values to 9, for example, will apply a 9 x 9 kernel to each pixel. This results in a slightly smoothed, high-pass, filtered image. 2. 5
Leave the Data Ignore Value field blank. 3. 6
In the Output Raster field, enter a file name of qb_boulder_pan_HighPass.dat.

- 7
Click OK. When processing is complete, the high-pass filtered image is added to the Layer Manager and displayed in the Image window.

- 8
Before continuing with the next section, uncheck the qb_boulder_pan_HighPass.dat layer in the Layer Manager.
Apply a Directional Filter
Directional filters selectively enhance image features that have specific direction components. They are effective at locating disturbed soil, fault-induced lineaments in geology, subtle textural variations of surface features, and more.
- 1
Click the Zoom percentange drop-down list in the Toolbar and select 100% (1:1). The view zooms to 100%. 2. 2
In the Go To field of the Toolbar, enter pixel coordinates 1563, 823 and press the Enter key. The view jumps to an empty field.

- 3
In the Toolbox, double-click Directional Filter. The Directional Filter dialog appears. 2. 4
Enter a value of 0.2 in the Add Back field. 3. 5
Enable the Preview option. The Image window shows a preview of the result. The default Angle is 0 degrees, which emphasizes linear features that run north to south.

- 6
In the Angle field, enter a value of 90 and press the Enter key. This reveals features that run west to east.

- 7
You do not have to create an output raster for this exercise. When you are finished experimenting with different Angle values, click the Cancel button to dismiss the Directional Filter dialog. 2. 8
Select File > Data Manager from the Menu bar. 3. 9
Click the Close All Files button in the Data Manager toolbar.
Next, you will use an adaptive filter to despeckle a SAR image.
Apply an Adaptive Filter to a SAR Image
Adaptive filters use the standard deviation of pixels within a kernel surrounding each pixel to calculate a new pixel value. They are typically used to smooth images. Unlike a low-pass smoothing filter, however, adaptive filters preserve image sharpness and detail while suppressing noise. They are especially helpful at despeckling SAR images.
SAR images suffer from speckle noise caused by the backscattering of radar signals in multiple directions within a resolution cell. This can give SAR images a salt-and-pepper appearance that makes visual interpretation difficult.
For this exercise, you will evaluate a Single Look Complex (SLC) image from Capella Space. Download the ZIP file below, and extract the contents to a directory on your system.
Download Sample Data
[Capella_SAR_SICD_Rotterdam.zip
56.6 MB
DownloadArrow down with horizontal line beneath it](assets/Capella_SAR_SICD_Rotterdam.zip)
Subheading
- 1
Select File > Open from the Menu bar. 2. 2
Go to the directory where you saved the sample data, and select the file Capella_Rotterdam.dat. 3. 3
Click OK. The image is added to the Layer Manager and displayed in the Image window. The following screenshot shows the image at its full extent.

This is a Sensor Independent Complex Data (SICD) NITF file that was exported to ENVI raster format. ENVI 6.0 and later can read and display SICD files (.ntf) directly if the ENVI NITF/NSIF Module is installed and licensed. Saving the file to ENVI format ensures that users of all ENVI versions can read and display the file in this exercise.
The original SICD image is available from Capella's Open Data Gallery(opens in a new tab). SICD images have complex data values that ENVI separates into five bands: Power, Magnitude, Phase, Real, and Imaginary. You are viewing the Magnitude band, which is best used for visual interpretation. At 100% resolution, you can see the speckle noise discussed earlier:

ENVI provides 10 adaptive filters that can be used to despeckle SAR images. The following filters work best with SICD images like this one:
- •
Enhanced Frost * •
Enhanced Lee * •
Frost * •
Gamma * •
Median
Apply an Enhanced Lee Filter
- 1
In the Toolbox, double-click Enhanced Lee Filter. The Enhanced Lee Adaptive Filter dialog appears. 2. 2
Click the Browse button next to Input Raster, and select the file Capella_Rotterdam.dat. 3. 3
Change the Window Size value to 5. This will use a kernel size of 5 x 5, which will smooth the image even further. 4. 4
Leave the remaining parameters at their default values. 5. 5
In the Output Raster field, enter a file name of Capella_Rotterdam_Filtered.dat.

- 6
When processing is complete, the smoothed image is added to the Layer Manager and displayed in the Image window. The following screenshot shows the effect of smoothing on two ships docked at the harbor:


- 7
The image is displayed with a Square Root stretch, which brightens everything for easier visual interpretation. However, you can still see some speckling noise in the water. To remedy this, click the stretch type drop-down list in the Toolbar and select Optimized Linear.

- 8
This concludes the exercise.
Your input is important to us, please take a few moments to fill out ourQuick Guide Feedback(opens in a new tab)form.
© 2024 NV5 Geospatial Solutions, Inc. This information is not subject to the controls of the International Traffic in Arms Regulations (ITAR) or the Export Administration Regulations (EAR).