We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6372ade commit 36c67d4Copy full SHA for 36c67d4
MonoscaleProcess.java
@@ -18,6 +18,11 @@ public RenderedImage process(RenderedImage img){
18
Histogram hist = (Histogram)JAI.create("histogram", img).getProperty("histogram");
19
double[] threshold = hist.getMaxVarianceThreshold();
20
21
- return JAI.create("binarize", img, new Double(threshold[0]));
+ try{
22
+ return JAI.create("binarize", img, new Double(threshold[0]));
23
+ }catch(IllegalArgumentException e){
24
+ System.err.println("Cannot binarize image: " + e.getMessage());
25
+ return img;
26
+ }
27
}
28
0 commit comments