Difference between revisions of "Auto Local Threshold"

(New page: {{Infobox Plugin | software = ImageJ | name = Auto Local Threshold | author = Gabriel Landini, plus others (see below) | maintainer ...)
 
(Add URL and DOI for Phansalkar)
 
(63 intermediate revisions by 7 users not shown)
Line 1: Line 1:
{{Infobox Plugin
+
{{ComponentStats:sc.fiji:Auto_Threshold}}This plugin binarises 8-bit images using various '''local'''  thresholding methods. By 'local' here is meant that the threshold is computed for each pixel according to the image characteristings within a window of radius '''r''' (in pixel units) around it. The segmented phase is always shown as white (255).
| software              = ImageJ
 
| name                  = Auto Local Threshold
 
| author                = Gabriel Landini, plus others (see below)
 
| maintainer            = Gabriel Landini (G.Landini at bham. ac. uk)
 
| filename              = included in Auto_Threshold.jar
 
| source                = (1 file)
 
| latest version        = v1.7 (14 April 2009)
 
| status                = active
 
}}
 
 
 
== Purpose ==
 
This plugin binarises 8-bit images using various global (histogram-derived) thresholding methods.
 
 
 
  
 +
For '''global''' thresholding rather than local, see  the [[Auto Threshold]] plugin.
 
== Installation ==
 
== Installation ==
'''ImageJ''': requires v1.42m or newer. Copy the Auto_Threshold.jar file from http://www.dentistry.bham.ac.uk/landinig/software/auto_threshold.jar into the ImageJ/Plugins folder and either restart ImageJ or run the '''Help>Update Menus''' command. After this a new command should appear in '''Image>Adjust>Auto Local Threshold'''.
+
'''ImageJ''': requires v1.42m or newer. Download [http://maven.imagej.net/service/local/artifact/maven/redirect?r=releases&g=sc.fiji&a=Auto_Threshold&v=RELEASE&e=jar Auto_Threshold-X.Y.Z.jar] and copy it into the ImageJ/plugins folder and either restart ImageJ or run the '{{bc | Help | Update Menus}}' command. After this a new command should appear in '{{bc | Image | Adjust | Auto Local Threshold}}'.
  
 
'''Fiji''': this plugin is part of the Fiji distribution, there is no need to download it.
 
'''Fiji''': this plugin is part of the Fiji distribution, there is no need to download it.
Line 22: Line 10:
 
'''Method''' selects the algorithm to be applied (detailed below).
 
'''Method''' selects the algorithm to be applied (detailed below).
  
The '''radius''' sets the radius of the local domain over which the threshold will be computed,
+
The '''radius''' sets the radius of the local domain over which the threshold will be computed.
 
 
  
 
'''White object on black background''' sets to white the pixels with values above the threshold value (otherwise, it sets to white the values less or equal to the threshold).
 
'''White object on black background''' sets to white the pixels with values above the threshold value (otherwise, it sets to white the values less or equal to the threshold).
Line 29: Line 16:
 
'''Special parameters 1 and 2''' sets specific values for each method. Those are detailed below for each method.
 
'''Special parameters 1 and 2''' sets specific values for each method. Those are detailed below for each method.
  
It you are processing a stack, one additional options is available: '''Stack''' can be used to process all the slices.
+
It you are processing a stack, one additional option is available: '''Stack''' can be used to process all the slices.
  
  
Line 43: Line 30:
  
  
[[Image:Epithm.png]]
+
[[Image:epithm2.png]]
  
 
Try all methods.
 
Try all methods.
Line 52: Line 39:
 
Implements Bernsen's thresholding method.  Note that this implementation uses circular windows instead of rectangular in the original.
 
Implements Bernsen's thresholding method.  Note that this implementation uses circular windows instead of rectangular in the original.
  
'''Parameter 1''': is the ''contrast threshold''. The default value is 15. Any number different than 0 will change the value.
+
'''Parameter 1''': is the ''contrast threshold''. The default value is 15. Any number different than 0 will change the default value.
  
 
'''Parameter 2''': not used, ignored.  
 
'''Parameter 2''': not used, ignored.  
  
The method uses a user-provided contrast threshold. If the local contrast (max-min within the radius of the pixel) is smaller than the contrast threshold, the pixel is labelled
+
The method uses a user-provided ''contrast threshold''.  
can be found in Venkateswarluh and Boyle.
+
If the ''local contrast'' (max-min) is above or equal to the ''contrast threshold'', the ''threshold'' is set at the ''local midgrey value'' (the mean of the minimum and maximum grey values in the local window).  
The threshold is set at the midgrey value (the mean of the minimum and maximum grey values in the local
+
If the ''local contrast'' is below the ''contrast threshold'' the neighbourhood is considered to consist only of one class and the pixel is set to object or background depending on the value of the midgrey.
window). If the ''local contrast'' (max-min) is below a certain ''contrast threshold'' the neighbourhood is considered to consist only of one class.
 
  
 
  if ( local_contrast < contrast_threshold )
 
  if ( local_contrast < contrast_threshold )
 
   pixel = ( mid_gray >= 128 ) ? object :  background
 
   pixel = ( mid_gray >= 128 ) ? object :  background
 
  else
 
  else
   pixel = (pixel >= mid_gray ) ? object : background
+
   pixel = ( pixel >= mid_gray ) ? object : background
  
  
Line 85: Line 71:
 
| volume = 13(1)
 
| volume = 13(1)
 
| pages = 146-165
 
| pages = 146-165
| url = http://citeseer.ist.psu.edu/sezgin04survey.html
+
| url = http://webdocs.cs.ualberta.ca/~nray1/CMPUT605/track3_papers/Threshold_survey.pdf
 
}}
 
}}
  
 
Based on ME Celebi's fourier_0.8 routines [http://sourceforge.net/projects/fourier-ipal] and [http://www.lsus.edu/faculty/~ecelebi/fourier.htm].
 
