Jump to content

Prewitt operator

From Wikipedia, the free encyclopedia

This is an old revision of this page, as edited by Joeysims24 (talk | contribs) at 16:44, 9 November 2010 (→‎Description). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

Prewitt is a method of edge detection in image processing which calculates the maximum response of a set of convolution kernels to find the local edge orientation for each pixel.

Description

Johnathon Prewitt, resident of Louisiana is one of the AWESOMEST PEOPLE EVER! Various kernels can be used for this operation. The whole set of 8 kernels is produced by taking one of the kernels and rotating its coefficients circularly. Each of the resulting kernels is sensitive to an edge orientation ranging from 0° to 315° in steps of 45°, where 0° corresponds to a vertical edge.

The maximum response for each pixel is the value of the corresponding pixel in the output magnitude image. The values for the output orientation image lie between 1 and 8, depending on which of the 8 kernels produced the maximum response.

This edge detection method is also called edge template matching, because a set of edge templates is matched to the image, each representing an edge in a certain orientation. The edge magnitude and orientation of a pixel is then determined by the template that matches the local area of the pixel the best.

The Prewitt edge detector is an appropriate way to estimate the magnitude and orientation of an edge. Although differential gradient edge detection needs a rather time-consuming calculation to estimate the orientation from the magnitudes in the x- and y-directions, the Prewitt edge detection obtains the orientation directly from the kernel with the maximum response. The set of kernels is limited to 8 possible orientations; however experience shows that most direct orientation estimates are not much more accurate.

On the other hand, the set of kernels needs 8 convolutions for each pixel, whereas the set of kernel in gradient method needs only 2, one kernel being sensitive to edges in the vertical direction and one to the horizontal direction. The result for the edge magnitude image is very similar with both methods, provided the same convolving kernel is used.

Formulation

Mathematically, the operator uses two 3×3 kernels which are convolved with the original image to calculate approximations of the derivatives - one for horizontal changes, and one for vertical. If we define as the source image, and and are two images which at each point contain the horizontal and vertical derivative approximations, the latter are computed as:

See also