AdaptiveThreshold 

Description

This ImageJ plugin implements the adaptive threshold method of the OpenCV library. Detailed description of the algorithm can also be found on the HIPR2 website.

Adaptive threshold overcomes the limitation of conventional threshold method when the image background or the feature intensities are not homogeneous.

Let's take the dot_blot from ImageJ sample images as an example :

If we want to segment every dots regard less of their intensity via using the default threshold function (global histogram threshold), we either get incomplete dot set or too much background :

However, by using the adaptive threshold, it is possible to extract every dots quite clean with a single step:

Of course, with other advanced filtering method, one can get even cleaner feature extraction. But for many applications, this adaptive threshold method is sufficient and generic to different features.

With the live preview, the selection of thresholding parameters becomes much easier and straightforward just like using the built-in threshold function.

Although looks primitive, image segmentation based on pixel intensity is probably the first and easiest (although not necessarily the best ) solution when we want to separate features from background. As global threshold can be easily compromised by non-homogeneous background value, threshold image pixels based on local instead of global pixel intensity appears to be a robust method to circumvent above issue. It also resembles how human vision distinguish objects from background, we are more sensitive to local intensity difference then global intensity.

Downloads

The main plugin file adaptiveThr_.class.

And required javacv library files: javacv.jar, javacpp.jar, opencv.jar

And platform-dependent library files:

Put above jar files into your ImageJ plugins folder. After restarting ImageJ, you will find adaptiveThr under the plugins menu.

For ImageJ running on Java 1.8, or having any javacv library compatibility issues, please download the updated plugin file and library files at the github repository instead.

For FIJI users: use the built-in update manager (ImageJ's Menu>Help>Update...), and add the following URL via "Manage update sites">"Add update site"

https://sites.imagej.net/adaptiveThreshold/

System Requirement

Tested on ImageJ 1.48+.

How to Use

It only works on 8-bit grayscale image or stack right now.

Upon clicking the adaptiveThr, a dialog box will show up :

By selecting the "Preview" option, you can see directly how your parameters affect your threshold result :

In general, the block size should correspond to your feature size, and the lower the subtraction value is, the less the background/feature pixel will be kept.

Contact

Any question or comment, please contact Qingzong TSENG (qztseng at gmail.com).

Back to the main plugin page