# Threshold

Threshold[data]

thresholds data by replacing values close to zero by zero.

Threshold[data,tspec]

thresholds data using threshold specification tspec.

Threshold[image,]

thresholds an image.

Threshold[sound,]

thresholds a sound object.

# Details

• Threshold works with 3D as well as 2D images, and also with data arrays of any rank.
• 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:
•  {"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 positive real number between 0 and 1.
• The parameter conditions for "SmoothGarrotte" is to have be a positive real number.
• 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 all

## Basic Examples(3)

Zero out elements that are very close to 0:

 In[1]:=
 Out[1]=
 In[2]:=
 Out[2]=

Perform a clustering threshold on an image:

 In[1]:=
 Out[1]=

Use a "Soft" threshold function:

 In[2]:=
 Out[2]=

Keep 5 largest data values:

 In[1]:=
 Out[1]=