featureAnd
Top  Previous  Next

featureAnd ( integer Input, integer Mask, integer Output [, integer Phase =1 ] )

Use this function to extract the features (blobs) that match foreground pixels in another image. Both the Input and Mask images should be of the multiphase type. The function works by identifying foreground objects in the source image and matching them against corresponding pixels in the Mask image. If any pixel of the object matches a mask pixel that belongs to the selected Phase, the entire object is copied to the Output image.

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.  
 
Mask  
 
An integer between 1 and 116 specifying the frame number of the multiphase image used as a mask. 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.  
 
Phase  
 
the phase that will be used for masking. Only those objects in the input image having the corresponding pixels in the mask image equal to this value will be extracted.  
Default value: 1  
 
Connect  
 
An 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  

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, creates a mask image with a straight line and performs the feature-and operation extracting the objects crossed by the line:  
 
setCurDir ("samples")  
loadIm(1,"sample4.IWD")  
threshGauss(1,1,0,1,0)  
createIm (2,IM_MULTI,512,512)  
drawLine(2, 63, 28, 459, 110, 1)  
featureAnd(1,2,3)