Thresholding is a technique for dividing an image into two (or more) classes of pixels, which are typically called “foreground” and “background.”
Global thresholding works by choosing a value cutoff, such that every pixel less than that value is considered one class, while every pixel greater than that value is considered the other class.
ImageJ provides several built-in methods for automatically computing a global threshold. For details, see:
- Documentation for the [/ij/docs/guide/146-28.html#sub:Threshold…%5BT%5D Threshold…] command.
- The Auto Threshold plugin page
Local thresholding techniques adapt the threshold value on each pixel to the local image characteristics.
The ImageJ Ops project provides algorithms for both global and local thresholding.
How do I know whether my threshold is correct?
In short, you can’t. It will always be, to some extent, in the eye of the user/observer/scientist and will also be impacted by empirically collected knowledge. The basic problem of deciding if a threshold (or in general an extraction method) is “good” needs a “ground truth”. But such a ground truth is not naturally existing and is always created in one or the other way by a human. So, describing which method you use—and/or showing a comparison with other methods—is probably the best you can do to enable a statement on the quality of the extraction.
For more detailed information on thresholding and image segmentation basics and some quality evaluation see the Principles page.