PREWITT

The PREWITT function returns an approximation to the Prewitt edge enhancement operator for images,

where (j, k) are the coordinates of each pixel Fjk in the Image. This is equivalent to a convolution using the following masks:

All of the edge points in the result are set to zero.

Examples

If the variable myimage contains a two-dimensional image array, a Prewitt sharpened version of myimage can be displayed with the command:

TVSCL, PREWITT(myimage)

Syntax

Result = PREWITT(Image)

Return Value

PREWITT returns a two-dimensional array of the same size as Image. If Image is of type byte or integer then the result is of integer type, otherwise the result is of the same type as Image.

Note: To avoid overflow for integer types, the computation is done using the next larger signed type and the result is transformed back to the correct type. Values larger than the maximum for that integer type are truncated. For example, for integers the function is computed using type long, and on output, values larger than 32767 are set equal to 32767. The calculation SQRT(Gx x Gx + Gy x Gy) is accomplished in double precision floating point.

Arguments

Image

The two-dimensional array containing the image to which edge enhancement is applied.

Keywords

None.

Version History

6.4

Introduced

See Also

EDGE_DOG, EMBOSS, LAPLACIAN, ROBERTS, SHIFT_DIFF, SOBEL