Use Convolutions and Morphology to apply convolution filters or morphology filters to image data. See the following sections:

Convolution Filters


Convolution filters produce output images in which the brightness value at a given pixel is a function of some weighted average of the brightness of the surrounding pixels. Convolution of a user-selected kernel with the image array returns a new, spatially filtered image. You can select the kernel size and values, producing different types of filters.

Note: To apply a custom convolution filter to a raster, use the RasterConvolution task in the ENVI API.

Directional Filters

This is a first derivative edge enhancement filter that selectively enhances image features having specific direction components (gradients). The sum of the directional filter kernel elements is zero. The result is that areas with uniform pixel values are zeroed in the output image, while those that are variable are presented as bright edges.

You can also write a script to apply a directional filter to a raster, using the DirectionalFilter task.

  1. From the ENVI Toolbox, select Filter > Directional Filter. The Directional Filter dialog appears.
  2. Select an Input Raster and perform optional spatial and spectral subsetting.
  3. Optional: Specify a filter Add Back percentage value between 0.0 and 1.0. A value of 1.0 is equal to 100%.
  4. Optional: Specify a Kernel Size, in pixels. The default value is 3 x 3.
  5. Optional: Specify the directional Angle, in degrees. The default value is 0.
  6. Specify a filename and location for the Output Raster.
  7. Enable the Preview check box to see a preview of the settings before you click OK to process the data. The preview is calculated only on the area in the view and uses the resolution level at which you are viewing the image. See Preview for details on the results. To preview a different area in your image, pan and zoom to the area of interest and re-enable the Preview option.
  8. Enable the Display result check box to display the output in the view when processing is complete. Otherwise, if the check box is disabled, the result can be loaded from the Data Manager.
  9. To reuse these task settings in future ENVI sessions, save them to a file. Click the down arrow and select Save Parameter Values, then specify the location and filename to save to. Note that some parameter types, such as rasters, vectors, and ROIs, will not be saved with the file. To apply the saved task settings, click the down arrow and select Restore Parameter Values, then select the file where you previously stored your settings.

  10. To run the process in the background, click the down arrow and select Run Task in the Background. If an ENVI Server has been set up on the network, the Run Task on remote ENVI Server name is also available. The ENVI Server Job Console will show the progress of the job and will provide a link to display the result when processing is complete. See ENVI Servers for more information.

  11. To see a model-based version of this tool that shows how the tool is constructed from individual tasks, click Open in Modeler.

  12. Click OK.

Gaussian High Pass Filters

This filter uses unsharp masking to enhance local image variations. It operates by subtracting a low pass (Gaussian Low Pass) version of the image to enhance the high frequency components.

You can also write a script to apply a Gaussian high pass filter to a raster, using the GaussianHighPassFilter task.

  1. From the ENVI Toolbox, select Filter > Gaussian High Pass Filter. The Gaussian High Pass Filter dialog appears.
  2. Select an Input Raster and perform optional spatial and spectral subsetting.
  3. Optional: Specify a filter Add Back percentage value between 0.0 and 1.0. A value of 1.0 is equal to 100%.
  4. Optional: Specify a Kernel Size, in pixels. The default value is 3 x 3.
  5. Specify a filename and location for the Output Raster.
  6. Enable the Preview check box to see a preview of the settings before you click OK to process the data. The preview is calculated only on the area in the view and uses the resolution level at which you are viewing the image. See Preview for details on the results. To preview a different area in your image, pan and zoom to the area of interest and re-enable the Preview option.
  7. Enable the Display result check box to display the output in the view when processing is complete. Otherwise, if the check box is disabled, the result can be loaded from the Data Manager.

    To reuse these task settings in future ENVI sessions, save them to a file. Click the down arrow and select Save Parameter Values, then specify the location and filename to save to. Note that some parameter types, such as rasters, vectors, and ROIs, will not be saved with the file. To apply the saved task settings, click the down arrow and select Restore Parameter Values, then select the file where you previously stored your settings.

  8. To run the process in the background, click the down arrow and select Run Task in the Background. If an ENVI Server has been set up on the network, the Run Task on remote ENVI Server name is also available. The ENVI Server Job Console will show the progress of the job and will provide a link to display the result when processing is complete. See ENVI Servers for more information.

  9. To see a model-based version of this tool that shows how the tool is constructed from individual tasks, click Open in Modeler.

  10. Click OK.

