laplace
Top  Previous  Next

laplace ( integer Input, integer Output [, integer Invert =0, integer Type =1 ] )

Use this function to detect points, lines and edges while suppressing regions of constant gradient by applying the Laplacian operator to an image. The Laplacian is an approximation to the linear second derivative of the intensity:

laplace1  

The approximation is done using a convolution kernel, which depends on the Type value. If an overflow occurs, the result is clipped to the minimum or maximum pixel value for the given image type.

Parameters
 
Input  
 
An integer between 0 and 116 specifying the input image frame number. A value of 0 represents the DMA memory buffer of the video device. Values in the range of 100-116 correspond to hidden frames.  
 
Output  
 
An integer between 1 and 116 specifying the output image frame number. Values in the range of 100-116 correspond to hidden frames.  
 
Invert  
 
A boolean integer specifying if the outcome of the function should be inverted. Must be one of the following values:  
 
FALSE – the direct mode. Uses the kernels described below.  
TRUE – the inverse mode. The sign of the kernel elements is inverted.  
Default: FALSE  
 
Type  
 
An enumerated integer that defines the kernel for the operator. Must be one of the following values:  
 
M_4CONN – the 4-connected kernel  
 
laplace2  
 
M_8CONN – the 8-connected kernel  
 
   laplace3  
 
M_ISOTROP – the isotropic kernel  
 
   laplace4  
 
Default value: M_8CONN  
 
Error flags

ERR_OK  
 
The flag set if successful.  
 
ERR_FAILED  
 
The flag set if failed.  

Example

This set of statements continuously captures an image and performs edge detection by applying the Laplacian operator:  
 
do  
grabIm (0)  
laplace (0, 1, FALSE, M_8CONN)  
loop while getError()=ERR_OK  
 
Remark

A value of 128 is added to the result, i.e., zero crossings occur for 128.