Package boofcv.alg.filter.binary
Class ComputeOtsu
- java.lang.Object
-
- boofcv.alg.filter.binary.ComputeOtsu
-
public class ComputeOtsu extends java.lang.ObjectComputes different variants of Otsu. Can be configured to compute the standard version. This allows the user to better handle textureless regions and can further tune it by scaling the threshold up and down.
-
-
Constructor Summary
Constructors Constructor Description ComputeOtsu(boolean useOtsu2, boolean down)ComputeOtsu(boolean useOtsu2, double tuning, boolean down, double scale)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcompute(int[] histogram, int length, int totalPixels)Computes the threshold and stores the result in the 'threshold' variableprotected voidcomputeOtsu(int[] histogram, int length, int totalPixels)protected voidcomputeOtsu2(int[] histogram, int length, int totalPixels)doublegetScale()doublegetTuning()booleanisDown()booleanisUseOtsu2()voidsetDown(boolean down)voidsetScale(double scale)voidsetTuning(double tuning)voidsetUseOtsu2(boolean useOtsu2)
-
-
-
Constructor Detail
-
ComputeOtsu
public ComputeOtsu(boolean useOtsu2, double tuning, boolean down, double scale)- Parameters:
useOtsu2- true to use modified otsu. false uses clasicaltuning- Tuning parameter. 0 = standard Otsu. Greater than 0 will penalize zero texture.down- Is otsu being used to threshold the image up or downscale- scale factor applied to the threshold. 1.0 = unmodified
-
ComputeOtsu
public ComputeOtsu(boolean useOtsu2, boolean down)
-
-
Method Detail
-
compute
public void compute(int[] histogram, int length, int totalPixels)Computes the threshold and stores the result in the 'threshold' variable- Parameters:
histogram-length- length of histogramtotalPixels- total sum of all pixels in histogram
-
computeOtsu
protected void computeOtsu(int[] histogram, int length, int totalPixels)
-
computeOtsu2
protected void computeOtsu2(int[] histogram, int length, int totalPixels)
-
isUseOtsu2
public boolean isUseOtsu2()
-
setUseOtsu2
public void setUseOtsu2(boolean useOtsu2)
-
getTuning
public double getTuning()
-
setTuning
public void setTuning(double tuning)
-
isDown
public boolean isDown()
-
setDown
public void setDown(boolean down)
-
getScale
public double getScale()
-
setScale
public void setScale(double scale)
-
-