Gaussian Low Pass Filters

This filter is used to smooth images. It uses a kernel defined by a 2D Gaussian function with standard deviation N/8.

You can also write a script to apply a low pass filter to a raster, using the GaussianLowPassFilter task.

  1. From the ENVI Toolbox, select Filter > Gaussian Low Pass Filter. The Gaussian Low Pass Filter dialog appears.
  2. Select an Input Raster and perform optional spatial and spectral subsetting.
  3. Optional: Specify a filter Add Back percentage value between 0.0 and 1.0. A value of 1.0 is equal to 100%.
  4. Optional: Specify a Kernel Size, in pixels. The default value is 3 x 3.
  5. Specify a filename and location for the Output Raster.
  6. Enable the Preview check box to see a preview of the settings before you click OK to process the data. The preview is calculated only on the area in the view and uses the resolution level at which you are viewing the image. See Preview for details on the results. To preview a different area in your image, pan and zoom to the area of interest and re-enable the Preview option.
  7. Enable the Display result check box to display the output in the view when processing is complete. Otherwise, if the check box is disabled, the result can be loaded from the Data Manager.
  8. To reuse these task settings in future ENVI sessions, save them to a file. Click the down arrow and select Save Parameter Values, then specify the location and filename to save to. Note that some parameter types, such as rasters, vectors, and ROIs, will not be saved with the file. To apply the saved task settings, click the down arrow and select Restore Parameter Values, then select the file where you previously stored your settings.

  9. To run the process in the background, click the down arrow and select Run Task in the Background. If an ENVI Server has been set up on the network, the Run Task on remote ENVI Server name is also available. The ENVI Server Job Console will show the progress of the job and will provide a link to display the result when processing is complete. See ENVI Servers for more information.

  10. To see a model-based version of this tool that shows how the tool is constructed from individual tasks, click Open in Modeler.

  11. Click OK.

High Pass Filters

This filter removes the low frequency components of an image while retaining the high frequency (local variations). It can enhance edges between different regions as well as to sharpen an image. It uses a kernel with a high central value, typically surrounded by negative weights. ENVI’s default high pass filter uses a 3 x 3 kernel with a value of 8 for the center pixel and values of -1 for the exterior pixels. High pass filters can only have odd kernel dimensions.

You can also write a script to apply a high pass filter to a raster, using the HighPassFilter task.

  1. From the ENVI Toolbox, select Filter > High Pass Filter. The High Pass Filter dialog appears.
  2. Select an Input Raster and perform optional spatial and spectral subsetting.
  3. Optional: Specify a filter Add Back percentage value between 0.0 and 1.0. A value of 1.0 is equal to 100%.
  4. Optional: Specify a Kernel Size, in pixels. The default value is 3 x 3.
  5. Optional: In the Data Ignore Value field, specify a unique data value for pixels in the output raster that have a non-zero pixel state value.
  6. Specify a filename and location for the Output Raster.
  7. Enable the Preview check box to see a preview of the settings before you click OK to process the data. The preview is calculated only on the area in the view and uses the resolution level at which you are viewing the image. See Preview for details on the results. To preview a different area in your image, pan and zoom to the area of interest and re-enable the Preview option.
  8. Enable the Display result check box to display the output in the view when processing is complete. Otherwise, if the check box is disabled, the result can be loaded from the Data Manager.
  9. To reuse these task settings in future ENVI sessions, save them to a file. Click the down arrow and select Save Parameter Values, then specify the location and filename to save to. Note that some parameter types, such as rasters, vectors, and ROIs, will not be saved with the file. To apply the saved task settings, click the down arrow and select Restore Parameter Values, then select the file where you previously stored your settings.

  10. To run the process in the background, click the down arrow and select Run Task in the Background. If an ENVI Server has been set up on the network, the Run Task on remote ENVI Server name is also available. The ENVI Server Job Console will show the progress of the job and will provide a link to display the result when processing is complete. See ENVI Servers for more information.

  11. Click OK.

