|
@@ -71,6 +71,22 @@ namespace bbiwarg.Images
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ public void thresholdBinary(Int16 thresholdDepth)
|
|
|
+ {
|
|
|
+ Int16 maxDepth = getMaxDepth();
|
|
|
+ for (int x = 0; x < width; ++x)
|
|
|
+ {
|
|
|
+ for (int y = 0; y < height; ++y)
|
|
|
+ {
|
|
|
+ Int16 depth = getDepth(x, y);
|
|
|
+ if (depth <= thresholdDepth)
|
|
|
+ setDepth(x, y, 0);
|
|
|
+ else if (depth != maxDepth)
|
|
|
+ setDepth(x, y, (short) (maxDepth / 2));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
public int[] getSmoothedHistogram()
|
|
|
{
|
|
|
Int16 minDepth = getMinDepth();
|