Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ xil_edge_detection(3) — SunOS 5.6

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

xil_convolve(3)

xil_edge_detection(3)

NAME

xil_edge_detection − detect edges within an image

SYNOPSIS

#include <xil/xil.h>

void xil_edge_detection (XilImage src,

XilImage dst,
XilEdgeDetection edge_detection_method);

DESCRIPTION

This function detects edges within an image using the method specified by the edge_detection_method parameter.  src is the source image handle.  dst is the destination image handle. 

edge_detection_method is an enumeration type that specifies the edge detection algorithm to be used in the operation.  Currently, the only available method is XIL_EDGE_DETECT_SOBEL, which uses the following masks:

   Vertical    Horizontal
 -0.5  0.0  0.5-0.5  -1.0  -0.5
-1.0  0.0  1.0 0.0   0.0   0.0
-0.5  0.0  0.5 0.5   1.0   0.5

The XIL_EDGE_DETECT_SOBEL method performs two correlation operations on the source image, using the vertical filter to detect vertical edges and the horizontal filter to detect horizontal edges.  This yields the intermediate images a and b.  It then squares pixel values in a and b, yielding intermediate images c and d.  To form the final destination image, it takes the square root of c + d.  The correlation operations duplicate the source-image edges during the correlation, similar to using the XIL_EDGE_EXTEND edge detection method on the xil_convolve(3) function. 

ROI Behavior

An ROI (region of interest) is used as a read mask for key pixels in the source image and as a write mask in the destination image. The edge detection operation may access data outside a source ROI as long as the key pixel remains inside. 

ERRORS

For a complete list of XIL error messages by number, consult Appendix B of the XIL Programmer’s Guide. 

EXAMPLES

This example performs edge detection operation on src image using Sobel algorithm, and writes the result into dst. 

XilImage src, dst;
xil_edge_detection(src, dst, XIL_EDGE_DETECT_SOBEL);

NOTES

Source and destination images must be the same data type and have the same number of bands. The images need not have the same width and height.  This operation cannot be performed in place. 

SEE ALSO

xil_convolve(3)

SunOS 5.6  —  Last change: 04 March 1994

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026