Laplacian FIlters

This is a second derivative edge enhancement filter that operates without regard to edge direction. Laplacian filtering emphasizes maximum values within the image by using a kernel with a high central value typically surrounded by negative weights in the north-south and east-west directions and zero values at the kernel corners. ENVI’s default Laplacian filter uses a 3 x 3 kernel with a value of 4 for the center pixel and values of -1 for the north-south and east-west pixels. All Laplacian filters must have odd kernel sizes.

You can also write a script to apply a low pass filter to a raster, using the LaplacianFilter task.

  1. From the ENVI Toolbox, select Filter > Laplacian Filter. The Laplacian Filter dialog appears.
  2. Select an Input Raster and perform optional spatial and spectral subsetting.
  3. Optional: Specify a filter Add Back percentage value between 0.0 and 1.0. A value of 1.0 is equal to 100%.
  4. Optional: Specify a Kernel Size, in pixels. The default value is 3 x 3.
  5. Specify a filename and location for the Output Raster.
  6. Enable the Preview check box to see a preview of the settings before you click OK to process the data. The preview is calculated only on the area in the view and uses the resolution level at which you are viewing the image. See Preview for details on the results. To preview a different area in your image, pan and zoom to the area of interest and re-enable the Preview option.
  7. Enable the Display result check box to display the output in the view when processing is complete. Otherwise, if the check box is disabled, the result can be loaded from the Data Manager.
  8. To reuse these task settings in future ENVI sessions, save them to a file. Click the down arrow and select Save Parameter Values, then specify the location and filename to save to. Note that some parameter types, such as rasters, vectors, and ROIs, will not be saved with the file. To apply the saved task settings, click the down arrow and select Restore Parameter Values, then select the file where you previously stored your settings.

  9. To run the process in the background, click the down arrow and select Run Task in the Background. If an ENVI Server has been set up on the network, the Run Task on remote ENVI Server name is also available. The ENVI Server Job Console will show the progress of the job and will provide a link to display the result when processing is complete. See ENVI Servers for more information.

  10. To see a model-based version of this tool that shows how the tool is constructed from individual tasks, click Open in Modeler.

  11. Click OK.

Low Pass Filters

This filter reserves the low frequency components of an image, which smoothes it. ENVI’s low pass filter contains the same weights in each kernel element, replacing the center pixel value with an average of the surrounding values.

You can also write a script to apply a low pass filter to a raster, using the LowPassFilter task.

  1. From the ENVI Toolbox, select Filter > Low Pass Filter. The Low Pass Filter dialog appears.
  2. Select an Input Raster and perform optional spatial and spectral subsetting.
  3. Optional: Specify a filter Add Back percentage value between 0.0 and 1.0. A value of 1.0 is equal to 100%.
  4. Optional: Specify a Kernel Size, in pixels. The default value is 3 x 3.
  5. Optional: In the Data Ignore Value field, specify a unique data value for pixels in the output raster that have a non-zero pixel state value.
  6. Specify a filename and location for the Output Raster.
  7. Enable the Preview check box to see a preview of the settings before you click OK to process the data. The preview is calculated only on the area in the view and uses the resolution level at which you are viewing the image. See Preview for details on the results. To preview a different area in your image, pan and zoom to the area of interest and re-enable the Preview option.
  8. Enable the Display result check box to display the output in the view when processing is complete. Otherwise, if the check box is disabled, the result can be loaded from the Data Manager.
  9. To reuse these task settings in future ENVI sessions, save them to a file. Click the down arrow and select Save Parameter Values, then specify the location and filename to save to. Note that some parameter types, such as rasters, vectors, and ROIs, will not be saved with the file. To apply the saved task settings, click the down arrow and select Restore Parameter Values, then select the file where you previously stored your settings.

  10. To run the process in the background, click the down arrow and select Run Task in the Background. If an ENVI Server has been set up on the network, the Run Task on remote ENVI Server name is also available. The ENVI Server Job Console will show the progress of the job and will provide a link to display the result when processing is complete. See ENVI Servers for more information.

  11. Click OK.

