Package boofcv.alg.filter.binary
Class ComputeOtsu
java.lang.Object
boofcv.alg.filter.binary.ComputeOtsu
Computes 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.
-
Field Summary
-
Constructor Summary
ConstructorDescriptionComputeOtsu
(boolean useOtsu2, boolean down) ComputeOtsu
(boolean useOtsu2, double tuning, boolean down, double scale) -
Method Summary
Modifier and TypeMethodDescriptionvoid
compute
(int[] histogram, int length, int totalPixels) Computes the threshold and stores the result in the 'threshold' variableprotected void
computeOtsu
(int[] histogram, int length, int totalPixels) protected void
computeOtsu2
(int[] histogram, int length, int totalPixels)
-
Field Details
-
threshold
public double threshold -
variance
public double variance -
down
public boolean downIs the image being thresholded down or up
-
-
Constructor Details
-
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 Details
-
compute
public void compute(int[] histogram, int length, int totalPixels) Computes the threshold and stores the result in the 'threshold' variable- Parameters:
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)
-