12.07.2015 Views

Digital Image Processing (using Java)

Digital Image Processing (using Java)

Digital Image Processing (using Java)

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

(p.258)LISTING 10.1 A <strong>Java</strong> class to perform grey level thresholding.public class ThresholdOp extends GreyMapOp {public ThresholdOp(int threshold) {}computeMapping(threshold, 255);public ThresholdOp(int low, int high) {}computeMapping(low, high);public void setThreshold(int threshold) {}computeMapping(threshold, 255);}public void setThresholds(int low, int high) {computeMapping(low, high);public void computeMapping(int low, int high) {if (low < 0 || high > 255 || low >= high)throw new java.awt.image.ImagingOpException("invalid thresholds");int i;for (i = 0; i < low; ++i)table[i] = (byte) 0;for (; i

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!