Median Filters

This filter smooths an image, while preserving edges larger than the kernel dimensions (good for removing speckling noise). ENVI’s Median filter replaces each center pixel with the median value (not to be confused with the average) within the neighborhood specified by the filter size.

You can also write a script to apply a Median filter to a raster, using the MedianFilter task.

  1. From the ENVI Toolbox, select Filter > Median Filter. The Median Filter dialog appears.
  2. Select an Input Raster and perform optional spatial and spectral subsetting.
  3. Optional: Specify a filter Add Back percentage value between 0.0 and 1.0. A value of 1.0 is equal to 100%.
  4. Optional: Specify a square Window Size for median filtering. The default value is 3.
  5. Specify a filename and location for the Output Raster.
  6. Enable the Preview check box to see a preview of the settings before you click OK to process the data. The preview is calculated only on the area in the view and uses the resolution level at which you are viewing the image. See Preview for details on the results. To preview a different area in your image, pan and zoom to the area of interest and re-enable the Preview option.
  7. Enable the Display result check box to display the output in the view when processing is complete. Otherwise, if the check box is disabled, the result can be loaded from the Data Manager.
  8. To reuse these task settings in future ENVI sessions, save them to a file. Click the down arrow and select Save Parameter Values, then specify the location and filename to save to. Note that some parameter types, such as rasters, vectors, and ROIs, will not be saved with the file. To apply the saved task settings, click the down arrow and select Restore Parameter Values, then select the file where you previously stored your settings.

  9. To run the process in the background, click the down arrow and select Run Task in the Background. If an ENVI Server has been set up on the network, the Run Task on remote ENVI Server name is also available. The ENVI Server Job Console will show the progress of the job and will provide a link to display the result when processing is complete. See ENVI Servers for more information.

  10. Click OK.

Roberts Filters

This is a non-linear edge detector filter similar to the Sobel. It is a special case filter that uses a preset 2 x 2 approximation of the true Roberts function, a simple, 2D differencing method for edge-sharpening and isolation.

You can also write a script to apply a Roberts filter to a raster, using the RobertsFilter task.

  1. From the ENVI Toolbox, select Filter > Roberts Filter. The Roberts Filter dialog appears.
  2. Select an Input Raster and perform optional spatial and spectral subsetting.
  3. Optional: Specify a filter Add Back percentage value between 0.0 and 1.0. A value of 1.0 is equal to 100%.
  4. Specify a filename and location for the Output Raster.
  5. Enable the Preview check box to see a preview of the settings before you click OK to process the data. The preview is calculated only on the area in the view and uses the resolution level at which you are viewing the image. See Preview for details on the results. To preview a different area in your image, pan and zoom to the area of interest and re-enable the Preview option.
  6. To write the output to disk, select the File radio button and specify a filename and location. To produce output in memory only, select the Virtual radio button.
  7. To reuse these task settings in future ENVI sessions, save them to a file. Click the down arrow and select Save Parameter Values, then specify the location and filename to save to. Note that some parameter types, such as rasters, vectors, and ROIs, will not be saved with the file. To apply the saved task settings, click the down arrow and select Restore Parameter Values, then select the file where you previously stored your settings.

  8. To run the process in the background, click the down arrow and select Run Task in the Background. If an ENVI Server has been set up on the network, the Run Task on remote ENVI Server name is also available. The ENVI Server Job Console will show the progress of the job and will provide a link to display the result when processing is complete. See ENVI Servers for more information.

  9. Click OK.

Sobel Filters

This is a non-linear, edge enhancement, special case filter that uses an approximation of the true Sobel function. It uses a preset 3 x 3, non-linear edge enhancement operator.

