Image Analyst MKIIImage Processing Principles
HomeWorkflowImage Processing PrinciplesFunctions GlossaryPipelines GlossaryProtocolsQuick How ToSearch

website security

Binarization, Thresholding, Segmentation


The conversion of a gray scale image into black or white, so called binary image is called binarization. The simplest way of binarization is thresholding; setting pixels to white (or 1) if the gray value is equal or greater than the threshold or setting to black (0) if smaller. When using adaptive thresholding, the level of threshold is determined automatically based on the content of the image or image sequence. A well-established way of automatic threshold determination is Otsu’s method. An alternative method is using a given percentile of the intensity histogram as threshold value. In contrast locally adaptive thresholding uses a level that varies object by object in the image. This can distinguish bright spots, shapes over varying background.

Examples are shown for adaptive and locally adaptive thresholding of an image with uneven background (for more details see Workflow/Thresholding):

Gray scale image to be thresholded and its cross-section intensities along the indicated ROI
Test image (saved as 16bit TIF).
Unifrom thresholding (from the bottom)
Binarized image
Locally adaptive thresholding (from the top)
Binarized image. Right: green dots indicate local maxima

Preparation of images for binarization:

However the above illustrated locally adaptive thresholding technique (FThreshold /Threshold from local max/min=Bound Maxima uniformly) powerfully suppresses effects of inhomogeneous background, it is often beneficial to pre-process images before binarization:

  • Background removal by high pass filtering
  • Smoothing
    • FWiener filter - the use of Wiener filter is advised as this filter provides strong noise suppression while smudges sharp edges only little, and faster than the Anisotropic diffusion filter below.
    • FAnisotropic diffusion filter
    • F2D Median filter
    • F2D Savitzky-Golay filter
  • Masking unwanted details to prevent their effect on the calculated threshold value.


Segmentation identifies individual objects in the image. Objects in the original image are contiguous areas of the image, that can be distinguished based on some of their properties, e.g. are brighter or dimmer than the surrounding areas. In the segmented image objects are marked with numbers, so the first object consist of pixels of '1', the second pixels of '2'. Possible uses of segmentation in Image Analyst MKII

  • To measure number of objects or size and shape parameters of each object or statistically
  • To measure intensities of other images over the pixels corresponding to the objects obtained by segmentation
  • To binarize images in a controlled manner, allowing/rejecting objects based on size or morphological criteria

In the simplest case, binarized images are segmented, defining objects as contiguous areas of ones (white pixels). This can be performed by the FSimple Segmentation function. The FAdvanced Segmentation function of Image Analyst performs identifies object being local fluorescence maxima (or minima) and their boundaries are determined by locally adaptive thresholding, while the separation of the objects from each other by the Watershed algorithm.

When working with an image series (x,y,t or x,y,z), segmentation can be performed frame-by-frame independently, or in 3D identifying the objects that overlap each other frame to frame as the same object. This feature is useful to plot intensities over objects that are moving or changing shape during the time lapse.

Object can be discarded from the segmentation using segmentation classifiers. In the Image Analyst MKII using the FSet Segmentation Classifiers function before segmentation will result in deletion of objects (filling up with zeros) that do not pass the classifiers.