identify
Top  Previous  Next

identify ( integer Input, integer Output [, integer Connect =1, integer Multiphase =1 ] )

Use this function to identify (label) objects in a binary image or selection. The function works by assigning a unique index value to pixels belonging to the same connected group of pixels. The indexes are assigned sequentially from top to bottom, left to right. Two types of neighborhood can be selected for the operation.

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.  
 
Connect  
 
An optional enumerated integer that describes the neighborhood used for connectivity analysis.  
 
M_4CONN=0 – uses the "city block" neighborhood. The pixels connected diagonally will be considered belonging to different objects.  
M_8CONN=1 – use the "chess board' neighborhood. Any interconnected pixels will be considered belonging to the same object.  
Default value: M_8CONN  
 
Multiphase  
 
An optional boolean integer specifying weather the output image must be of the 16-bit grayscale or multiphase type. Must be one of the following values:  
 
FALSE=0 – creates a 16-bit grayscale output image  
TRUE=1 – creates a multiphase output image which makes an identified image more perceptible due to steep color differences between adjacent levels, but such a mode will use only 8 byte for objects' IDs, restricting their possible values to a range of 1-255.  
Default value: TRUE  
 
 
Error flags

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

Example

This set of statements uses identification to separate objects in a sample image:  
 
setCurDir ("samples")  
loadIm(1,"sample4.IWD")  
threshGauss(1,1,0,1,0)  
erode (1,2,4,PR_CIRCLE)  
ident (2,2,M_8CONN)  
dilate(2,2,4,PR_CIRCLE)