You can also write a script to apply a Sobel filter to a raster, using the SobelFilter task.

  1. From the ENVI Toolbox, select Filter > Sobel Filter. The Sobel Filter dialog appears.
  2. Select an Input Raster and perform optional spatial and spectral subsetting.
  3. Optional: Specify a filter Add Back percentage value between 0.0 and 1.0. A value of 1.0 is equal to 100%.
  4. Specify a filename and location for the Output Raster.
  5. Enable the Preview check box to see a preview of the settings before you click OK to process the data. The preview is calculated only on the area in the view and uses the resolution level at which you are viewing the image. See Preview for details on the results. To preview a different area in your image, pan and zoom to the area of interest and re-enable the Preview option.
  6. To write the output to disk, select the File radio button and specify a filename and location. To produce output in memory only, select the Virtual radio button.
  7. To reuse these task settings in future ENVI sessions, save them to a file. Click the down arrow and select Save Parameter Values, then specify the location and filename to save to. Note that some parameter types, such as rasters, vectors, and ROIs, will not be saved with the file. To apply the saved task settings, click the down arrow and select Restore Parameter Values, then select the file where you previously stored your settings.

  8. To run the process in the background, click the down arrow and select Run Task in the Background. If an ENVI Server has been set up on the network, the Run Task on remote ENVI Server name is also available. The ENVI Server Job Console will show the progress of the job and will provide a link to display the result when processing is complete. See ENVI Servers for more information.

  9. Click OK.

Morphology Filters


Mathematical morphology filtering is a non-linear method of processing digital images on the basis of shape. Its primary goal is the quantification of geometrical structures. Morphological kernels used in ENVI are just the structuring element and should not be confused with convolution kernels.

Reference: Haralick, Sternberg, and Zhuang. "Image Analysis Using Mathematical Morphology." IEEE Transactions on Pattern Analysis and Machine Intelligence PAMI-9, No. 4 (1987): 532-550.

Binary Morphological Filters

Use the Binary Morphological Filter tool to produce output pixels in black or white.

You can also write a script to apply a binary morphological filter to a raster, using the BinaryMorphologicalFilter task.

  1. From the ENVI Toolbox, select Filter > Binary Morphological Filter. The Binary Morphological Filter dialog appears.
  2. Select an Input Raster and perform optional spatial and spectral subsetting.
  3. Select an option from the Method drop-down list. The choices are:
    • Dilate: Commonly known as fill, expand, or grow, it fills holes smaller than the structural element (kernel) in a binary or gray scale image. Use only with unsigned byte, unsigned long-integer, or unsigned integer data.
    • Erode: Commonly known as shrink or reduce, it removes islands of pixels smaller than the structural element (kernel) in a binary or gray scale image. Use only with unsigned byte, unsigned long-integer, or unsigned integer data.
    • Open: Smooth the contours, break narrow isthmuses, and eliminate small islands and sharp peaks or capes in an image. The opening of an image is defined as the erosion of the image followed by subsequent dilation using the same structural element. Using the Erode filter followed by using the Dilate filter produces the same result as using an Open filter.
    • Close: Smooth the contours, fuse narrow breaks and long thin gulfs, eliminate small holes, and fill gaps in the contours of an image. The closing of an image is defined as the dilation of the image followed by subsequent erosion using the same structural element. Using the Dilate filter followed by using the Erode filter produces the same result as using the Closing filter.
  4. Optional: Select a Kernel size for filtering, using the Cols and Rows field. The default value is 3 x 3. You can manage kernels as follows:
    • Click the Edit Kernel Values button to edit the elements of the kernel, using values of 0 or 1.
    • Click the Save Kernel button to save the kernel to a JSON-formatted text file.
    • Click the Load Kernel button to restore a kernel file.
  5. Optional: Specify the number of Iterations used to perform filtering.
  6. Specify a filename and location for the Output Raster.
  7. Enable the Preview check box to see a preview of the settings before you click OK to process the data. The preview is calculated only on the area in the view and uses the resolution level at which you are viewing the image. See Preview for details on the results. To preview a different area in your image, pan and zoom to the area of interest and re-enable the Preview option.
  8. To write the output to disk, select the File radio button and specify a filename and location. To produce output in memory only, select the Virtual radio button.
  9. To reuse these task settings in future ENVI sessions, save them to a file. Click the down arrow and select Save Parameter Values, then specify the location and filename to save to. Note that some parameter types, such as rasters, vectors, and ROIs, will not be saved with the file. To apply the saved task settings, click the down arrow and select Restore Parameter Values, then select the file where you previously stored your settings.

  10. To run the process in the background, click the down arrow and select Run Task in the Background. If an ENVI Server has been set up on the network, the Run Task on remote ENVI Server name is also available. The ENVI Server Job Console will show the progress of the job and will provide a link to display the result when processing is complete. See ENVI Servers for more information.

  11. Click OK.

