Image Processing Toolkit User Guide > Reference J–Z > SHIFT_EDGE Function (PV-WAVE Extreme Advantage)
  

SHIFT_EDGE Function (PV-WAVE Extreme Advantage)
Performs edge enhancement on an image using either the shift and subtract, or the shift and XOR technique.
Usage
result = SHIFT_EDGE(image[, subt_or_xor])
Input Parameters
image—A 2D or 3D array containing an image; image, row or pixel-interleaved images; or a volume.
subt_or_xor—(optional) A scalar specifying the enhancement technique to use:
*0—Exclusive OR technique
*1—Subtraction technique (default)
When the exclusive OR shift technique is used (subt_or_xor = 0), the input parameter image must be a byte, integer, or long data type; no other data types are valid for the exclusive OR technique. (Default: 1, the subtraction technique)
Returned Value
result—An array containing the enhanced data.
Keywords
Intleave—A scalar string indicating the type of interleaving of 3D image arrays. Valid strings and the corresponding interleaving methods are:
*'pixel'—The input array arrangement is (pxy) for p  pixel-interleaved images of x-by-y.
*'row'—The 3D image array arrangement is (xpy) for p  row-interleaved images of x-by-y.
*'image'—The 3D image array arrangement is (xyp) for p  image-interleaved images of x-by-y.
*'volume'—The input image array is treated as a single entity.
ShiftArrAn array of shift parameters. For an image parameter of m dimensions, ShiftArr contains m elements specifying the shift parameter for each dimension. The ShiftArr keyword can be used in place of the Xshift and Yshift keywords.
XshiftThe distance, in pixels, to shift image in the x-direction. The Xshift keyword can also be used as an array defining the shift in the x-direction for each image when image is a 2D array or 3D image-interleaved array. (Default: 1 pixel)
YshiftThe distance, in pixels, to shift image in the y-direction. The Yshift keyword can also be specified as an array defining the shift in the y-direction for each image when image is a 2D array or 3D image-interleaved array. (Default: 1 pixel)
Discussion
When the subtraction operation is used, the SHIFT_EDGE function creates an embossing effect on grayscale images.
The direction and amount of the shift reveals specific details in an otherwise jumbled image. For example, a horizontal shift can highlight a specific pattern in an image; likewise, for a vertical shift.
Typically, a single-element (one pixel) shift produces more pronounced edges, while shifts of more than ten elements begin to blur features in the image.
Examples
These examples are a collection of partial code designed to illustrate the many uses of the SHIFT_EDGE function and its keywords.
In this example, the SHIFT_EDGE function is used to highlight the edges to the left of each feature in the mandrill image.
mandril_edge = SHIFT_EDGE(mandril, Yshift = 0)
Here, SHIFT_EDGE is used to highlight the edges below and to the left of each feature:
mandril_edge = SHIFT_EDGE(mandril)
To perform edge enhancement on a group of images in one function call, do the following:
edge_set = SHIFT_EDGE(images, Intleave = 'images')
edge_image = SHIFT_EDGE(image, 0, Xshift = 2, Yshift = 2)
Another way to do this is:
edge_image = SHIFT_EDGE(image, 0, ShiftArr = [2, 2])
Here is an example using a 5D array:
arr5D = INDGEN(20, 5, 7, 3, 2)
edge_5D = SHIFT_EDGE(arr5D, ShiftArr = [1, 2, 1, 1, 2])
See Also
CANNY, IPCONVOL
In the PV‑WAVE Reference:  ROBERTS,  SOBEL

Version 2017.0
Copyright © 2017, Rogue Wave Software, Inc. All Rights Reserved.