Pharmaceutical companies, material scientists, and industrial manufacturers, among others, often turn to microscopic image analysis techniques to collect information about the particulate within a material of interest. Often, these techniques attempt to capture size and shape information of potentially many thousands of particles in a single analysis to ensure a statistically sound data set. To capture larger quantities of particles at once and improve repeatability, these processes are often automated so that a user may prepare the desired material for analysis and then allow the instrument to take over the counting and data collection.
How then is an automated process made to determine what objects in an image frame are a particle of interest and what is background? As computers cannot intuit the difference between what is a particle to be analyzed and what is merely background, a process called image segmentation is used to instruct the instrument on what to target based on parameters the software understands. While there are many different algorithms designed to handle image segmentation, depending upon which instrument or program is being used to analyze images of the material, a common solution (and the one present in the instruments here at Particle Technology Laboratories) is thresholding.
What is Thresholding?
ImageJ, a Java-based image processing program in the public domain, which is frequently used in a wide range of industries and analytical techniques, describes thresholding as “a technique for dividing an image into two (or more) classes of pixels, which are typically called ‘foreground’ and ‘background’”¹. Essentially, thresholding is a simple yet effective method of segmenting pixels of interest from the background pixels in a digital image, by setting a fixed intensity value from a set value scale above and below which all pixels are separated. The value beyond which pixels are considered particles instead of background is the ‘threshold’, where the instrument switches how each pixel is categorized.
When separating foreground from background, an analytical instrument may represent the captured frame as a binary image, where each pixel above the chosen intensity value is designated a new simplified value of 1, and each pixel below the value is designated 0 (often represented visually as black and white). While some image analyzers may use a different range of values, both the Malvern Morphologi 4 and the ImageJ software use a greyscale range from 0 (black) to 255 (white), with all values between representing the various shades of grey.

Figure 1. ImageJ thresholding user interface as it appears in the ImageJ User Guide, where an intensity value of 196 has been chosen on a 255-point scale to separate pixels.²
Certain programs, such as MATLAB, are capable of color thresholding, wherein such factors as pixel brightness, blue-yellow values, and red-green values may be considered when attempting to segment portions of an image, see Figure 2, while ImageJ utilizes brightness and individually set color contrast values for such full color images.

Figure 2. ImageJ thresholding user interface as it appears in the ImageJ User Guide.³
With many instruments and sample types, color thresholding is not available or may simply not be the ideal option; therefore, an image may instead be converted into the previously mentioned greyscale. For digital microscopic analyses, Particle Technology Labs utilizes a Malvern Morphologi 4 static image analyzer, which thresholds using greyscale values. See Figure 3, where the thresholding interface for this instrument displays a threshold value of 95, which has been set to capture the objects in frame while designating the grey surrounding as background (represented in blue).

Figure 3. Particle thresholding user interface as it appears in the Malvern Morphologi 4 standard operating procedure set-up.
Use with the Malvern Morphologi 4
The Malvern Morphologi 4 static image analyzer utilized here at Particle Technology Labs displays to its user an image wherein particles of interest are typically left visually unchanged, but the pixels above the set threshold value are shown in blue, as seen in Figure 3 as part of the thresholding value selection interface. In practice, this most often means that the Morphologi 4 will identify ‘particles’ as being contiguous collections of dark pixels, and the background as the remaining light grey, see Figure 4, where a solid powder has been dry dispersed onto a glass plate.

Figure 4. Flour dispersed dry onto a glass plate – (5x objective)
Since the powder is opaque, while both the surrounding air and glass plate are translucent, the high contrast in relative light intensity makes it simple to set a greyscale threshold value to determine which pixels are the powder to be analyzed, and which are not. Options do exist to ‘invert’ the thresholding for situations where the particles instead appear as light objects in a much darker background. To ensure that individual pixels that are coincidentally darker than their neighbors do not become mistaken for minute particles, it is necessary to set a minimum pixel count per particle. Objects smaller than that minimum pixel count will then not be counted by the instrument.
Global Versus Local Thresholding
Thresholding, as it has been discussed thus far, where a single value is selected by the user to act as the separation between particle and background, may often be called ‘global thresholding’. This refers to the fact that the thresholding is applied at the same value globally throughout the analysis. Additional options often exist for ‘local thresholding’, wherein thresholding values are automatically determined by the software for each particle, allowing for more nuanced particle edge detection when particles are varied in intensity.
When the Morphologi 4 performs local thresholding, the threshold values are determined algorithmically by the instrument itself through comparing the relative light intensity of each pixel to that of its neighbors, reducing the necessary input from the user. Global thresholding remains ideal when the edges of the particles being analyzed are indistinct or otherwise blend in with the background matrix too well for local thresholding to easily or consistently identify the particle’s boundaries. See Figure 5, where semi-translucent glass microspheres are shown, whose outer edges are slightly indistinct and whose sizing is therefore subject to the exact threshold value chosen.

Figure 5. 20µm Reference Material Glass Microspheres shown ‘as-is’ (top), and with a greyscale threshold value of 100 (bottom) – (20x objective)
Some materials may also contain particles large enough to require more than one image frame to capture, which, on the Morphologi 4, requires not only consistent thresholding but the same threshold value to ensure that no segment of the imaged particle is improperly captured, especially if the particle appears variably lighter/darker across its form.
The Morphologi 4 can utilize global thresholding when necessary for a given sample; however, local thresholding remains a preset option for image segmentation. Local thresholding is preferred when possible because automating the detection of particles serves to limit any potential difference in thresholding between users, meaning more consistent particle sizing results across multiple analyses and users. So long as there remains detectable contrast between particles and their background medium in the captured images, local and global thresholding each provide the instrument with the means to properly segment images. Even in less clearly distinguishable situations, the Morphologi 4 is equipped with a “low contrast” variant that allows local thresholding to remain effective at analyzing a wider range of materials.
Thresholding, both global and local, allows for the Morphologi 4 to ‘see’ the particles it is meant to analyze, and is otherwise useful in image segmentation software in ensuring the background is separable from the foreground. Beyond the Morphologi 4, there remains a myriad of thresholding techniques of varying complexities beyond those mentioned here, each with its own best use cases. Thresholding itself is but one of many aspects to consider when attempting image analysis of any kind, including the magnification of the image, light intensity of the objects of interest, pixel resolution, etc, all of which require thorough investigation.
Contact us for a quote today, and see how image analysis might work for you!
By Josh Love, Particle Characterization Chemist II.
Citations:
¹ Thresholding. ImageJ Wiki. (n.d.-a). https://imagej.net/imaging/thresholding
² ImageJ user guide – IJ 1.46R | image menu. (n.d.). https://imagej.net/ij/docs/guide/146-28.html
³ The MathWorks, Inc. (n.d.). Segment image and create mask using color thresholder – MATLAB & simulink. https://www.mathworks.com/help/images/image-segmentation-using-the-color-thesholder-app.html
