Borders

Filtering functions described later in this chapter perform neighborhood operations (see Neighborhood Operations). They operate on the assumption that for each pixel to be processed, all neighborhood pixels required for the operation are also available.

The neighborhood for each given pixel is defined by the filter kernel (or mask) size and anchor cell position. Anchor cell (see Figure "Borders for Neighborhood Operations" (a)) is a fixed cell within the kernel, which is used for positioning the kernel with respect to the currently processed pixel of the source image. Specifically, the kernel is placed on the image in such a way that the anchor cell coincides with the input pixel. The anchor cell is specified by its coordinates anchor.x and anchor.y in the coordinate system associated with the lower right corner of the kernel.

As Figure "Borders for Neighborhood Operations" (b) illustrates, if the input pixel is near the horizontal or vertical edge of the image, the overlaid kernel may refer to neighborhood pixels that do not exist within the source image (that is, are located outside the image area). The set of all boundary source image pixels that require such non-existent pixels to complete the neighborhood operation for the given kernel and anchor is shaded yellow in Figure "Borders for Neighborhood Operations" (b), while the collection of all scanned external pixels (called border pixels) is shaded gray.

If you want to apply some filtering operation to the whole source image, you must figure out what additional border pixels are required for the operation, and define in one way or another these non-existent pixels. To do this, you can use the Intel IPP functions ippiCopyConstBorder, ippiCopyReplicateBorder, or ippiCopyWrapBorder, which fill the border of the extended image with the pixel values that you define, or you can apply your own extension method.

If you want to apply the filtering operation to the part of the source image, or ROI (see Regions of Interest in Intel IPP), then the necessity of extending the image area with border pixels depends upon the ROI size and position within the image. Figure "Borders for Neighborhood Operations" (c)) shows that if ROI does not cover yellow (internal boundary) pixels, then no external pixels are scanned, and border extension is not required.

If boundary pixels are part of ROI, then some area extension of the source image is still necessary.

The bottom-line is that to provide valid results of filtering operations, the application must check that ROI parameters passed to the filtering function have such values that all required neighborhood pixels actually exist in the image and define the missing pixels when necessary.

Borders for Neighborhood Operations




Submit feedback on this help topic

Copyright © 2000 - 2011, Intel Corporation. All rights reserved.