public void process( BufferedImage input ) { setInputImage(input); this.input = input; workImage = ConvertBufferedImage.convertFromSingle(input, null, imageType); // update the binary histogram threshold for this image final double threshold = GImageStatistics.mean(workImage); binary.reshape(workImage.width,workImage.height); labeled.reshape(workImage.width,workImage.height); final int width = input.getWidth(); final int height = input.getHeight(); SwingUtilities.invokeLater(new Runnable() { public void run() { barBinary.setThreshold((int)threshold); barBinary.getHistogramPanel().update(workImage); panel.setPreferredSize(new Dimension(width,height)); processedImage = true; doRefreshAll(); }}); }