This document is archived and information here might be outdated.  Recommended version.


Pixel filters (ArcObjects .NET 10.6 SDK)
ArcObjects Help for .NET developers > Developing with ArcGIS > Learning ArcObjects > Managing data > Working with image and raster data > Processing raster data > Pixel filters (ArcObjects .NET 10.6 SDK)

Pixel filters


Summary
This topic introduces pixel filters, describes supported pixel filters, and explains how pixel filters are used in ArcGIS.

About pixel filters

A pixel filter performs radiometric transformation on a raster. It transforms or alters the pixel values when applied to a raster. PixelFilter, an abstract class, supports the IPixelFilter and IPixelFilter2 interfaces and is implemented by many built-in classes including the following:
  • PansharpeningFilter—Performs image enhancement using various pan-sharpening techniques. It uses a higher-resolution panchromatic image (or raster band) to fuse with a co-registered lower-resolution multiband raster dataset. The result is a multiband raster dataset with the resolution of the panchromatic raster where the two rasters fully overlap.
  • RasterConvolutionFilter—Performs various pixel filtering techniques to enhance images, such as high pass and low pass filtering.
  • RemapFilter—Maps a set of pixel ranges to a set of values.
  • FocalSatisticsFilter—Calculates the statistics based on a defined window size.
A pixel filter can be applied to a raster object and transforms the pixel values during display or saves to a new raster dataset. The following code example applies a convolution filter to a raster using the IPixelOperation interface:
[C#]
void SetFilter(IRaster raster)
{
    //Create the filter.
    IStockConvolutionFilter pixelFilter=new RasterConvolutionFilterClass();
    pixelFilter.Type=esriRasterFilterTypeEnum.esriRasterFilterSmoothing3x3;

    //Set the filter to the raster.
    IPixelOperation pixelOperation=(IPixelOperation)raster;
    pixelOperation.PixelFilter=(IPixelFilter)pixelFilter;
[VB.NET]
Private Sub SetFilter(ByVal raster As IRaster)
    'Create the filter.
    Dim pixelFilter As IStockConvolutionFilter=New RasterConvolutionFilterClass()
    pixelFilter.Type=esriRasterFilterTypeEnum.esriRasterFilterSmoothing3x3
    
    'Set the filter to the raster.
    Dim pixelOperation As IPixelOperation=CType(raster, IPixelOperation)
    pixelOperation.PixelFilter=CType(pixelFilter, IPixelFilter)
End Sub
You can create a custom pixel filter class by implementing the required interfaces. The custom pixel filter class will perform in the same way as the built-in pixel filter classes.
The pixel filter class is limited to certain operations that only change pixel values; it does not change the pixel type or band information. Raster functions provide additional and dynamic geometric and radiometric raster processing capabilities. For more information, see Function raster datasets and raster functions.






To use the code in this topic, reference the following assemblies in your Visual Studio project. In the code files, you will need using (C#) or Imports (VB .NET) directives for the corresponding namespaces (given in parenthesis below if different from the assembly name):
Development licensing Deployment licensing
ArcGIS Desktop Basic ArcGIS Desktop Basic
ArcGIS Desktop Standard ArcGIS Desktop Standard
ArcGIS Desktop Advanced ArcGIS Desktop Advanced
Engine Developer Kit Engine