Based on ME Celebi's fourier_0.8 routines [http://sourceforge.net/projects/fourier-ipal] and [http://www.lsus.edu/faculty/~ecelebi/fourier.htm].
  
 +
=== Contrast ===
 +
Based on a simple contrast toggle. Sets the pixel value to either white (255) or black (0) depending on whether its current value is closest to the local maximum or minimum respectively. The procedure is an extreme case of Toggle Contrast Enhancement, see for example:
  
=== Mean ===
+
* {{Citation
This selects the threshold as the mean of the local greyscale distribution. A variation of this method uses the mean - C, where C is a constant.
+
| last = Soille
 +
| first = P
 +
| year = 2004
 +
| title = Morphological Image Analysis: Principles and applications. Springer
 +
| pages = 259
 +
}}
  
'''Parameter 1''': is the ''C value''. The default value is 0. Any other number will change its value.
 
  
'''Parameter 2''': not used, ignored.  
+
This procedure does not have user-provided parameters other than the kernel radius.
  
=== Median ===
+
=== Mean ===
This selects the threshold as the median of the local greyscale distribution. A variation of this method uses the median - C, where C is a constant.
+
This selects the threshold as the mean of the local greyscale distribution. A variation of this method uses the mean - C, where C is a constant.
 
 
'''Parameter 1''': is the ''C value''. The default value is 0. Any other number will change its value.
 
 
 
'''Parameter 2''': not used, ignored.  
 
  
 +
pixel = ( pixel > mean - c ) ? object : background
  
