prune
Top  Previous  Next

prune ( integer Input, integer Output [, integer Length =0 ] )

Use this function to reduce the size of branches or completely remove them from the skeletons of objects in a multiphase image. The function works by finding end-point pixels and successively removing them from the image.

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.  
 
Length  
 
An integer specifying the length of the branches to be removed, which is equivalent to the number of pruning iterations. If this parameter is zero, the function will continue to iterate until the objects are completely pruned.  
Default value: -1  
 
Error flags

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

Example
 
This set of statements binarizes a sample image, extracts its skeleton and then prunes the skeleton:  
 
setCurDir ("samples")  
loadIm (1,"sample4.iwd")  
threshold(1,1,M_PRESET,0.,113.,TRUE,FALSE)  
thin (1,2)  
prune (2,3)