Threshold
Threshold[data]
thresholds data by replacing values close to zero by zero.
Threshold[data,tspec]
thresholds data using threshold specification tspec.
Threshold[image,…]
replaces small values of image by zero.
Threshold[sound,…]
replaces small values of sound by zero.
Details
- Thresholding is a mathematical segmentation operation to set values in a specific region to zero and occasionally diminish values outside the region.
- Threshold works with data arrays of any rank, as well as 2D and 3D images.
- Threshold[data] is equivalent to Threshold[data,{"Hard",10-10}].
- The threshold specification tspec can be of the form {tfun,pars}.
- Possible tfun names and options include:
- Available thresholding functions tfun and their parameters are (using input data ):
-
{"Hard",δ} {"Soft",δ} {"Firm",δ,r,p} {"PiecewiseGarrote",δ} {"SmoothGarrote",δ,n} {"Hyperbola",} {"LargestValues",k} keep the largest k data points - In all cases is assumed to be a positive number or a thresholding function tfunc to compute . Each tfunc[data] should return a positive number.
- The parameter conditions for "Firm" are that is a positive real and a real number between 0 and 1.
- The parameter conditions for "SmoothGarrote" is to have be a positive machine integer.
- The threshold can be automatically computed using the following methods:
-
{"BlackFraction",b} make a fraction b of all pixels be black "Cluster" cluster variance maximization (Otsu's algorithm) "Entropy" histogram entropy minimization (Kapur's method) "Mean" use the mean level as the threshold "Median" use the median pixel level as the threshold "MinimumError" Kittler–Illingworth minimum error thresholding method
Examples
open allclose allBasic Examples (3)
Scope (14)
Data (7)
Threshold Specification (7)
"Hard" thresholding replaces data values with absolute value below with 0:
With "Soft" thresholding, data values below threshold are set to 0; others are diminished by :
"Firm" thresholding is a compromise between "Hard" and "Soft" thresholding:
"PiecewiseGarrote" thresholding is similar to "Firm", but uses a single parameter:
"LargestValues" thresholding preserves samples with largest absolute values:
Properties & Relations (7)
"Hard" thresholding sets to 0 all data values with absolute value below a certain threshold :
Vary the value of the threshold :
"Hard" thresholding is similar to Chop:
"Soft" thresholding performs a shrinking operation:
Vary the value of the threshold :
"Firm" thresholding is a compromise between "Hard" and "Soft" thresholding:
"Firm" thresholding has uniformly smaller variance than "Hard" thresholding:
In the limit β->∞, "Firm" threshold performs "Soft" thresholding:
In the limit β->η, "Firm" threshold performs "Hard" thresholding:
"PiecewiseGarrote" thresholding:
This is similar to "Firm" thresholding with the advantage of having a single parameter :
Vary the value of the threshold :
In the limit n∞, "SmoothGarrote" goes to "Hard" thresholding:
Text
Wolfram Research (2010), Threshold, Wolfram Language function, https://reference.wolfram.com/language/ref/Threshold.html (updated 2012).
CMS
Wolfram Language. 2010. "Threshold." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2012. https://reference.wolfram.com/language/ref/Threshold.html.
APA
Wolfram Language. (2010). Threshold. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/Threshold.html