=== MidGrey ===
+
'''Parameter 1''': is the ''C value''. The default value is 0. Any other number will change the default value.
This selects the threshold as the mid-grey of the local greyscale distribution (i.e. (max + min)/2. A variation of this method uses the median - C, where C is a constant.
 
 
 
'''Parameter 1''': is the ''C value''. The default value is 0. Any other number will change its value.
 
  
 
'''Parameter 2''': not used, ignored.  
 
'''Parameter 2''': not used, ignored.  
  
 +
[http://homepages.inf.ed.ac.uk/rbf/HIPR2/adpthrsh.htm http://homepages.inf.ed.ac.uk/rbf/HIPR2/adpthrsh.htm]
  
  
 +
=== Median ===
 +
This selects the threshold as the median of the local greyscale distribution. A variation of this method uses the median - C, where C is a constant.
  
=== Niblack ===
+
pixel = ( pixel > median - c ) ? object : background
Implements Kapur-Sahoo-Wong (Maximum Entropy) thresholding method:
 
  
* {{Citation
+
'''Parameter 1''': is the ''C value''. The default value is 0. Any other number will change the default value.
| last = Kapur
 
| first = JN
 
| last2 = Sahoo
 
| first2 = PK
 
| last3 = Wong
 
| first3 = ACK
 
| year = 1985
 
| journal = Graphical Models and Image Processing
 
| title = A New Method for Gray-Level Picture Thresholding Using the Entropy of the Histogram
 
| volume = 29(3)
 
| pages = 273-285
 
}}
 
  
Ported from ME Celebi's fourier_0.8 routines [http://sourceforge.net/projects/fourier-ipal] and [http://www.lsus.edu/faculty/~ecelebi/fourier.htm].
+
'''Parameter 2''': not used, ignored.  
  
 +
[http://homepages.inf.ed.ac.uk/rbf/HIPR2/adpthrsh.htm http://homepages.inf.ed.ac.uk/rbf/HIPR2/adpthrsh.htm]
  
=== Mean ===
 
Uses the mean of grey levels as the trhreshold. It is used by some other methods as a first guess threshold.
 
  
* {{Citation
+
=== MidGrey ===
| last = Glasbey
+
This selects the threshold as the mid-grey of the local greyscale distribution (i.e. (max + min)/2. A variation of this method uses the mid-grey - C, where C is a constant.
| first = CA
 
| year = 1993
 
| journal = CVGIP: Graphical Models and Image Processing
 
| title = An analysis of histogram-based thresholding algorithms
 
| volume = 55
 
| pages = 532-537
 
}}
 
  
 +
pixel = ( pixel > ( ( max + min ) / 2 ) - c ) ? object : background
  
=== MinError(I) ===
+
'''Parameter 1''': is the ''C value''. The default value is 0. Any other number will change the default value.
An iterative implementation of Kittler and Illingworth's Minimum Error thresholding. This seems to be more converge more often than the original implementation.
 
  
Nevertheless, sometimes the algorithm does not converge to a solution. In that case a warning is reported to the log window.
+
'''Parameter 2''': not used, ignored.  
The '''Ignore black''' or '''Ignore white''' options might help to avoid this problem.
 
 
 
* {{Citation
 
| last = Kittler
 
| first = J
 
| last2 = Illingworth
 
| first2 = J
 
| year = 1986
 
| journal = Pattern Recognition
 
| title = Minimum error thresholding
 
| volume = 19
 
| pages = 41-47
 
}}
 
Ported from Antti Niemist&ouml;'s Matlab code. See [http://www.cs.tut.fi/~ant/histthresh/ here] for an excellent slide presentation and the original Matlab code.
 
  
 +
[http://homepages.inf.ed.ac.uk/rbf/HIPR2/adpthrsh.htm http://homepages.inf.ed.ac.uk/rbf/HIPR2/adpthrsh.htm]
  
=== Minimum ===
+
=== Niblack ===
Similarly to the Intermodes method, this assumes a bimodal histogram. The histogram is iteratively smoothed using a running average of size 3, until there are only two local maxima. The threshold t is such that yt−1 &gt; yt &lt;&#061; yt+1.
+
Implements Niblack's thresholding method:
  
Images with histograms having extremely unequal peaks or a broad and flat valley are unsuitable for this method.
+
pixel = ( pixel >  mean + k * standard_deviation - c) ? object : background
  
* {{Citation
+
'''Parameter 1''': is the ''k value''. The default value is 0.2 for bright objects and -0.2 for dark objects. Any other number than 0 will change the default value.
| last = Prewitt
 
| first = JMS
 
| last2 = Mendelsohn
 
| first2 = ML
 
| year = 1966
 
| journal = Annals of the New York Academy of Sciences
 
| url = http://www3.interscience.wiley.com/journal/119758871/abstract?CRETRY=1&SRETRY=0
 
| title = The analysis of cell images
 
| volume = 128
 
| pages = 1035-1053
 
}}
 
  
Ported from Antti Niemist&ouml;'s Matlab code. See [http://www.cs.tut.fi/~ant/histthresh/ here] for an excellent slide presentation and the original Matlab code.
+
'''Parameter 2''': is the ''C value''. This is an offset with a default value of 0. Any other number than 0 will change its value. This parameter was added in version 1.3 and is not part of the original implementation of the algorithm. The original algorithm is applied when C = 0.  
 
 
 
 
=== Moments ===
 
Tsai's method attempts to preserve the moments of the original image in the thresholded result.
 
  
 
* {{Citation
 
* {{Citation
| last = Tsai
+
| last = Niblack
 
| first = W
 
| first = W
| year = 1985
+
| year = 1986
| journal = Computer Vision, Graphics, and Image Processing
+
| journal =  
| url = http://portal.acm.org/citation.cfm?id=201578
+
| title = An introduction to Digital Image Processing, Prentice-Hall
| title = Moment-preserving thresholding: a new approach
 
| volume = 29
 
| pages = 377-393
 
 
}}
 
}}
  
 
Ported from ME Celebi's fourier_0.8 routines [http://sourceforge.net/projects/fourier-ipal] and [http://www.lsus.edu/faculty/~ecelebi/fourier.htm].
 
Ported from ME Celebi's fourier_0.8 routines [http://sourceforge.net/projects/fourier-ipal] and [http://www.lsus.edu/faculty/~ecelebi/fourier.htm].
 
  
 
=== Otsu ===
 
=== Otsu ===
Otsu's threshold clustering algorithm searches for the threshold that minimizes the intra-class variance, defined as a weighted sum of variances of the two classes.
+
Implements a local version of Otsu's global threshold clustering. The algorithm searches for the threshold that minimizes the intra-class variance, defined as a weighted sum of variances of the two classes. The local set is a circular ROI and the central pixel is tested against the Otsu threshold found for that region.
 
 
 
* {{Citation
 
* {{Citation
 
| last = Otsu
 
| last = Otsu
Line 223: Line 158:
 
}}
 
}}
  
See also the [http://en.wikipedia.org/wiki/Otsu's_method Wikipedia article on Otsu's method].
+
 
 +
See also the [[wikipedia:Otsu's_method|Wikipedia article on Otsu's method]].
  
 
Ported from C++ code by Jordan Bevik.
 
Ported from C++ code by Jordan Bevik.
  
 
+
=== Phansalkar ===
=== Percentile ===
+
This is a modification of Sauvola's thresholding method to deal with low contrast images.
Assumes the fraction of foreground pixels to be 0.5.
 
 
 
 
* {{Citation
 
* {{Citation
| last = Doyle
+
| last = Phansalskar
| first = W
+
| first = N
| year = 1962
+
| last2 = More
| journal = Journal of the Association for Computing Machinery
+
| first2 = S
| url = http://portal.acm.org/citation.cfm?id=321119.321123
+
| last3 = Sabale
| title = Operation useful for similarity-invariant pattern recognition
+
| first3 = A
| volume = 9
+
| last4 = Joshi
| pages = 259-267
+
| first4 = M
| doi = 10.1145/321119.321123
+
| year = 2011
}}
+
| journal = International Conference on Communications and Signal Processing (ICCSP)
 
+
| url = https://ieeexplore.ieee.org/document/5739305/
Ported from Antti Niemist&ouml;'s Matlab code. See [http://www.cs.tut.fi/~ant/histthresh/ here] for an excellent slide presentation and the original Matlab code.
+
| pages = 218-220
 
+
| title = Adaptive local thresholding for detection of nuclei in diversity stained cytology images.  
 
+
| doi = 10.1109/ICCSP.2011.5739305
=== RenyiEntropy ===
 
Similar to the '''MaxEntropy''' method, but using Renyi's entropy instead.
 
 
 
* {{Citation
 
| last = Kapur
 
| first = JN
 
| last2 = Sahoo
 
| first2 = PK
 
| last3 = Wong
 
| first3 = ACK
 
| year = 1985
 
| journal = Graphical Models and Image Processing
 
| title = A New Method for Gray-Level Picture Thresholding Using the Entropy of the Histogram
 
| volume = 29(3)
 
| pages = 273-285
 
}}
 
 
 
Ported from ME Celebi's fourier_0.8 routines [http://sourceforge.net/projects/fourier-ipal] and [http://www.lsus.edu/faculty/~ecelebi/fourier.htm].
 
 
 
 
 
=== Shanbhag ===
 
 
 
{{Citation
 
| first = Abhijit G.
 
| last =  Shanbhag
 
| title = Utilization of information measure as a means of image thresholding
 
| journal = Graph. Models Image Process.
 
| volume = 56
 
| number = 5
 
| year = 1994
 
| issn = 1049-9652
 
| pages = 414--419
 
| doi = 10.1006/cgip.1994.1037
 
| publisher = Academic Press, Inc.
 
| address = {Orlando, FL, USA},
 
 
}}
 
}}
  
Ported from ME Celebi's fourier_0.8 routines [http://sourceforge.net/projects/fourier-ipal] and [http://www.lsus.edu/faculty/~ecelebi/fourier.htm].
+
In this method, the threshold t is computed as:
  
 +
  t = mean * (1 + p * exp(-q * mean) + k * ((stdev / r) - 1))
  
=== Triangle ===
+
where mean and stdev are the local mean and standard deviation respectively.
This is an implementation of the Triangle method:
+
Phansalkar recommends ''k'' = 0.25, ''r'' = 0.5, ''p'' = 2 and ''q'' = 10. In this plugin, ''k'' and ''r'' are the parameters 1 and 2 respectively, but the values of ''p'' and ''q'' are fixed.
  
*{{Citation
+
'''Parameter 1''': is the ''k value''. The default value is 0.25. Any other number than 0 will change its value.
|author=Zack GW, Rogers WE, Latt SA
 
|title=Automatic measurement of sister chromatid exchange frequency
 
|journal=J. Histochem. Cytochem.
 
|volume=25
 
|issue=7
 
|pages=741–53
 
|year=1977
 
|month=July
 
|pmid=70454
 
|doi=
 
|url=http://www.jhc.org/cgi/pmidlookup?view=long&pmid=70454
 
}}
 
  
Incorporated from from Johannes Schindelin plugin [http://wbgn013.biozentrum.uni-wuerzburg.de/ImageJ/triangle-algorithm.html Triangle_Algorithm].
+
'''Parameter 2''': is the ''r value''. The default value is 0.5. This value is different from Sauvola's because it uses the normalised intensity of the image. Any other number than 0 will change its value.
  
See also: http://www.ph.tn.tudelft.nl/Courses/FIP/noframes/fip-Segmenta.html#Heading118
+
Implemented from Phansalkar's paper description, although this version uses a circular rather than rectangular local window.
  
The Triangle algorithm, a geometric method, cannot tell whether the data is skewed to one side or another, but assumes a maximum peak (mode) near one end of the histogram and searches towards the other end.
+
=== Sauvola ===
This causes a problem in the absence of information of the type of image to be processed, or when the maximum is not near one of the histogram extremes (resulting in two possible threshold regions between that max and the extremes).
+
Implements Sauvola's thresholding method, which is a variation of Niblack's method
The algorithm was extended to find out on which side of the max peak the data goes the furthest, and searches the threshold in largest range.
 
  
 +
pixel = ( pixel > mean * ( 1 + k * ( standard_deviation / r - 1 ) ) ) ? object : background
  
=== Yen ===
+
'''Parameter 1''': is the ''k value''. The default value is 0.5. Any other number than 0 will change the default value.
Implements Yen's thresholding method from:
 
  
*{{Citation
+
'''Parameter 2''': is the ''r value''. The default value is 128. Any other number than 0 will change the default value
| author = Yen JC, Chang FJ, Chang S
 
| title = A New Criterion for Automatic Multilevel Thresholding
 
| journal = IEEE Trans. on Image Processing
 
| volume = 4
 
| issue = 3
 
| pages = 370-378
 
| year = 1995
 
| doi = 10.1109/83.366472
 
| url=http://ieeexplore.ieee.org/xpl/freeabs_all.jsp?arnumber=366472
 
| issn = 1057-7149
 
}}
 
  
 
* {{Citation
 
* {{Citation
| last = Sezgin
+
| last = Sauvola
| first = M
+
| first = J
| last2 = Sankur
+
| last2 = Pietaksinen
| first2 = B
+
| first2 = M
| year = 2004
+
| year = 2000
| journal = Journal of Electronic Imaging
+
| journal = Pattern Recognition
| title = Survey over Image Thresholding Techniques and Quantitative Performance Evaluation
+
| title = Adaptive Document Image Binarization
| volume = 13(1)
+
| volume = 33(2)
| pages = 146-165
+
| pages = 225-236
| url = http://citeseer.ist.psu.edu/sezgin04survey.html
+
|url = http://www.ee.oulu.fi/research/mvmp/mvg/files/pdf/pdf_24.pdf
 
}}
 
}}
  
 
Ported from ME Celebi's fourier_0.8 routines [http://sourceforge.net/projects/fourier-ipal] and [http://www.lsus.edu/faculty/~ecelebi/fourier.htm].
 
Ported from ME Celebi's fourier_0.8 routines [http://sourceforge.net/projects/fourier-ipal] and [http://www.lsus.edu/faculty/~ecelebi/fourier.htm].
 
 
 
 
  
  
 
[[Category:Plugins]]
 
[[Category:Plugins]]
 
[[Category:Segmentation]]
 
[[Category:Segmentation]]

Latest revision as of 04:31, 25 June 2018

Auto Threshold
Project Fiji
URL https://imagej.net/Auto_Threshold
Source on GitHub
License GPLv3
Release 1.16.5
Date Sat Apr 29 22:30:45 CDT 2017
Development status Stable
Support status Active
Team
Founders Gabriel Landini
Leads Gabriel Landini
Developers -
Debuggers Gabriel Landini
Reviewers Gabriel Landini
Support Gabriel Landini
Maintainers Gabriel Landini, Curtis Rueden
Contributors Johannes Schindelin, Mark Hiner, Stefan Helfrich

This plugin binarises 8-bit images using various local thresholding methods. By 'local' here is meant that the threshold is computed for each pixel according to the image characteristings within a window of radius r (in pixel units) around it. The segmented phase is always shown as white (255).

For global thresholding rather than local, see the Auto Threshold plugin.

Installation

ImageJ: requires v1.42m or newer. Download Auto_Threshold-X.Y.Z.jar and copy it into the ImageJ/plugins folder and either restart ImageJ or run the ' Help  › Update Menus' command. After this a new command should appear in ' Image  › Adjust  › Auto Local Threshold'.

Fiji: this plugin is part of the Fiji distribution, there is no need to download it.

Use

Method selects the algorithm to be applied (detailed below).

The radius sets the radius of the local domain over which the threshold will be computed.

White object on black background sets to white the pixels with values above the threshold value (otherwise, it sets to white the values less or equal to the threshold).

Special parameters 1 and 2 sets specific values for each method. Those are detailed below for each method.

It you are processing a stack, one additional option is available: Stack can be used to process all the slices.


Available methods

Try all

Which method segments your data best? You can attempt to answer this question using the Try all option. This produces a montage with results from all the methods, so one can explore how the different algorithms perform on an image or stack.

Epith.png

Original image


Epithm2.png

Try all methods.

When processing stacks with many slices, the montages can become very large (several times the original stack size) and one risks running out of ram. A popup window will appear (when stacks have more than 25 slices) to confirm whether the procedure should display the stack montages.

Bernsen

Implements Bernsen's thresholding method. Note that this implementation uses circular windows instead of rectangular in the original.

Parameter 1: is the contrast threshold. The default value is 15. Any number different than 0 will change the default value.

Parameter 2: not used, ignored.

The method uses a user-provided contrast threshold. If the local contrast (max-min) is above or equal to the contrast threshold, the threshold is set at the local midgrey value (the mean of the minimum and maximum grey values in the local window). If the local contrast is below the contrast threshold the neighbourhood is considered to consist only of one class and the pixel is set to object or background depending on the value of the midgrey.

if ( local_contrast < contrast_threshold )
 pixel = ( mid_gray >= 128 ) ? object :  background
else
 pixel = ( pixel >= mid_gray ) ? object : background


  • Bernsen, J (1986), "Dynamic Thresholding of Grey-Level Images", Proc. of the 8th Int. Conf. on Pattern Recognition

Based on ME Celebi's fourier_0.8 routines [1] and [2].

Contrast

Based on a simple contrast toggle. Sets the pixel value to either white (255) or black (0) depending on whether its current value is closest to the local maximum or minimum respectively. The procedure is an extreme case of Toggle Contrast Enhancement, see for example:

  • Soille, P (2004), Morphological Image Analysis: Principles and applications. Springer, pp. 259


This procedure does not have user-provided parameters other than the kernel radius.

Mean

This selects the threshold as the mean of the local greyscale distribution. A variation of this method uses the mean - C, where C is a constant.

pixel = ( pixel > mean - c ) ? object : background

Parameter 1: is the C value. The default value is 0. Any other number will change the default value.

Parameter 2: not used, ignored.

http://homepages.inf.ed.ac.uk/rbf/HIPR2/adpthrsh.htm


Median

This selects the threshold as the median of the local greyscale distribution. A variation of this method uses the median - C, where C is a constant.

pixel = ( pixel > median - c ) ? object : background

Parameter 1: is the C value. The default value is 0. Any other number will change the default value.

Parameter 2: not used, ignored.

http://homepages.inf.ed.ac.uk/rbf/HIPR2/adpthrsh.htm


MidGrey

This selects the threshold as the mid-grey of the local greyscale distribution (i.e. (max + min)/2. A variation of this method uses the mid-grey - C, where C is a constant.

pixel = ( pixel > ( ( max + min ) / 2 ) - c ) ? object : background

Parameter 1: is the C value. The default value is 0. Any other number will change the default value.

Parameter 2: not used, ignored.

http://homepages.inf.ed.ac.uk/rbf/HIPR2/adpthrsh.htm

Niblack

Implements Niblack's thresholding method:

pixel = ( pixel >  mean + k * standard_deviation - c) ? object : background

Parameter 1: is the k value. The default value is 0.2 for bright objects and -0.2 for dark objects. Any other number than 0 will change the default value.

Parameter 2: is the C value. This is an offset with a default value of 0. Any other number than 0 will change its value. This parameter was added in version 1.3 and is not part of the original implementation of the algorithm. The original algorithm is applied when C = 0.

  • Niblack, W (1986), An introduction to Digital Image Processing, Prentice-Hall

Ported from ME Celebi's fourier_0.8 routines [3] and [4].

Otsu

Implements a local version of Otsu's global threshold clustering. The algorithm searches for the threshold that minimizes the intra-class variance, defined as a weighted sum of variances of the two classes. The local set is a circular ROI and the central pixel is tested against the Otsu threshold found for that region.


See also the Wikipedia article on Otsu's method.

Ported from C++ code by Jordan Bevik.

Phansalkar

This is a modification of Sauvola's thresholding method to deal with low contrast images.

In this method, the threshold t is computed as:

 t = mean * (1 + p * exp(-q * mean) + k * ((stdev / r) - 1))

where mean and stdev are the local mean and standard deviation respectively. Phansalkar recommends k = 0.25, r = 0.5, p = 2 and q = 10. In this plugin, k and r are the parameters 1 and 2 respectively, but the values of p and q are fixed.

Parameter 1: is the k value. The default value is 0.25. Any other number than 0 will change its value.

Parameter 2: is the r value. The default value is 0.5. This value is different from Sauvola's because it uses the normalised intensity of the image. Any other number than 0 will change its value.

Implemented from Phansalkar's paper description, although this version uses a circular rather than rectangular local window.

Sauvola

Implements Sauvola's thresholding method, which is a variation of Niblack's method

pixel = ( pixel > mean * ( 1 + k * ( standard_deviation / r - 1 ) ) ) ? object : background

Parameter 1: is the k value. The default value is 0.5. Any other number than 0 will change the default value.

Parameter 2: is the r value. The default value is 128. Any other number than 0 will change the default value

Ported from ME Celebi's fourier_0.8 routines [5] and [6].