Multiphase Threshold  
Top  Previous  Next


Menu:   Processing > Threshold ->Binary  
Script   threshMulti  

Use this command to separate objects of interest from the background and segment them into different phases by specifying the ranges of pixel intensities that represent each phase. The output image is created as a multiphase one with a selected number of phases. Input pixels whose values fall within the range specified for a certain phase are converted into the output pixels with values equal to the corresponding phase number, while the pixels whose values are outside the intensity ranges specified for any of the phases are assigned the zero level. See Image Types
for more details.

You can adjust the range of intensities for the foreground pixels interactively and preview the segmented areas in real time, as the color overlays highlight the objects of interest in the input image.

If you choose this command, the Multiphase Threshold dialog box will appear with the following options:

Input
 
Displays the input image frame number. If you want to apply thresholding to another image, type or select the corresponding value. Note that if the input image is a color one, it will be automatically converted and displayed as a grayscale image while the Multiphase Threshold dialog box is open.  

Output
 
Displays the number of the frame in which the segmented image will be created. Depending on the Preferences. ImageWarp will set it either to the first available value or to the Input frame number. Type or select another value if you want the output image to be created in a different frame.  

Histogram display
 
Displays the luminance histogram for the input image or its selection. As you adjust the minimum and maximum levels for the foreground pixels, two red markers move over the histogram graph visually representing the boundaries of the threshold range.  

Y-scale
 
Use the Y-scale slider located on the right side of the Histogram display to change the scale of the Y-axis of the histogram chart. The default range of the Y-axis is determined by the largest frequency value.  

Intensity ruler
 
Displays the luminance scale and highlights the intensity ranges for selected phases. Use the Intensity ruler as a visual reference while adjusting the threshold levels. To move the threshold range for a specific phase along the intensity scale, locate on the ruler the area highlighted with the color of the phase of interest, click in it and drag to the desired position. The sliders' positions and entries in the boxes on the left of the sliders will update accordingly.  
 
Mode
 
Lets you choose the mode for selecting the threshold ranges.  
In the Dialog mode, the minimum and maximum levels for the threshold range are selected by moving the two sliders located at the bottom of the dialog box. As you move the sliders, the color overlay on the input image corresponding to the active phase expands or contracts. The numbers in the boxes on the left and the color markers in the histogram are updated accordingly, displaying the intensity range for the active phase. You can also edit the threshold levels by selecting or typing the desired values in the boxes on the left of the sliders and pressing ENTER, or by dragging the highlighted areas on the Intensity ruler.  
In the Mouse mode, the threshold range for the active phase is selected by moving the mouse in the horizontal and vertical directions. Moving the mouse upward and downward widens or narrows the threshold range respectively. Moving the mouse rightward or leftward raises or lowers the threshold range respectively. As the sliders are moved, the color overlay on the input image expands or contracts, highlighting the pixels corresponding to the active phase. Note that if the MultiThreshold function was called from the script with the MOUSE mode selected, the dialog box will not appear. . Press INSERT to add a new phase. Press 1, 2,…,9 to switch to a specific phase. Press DELETE to remove the last added phase. Press the left mouse button to apply the threshold to the image. Press the right mouse button to switch to the Dialog mode.  
Select the Preset mode if you want to generate a script command that will perform automatic segmentation without displaying the Threshold dialog box. Select the threshold ranges by using the sliders or boxes on the right of the sliders, and then click Apply. Make sure the Script Editor is in the Record mode. The MultiThreshold function will be recorded into the script with the selected levels, and its Mode parameter will be set to AUTO.  

Manual sampling
 
Click this button to sample the image and create the segmentation range based on the values of the sampled pixels. When you move the cursor over the input image, the cursor will take shape of an eyedropper. Position the cursor over the area you want to define as belonging to the selected phase and click the left mouse button. If the segmentation range for the current image has not been assigned yet, it will be set to the range of the pixel values within the Sampling window. Otherwise, the currently selected range will be expanded to include the average intensity of the area under the cursor.  

Undo sampling
 
Click this button to undo the last change in the foreground range made by the manual sampling.  

Sampling window
 
Lets you select the size of the square area covered by the manual sampling. The size of side of the square is measured in pixels, and it can be set to the length from 1 to 15.  

Add phase
 
Click this button to add a new phase. The new phase will encompass the entire range of the luminance scale and become active. The overlay color related to the new phase appears in the pain on the right and coincides with the correspondent color from the multiphase palette. Note that the pixels in the image that fall within the intensity ranges of more than one phase are assigned the lowest phase that contains the pixels.  
 
Select phase
 
Lets you select the active phase. The color related to the new phase will appear in the square on the right, and the marker of the same color will show up in the Histogram window indicating the positions of the maximum and minimum thresholds for the phase. When a phase becomes active, you will be able to adjust its threshold range by using the sliders, or by typing or selecting the desired values in the boxes on the left of the sliders. Note that you can also make a phase active by clicking the area of the related color on the Intensity ruler.  
 
Delete phase
 
Click this button to remove the last added phase.  

Preview mode
 
Select one of the following modes for previewing foreground pixels:  
 
Opaque  
 
The pixels corresponding to the objects of interest in the image are highlighted with the solid colors representing the selected phases.  
 
Transparent  
 
The pixels corresponding to the objects of interest are highlighted with the transparent colors representing the selected phases. In this mode, you can see the original objects through the transparent overlay.  
 
Record
 
Inserts the corresponding script command into the Script Editor without applying the function.