Using the Convolution Filter process

The Convolution Filter process performs filtering on the pixel values in an image, which can be used for sharpening or blurring an image, detecting edges within an image, or performing other kernel-based enhancements.

This process is based on a kernel (matrix or window) moving across the image. The filter operation is performed on the pixels contained within the kernel, and the output is a new value for the center pixel in the window. The kernel moves one pixel at a time through the entire raster datasets for each row. The size of the kernel can be defined, but it is optimized for smaller sizes from 3 x 3 to 7 x 7. The size of the kernel defines the number of pixels you want used in the filter calculation, and the size must always be a combination of odd numbers.

Kernel diagram
The five convolution filter methods

Filter

Description

Average

Replaces the pixel with the average (mean) value of the pixels within the kernel.

Maximum

Replaces the pixel value with the maximum value of the pixels within the kernel.

Minimum

Replaces the pixel value with the minimum value of the pixels within the kernel.

Standard Deviation

Replaces the pixel value with the standard deviation of the pixels within the kernel. This is a way of creating contrast in the image.

Kernel

Applies one of the following specific filters

  • User Defined—Enables the user to specify the kernel width, height, and weight, as well as the factors used to calculate the kernel values
  • Sharpen—Uses a simple 3 x 3 sharpening kernel
     0      -0.25    0
    -0.25    2      -0.25
     0      -0.25    0
  • Sharpen More—Uses a simple 3 x 3 sharpening kernel but with a stronger effect than the Sharpen kernel
    -0.25   -0.25   -0.25
    -0.25    3      -0.25
    -0.25   -0.25   -0.25
  • Point Spread Function—Uses a 3 x 3 kernel to apply a point spread function
    -0.627   0.352  -0.627
     0.352   2.923   0.352
    -0.627   0.352  -0.627

Convolution filter methods

Statistical filters measure a local statistical property and are useful for reducing noise in an image or for texture feature extraction.

There are many types of kernels you can define with the User Defined kernel parameter. Some examples are given below.

Edge or line detection

Vertical

Horizontal

Left diagonal

Right diagonal

-1 0 1
-1 0 1
-1 0 1

-1 -1 -1
 0  0  0
 1  1  1

 0  1  1
-1  0  1
-1 -1  0

1  1  0
1  0 -1
0 -1 -1

Edge or line detection parameters
Compass gradient mask

Northwest

North

Northeast

1  1  1
1 -2 -1
1 -1 -1

 1  1  1
 1 -2  1
-1 -1 -1

 1  1  1
-1 -2  1
-1 -1  1

West

East

1  1 -1
1 -2 -1
1  1 -1

-1  1  1
-1 -2  1
-1  1  1

Southwest

South

Southeast

1 -1 -1
1 -2 -1
1  1  1

-1 -1 -1
 1 -2  1
 1  1  1

-1 -1  1
-1 -2  1
 1  1  1

Compass gradient mask parameters

When calculating the edge values, the ArcGIS Image Server Convolution Filter process uses a mirror algorithm. Therefore, when processing the left side of the image with a 3 x 3 kernel, the values used for the last column of the kernel are the same values used in the second-to-last column. For example, to apply a 3 x 3 kernel filter on the left edge where the center pixel value is 7, the last column is duplicated to form the third column in the kernel; therefore, the processing is performed on the following kernel values:

3 6 6
4 7 7
3 8 8

You specify the type of convolution filter by choosing a method from the Filter Method drop-down list box on the Convolution Filter Process Definition dialog box. If you choose the Average, Maximum, Minimum, or Standard Deviation filter method, you can specify the filter dimensions by typing values in the Filter width and Filter height text boxes. If you choose the Kernel filter method, you must choose the kernel name. Sharpen, Sharpen More, and Point Spread Function kernel names are predefined; however, if you choose User Defined, you can alter any of the lower parameters on the dialog box. When you type the kernel values in the Kernel values text box on the Convolution Filter Process Definition dialog box, the filter is listed from the top left corner to the bottom right corner. For example, the vertical edge detection filter listed above would be typed in the Kernel values text box as follows: -1 0 1 -1 0 1 -1 0 1. You must use a space to delimit the values.

Convolution Filter Process Definition dialog box

The output number of bands, bit depth, pixel type, and color space remain the same for the output of this process as they are for the input.

関連項目


7/10/2012