Processing Pixels at Image Borders
Morphological functions position the origin of the structuring element, its center element, over the pixel of interest in the input image. For pixels at the edge of an image, parts of the neighborhood defined by the structuring element can extend past the border of the image.
To process border pixels, the morphological functions assign a value to these undefined pixels, as if the functions had padded the image with additional rows and columns. The value of these "padding" pixels varies for dilation and erosion operations. The following table details the padding rules for dilation and erosion for both binary and grayscale images.
Table 9-2: Rules for Padding Images
Operation
Rule
Dilation
Pixels beyond the image border are assigned the minimum value afforded by the data type.
For binary images, these pixels are assumed to be set to 0.
For grayscale images, the minimum value for uint8 images is 0.
Erosion
Pixels beyond the image border are assigned the maximum value afforded by the data type.
For binary images, these pixels are assumed to be set to 1.
For grayscale images, the maximum value for uint8 images is 255.
Figure 9-1: Morphological Processing of a Binary Image
The following figure illustrates this processing for a grayscale image. The figure shows the processing of a particular pixel in the input image. Note how the function applies the rule to the input pixel's neighborhood and uses the highest value of all the pixels in the neighborhood as the value of the corresponding pixel in the output image.
Processing Pixels at Image Borders
Morphological functions position the origin of the structuring element, its center element, over the pixel of interest in the input image. For pixels at the edge of an image, parts of the neighborhood defined by the structuring element can extend past the border of the image.
To process border pixels, the morphological functions assign a value to these undefined pixels, as if the functions had padded the image with additional rows and columns. The value of these "padding" pixels varies for dilation and erosion operations. The following table details the padding rules for dilation and erosion for both binary and grayscale images.
Table 9-2: Rules for Padding Images
Operation
Rule
Dilation
Pixels beyond the image border are assigned the minimum value afforded by the data type.
For binary images, these pixels are assumed to be set to 0.
For grayscale images, the minimum value for uint8 images is 0.
Erosion
Pixels beyond the image border are assigned the maximum value afforded by the data type.
For binary images, these pixels are assumed to be set to 1.
For grayscale images, the maximum value for uint8 images is 255.
Figure 9-1: Morphological Processing of a Binary Image
The following figure illustrates this processing for a grayscale image. The figure shows the processing of a particular pixel in the input image. Note how the function applies the rule to the input pixel's neighborhood and uses the highest value of all the pixels in the neighborhood as the value of the corresponding pixel in the output image.
การแปล กรุณารอสักครู่..