link
Top  Previous  Next

link ( integer Input, integer Output , integer Distance =0 )

Use this command to connect the ends of linear structures in a binary image. The function works by performing a selected number of dilations followed by thinning.

Parameters
 
Input  
 
An integer between 1 and 116 specifying the input image frame number. 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.  
 
Distance  
 
A positive integer specifying the number of dilation steps used to connect the ends of linear structures. This is equivalent to the maximum distance between the objects to be linked.  

Error flags


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

Example

This set of statements draws a line in a binary image, breaks it in two segments and then connects both segments using the link function:  
 
createIm (1,IM_MULTI,400,400)  
drawLine(1, 64, 295, 278, 90, 1, 0, 0, 1)  
drawRect(1, 173, 173, 188, 190, 0, 0, 0, 100, TRUE, 3)  
link(1,2,8)