Grayscale Morphological Filters

Use the Grayscale Morphological Filter tool to produce output pixels that retain a grayscale gradient.

You can also write a script to apply a binary morphological filter to a raster, using the GrayscaleMorphologicalFilter task.

  1. From the ENVI Toolbox, select Filter > Grayscale Morphological Filter. The Grayscale Morphological Filter dialog appears.
  2. Select an Input Raster and perform optional spatial and spectral subsetting.
  3. Select an option from the Method drop-down list. The choices are:
    • Dilate: Commonly known as fill, expand, or grow, it fills holes smaller than the structural element (kernel) in a binary or gray scale image. Use only with unsigned byte, unsigned long-integer, or unsigned integer data.
    • Erode: Commonly known as shrink or reduce, it removes islands of pixels smaller than the structural element (kernel) in a binary or gray scale image. Use only with unsigned byte, unsigned long-integer, or unsigned integer data.
    • Open: Smooth the contours, break narrow isthmuses, and eliminate small islands and sharp peaks or capes in an image. The opening of an image is defined as the erosion of the image followed by subsequent dilation using the same structural element. Using the Erode filter followed by using the Dilate filter produces the same result as using an Open filter.
    • Close: Smooth the contours, fuse narrow breaks and long thin gulfs, eliminate small holes, and fill gaps in the contours of an image. The closing of an image is defined as the dilation of the image followed by subsequent erosion using the same structural element. Using the Dilate filter followed by using the Erode filter produces the same result as using the Closing filter.
  4. Optional: Select a Kernel size for filtering, using the Cols and Rows field. The default value is 3 x 3. You can manage kernels as follows:
    • Click the Edit Kernel Values button to edit the elements of the kernel, using values of 0 or 1.
    • Click the Save Kernel button to save the kernel to a JSON-formatted text file.
    • Click the Load Kernel button to restore a kernel file.
  5. Optional: Specify the number of Iterations used to perform filtering.
  6. Specify a filename and location for the Output Raster.
  7. Enable the Preview check box to see a preview of the settings before you click OK to process the data. The preview is calculated only on the area in the view and uses the resolution level at which you are viewing the image. See Preview for details on the results. To preview a different area in your image, pan and zoom to the area of interest and re-enable the Preview option.
  8. To write the output to disk, select the File radio button and specify a filename and location. To produce output in memory only, select the Virtual radio button.
  9. To reuse these task settings in future ENVI sessions, save them to a file. Click the down arrow and select Save Parameter Values, then specify the location and filename to save to. Note that some parameter types, such as rasters, vectors, and ROIs, will not be saved with the file. To apply the saved task settings, click the down arrow and select Restore Parameter Values, then select the file where you previously stored your settings.

  10. To run the process in the background, click the down arrow and select Run Task in the Background. If an ENVI Server has been set up on the network, the Run Task on remote ENVI Server name is also available. The ENVI Server Job Console will show the progress of the job and will provide a link to display the result when processing is complete. See ENVI Servers for more information.

  11. Click OK.

See Also


Adaptive Filters, Frequency Filters, Texture Filters