當前位置: 首頁>>代碼示例>>Java>>正文


Java ThresholdFilter類代碼示例

本文整理匯總了Java中com.jhlabs.image.ThresholdFilter的典型用法代碼示例。如果您正苦於以下問題:Java ThresholdFilter類的具體用法?Java ThresholdFilter怎麽用?Java ThresholdFilter使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


ThresholdFilter類屬於com.jhlabs.image包,在下文中一共展示了ThresholdFilter類的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: count

import com.jhlabs.image.ThresholdFilter; //導入依賴的package包/類
private void count(int threshold) {
    BufferedImage image = new BufferedImage(originalImage.getWidth(null), originalImage.getHeight(null), BufferedImage.TYPE_USHORT_GRAY);
    Graphics2D g2 = image.createGraphics();
    g2.drawImage(originalImage, null, null);
    image = (new MinimumFilter()).filter(image, null);
    image = (new ThresholdFilter(threshold)).filter(image, null);
    image = (new ReduceNoiseFilter()).filter(image, null);
    BufferedImage image2 = new BufferedImage(image.getWidth(null), image.getHeight(null), BufferedImage.TYPE_USHORT_GRAY);
    g2 = image2.createGraphics();
    g2.drawImage(image, null, null);
    lblAfterFiltering.setIcon(new ImageIcon(image2));
    lblCount.setText(getRiceCount(image));
    lblModified.setIcon(new ImageIcon(image));
}
 
開發者ID:tekrei,項目名稱:JavaExamples,代碼行數:15,代碼來源:CountRices.java

示例2: createFilterList

import com.jhlabs.image.ThresholdFilter; //導入依賴的package包/類
/**
 * Create and return model for filter selection combobox.
 * 
 * @return
 */
private ComboBoxModel createFilterList() {
    DefaultComboBoxModel model = new DefaultComboBoxModel();
    model.addElement(new DisplayInfo<BufferedImageOp>("- none - ", null));
    model.addElement(new DisplayInfo<BufferedImageOp>(new AverageFilter()));
    model.addElement(new DisplayInfo<BufferedImageOp>(new BlockFilter()));
    model.addElement(new DisplayInfo<BufferedImageOp>(new BlurFilter()));
    model.addElement(new DisplayInfo<BufferedImageOp>(new BorderFilter()));
    model.addElement(new DisplayInfo<BufferedImageOp>(new BoxBlurFilter()));
    model.addElement(new DisplayInfo<BufferedImageOp>(new BumpFilter()));
    model.addElement(new DisplayInfo<BufferedImageOp>(new ChromeFilter()));
    model.addElement(new DisplayInfo<BufferedImageOp>(new ContrastFilter()));
    model.addElement(new DisplayInfo<BufferedImageOp>(new CrystallizeFilter()));
    model.addElement(new DisplayInfo<BufferedImageOp>(new DespeckleFilter()));
    model.addElement(new DisplayInfo<BufferedImageOp>(new DiffuseFilter()));
    model.addElement(new DisplayInfo<BufferedImageOp>(new DiffusionFilter()));
    model.addElement(new DisplayInfo<BufferedImageOp>(new DilateFilter()));
    model.addElement(new DisplayInfo<BufferedImageOp>(new DisplaceFilter()));
    model.addElement(new DisplayInfo<BufferedImageOp>(new DitherFilter()));
    model.addElement(new DisplayInfo<BufferedImageOp>(new EdgeFilter()));
    model.addElement(new DisplayInfo<BufferedImageOp>(new EmbossFilter()));
    model.addElement(new DisplayInfo<BufferedImageOp>(new EqualizeFilter()));
    model.addElement(new DisplayInfo<BufferedImageOp>(new ErodeFilter()));
    model.addElement(new DisplayInfo<BufferedImageOp>(new FlareFilter()));
    model.addElement(new DisplayInfo<BufferedImageOp>(new GainFilter()));
    model.addElement(new DisplayInfo<BufferedImageOp>(new GammaFilter()));
    model.addElement(new DisplayInfo<BufferedImageOp>(new GaussianFilter()));
    model.addElement(new DisplayInfo<BufferedImageOp>(new GlintFilter()));
    model.addElement(new DisplayInfo<BufferedImageOp>(new GlowFilter()));
    model.addElement(new DisplayInfo<BufferedImageOp>(new GrayFilter()));
    model.addElement(new DisplayInfo<BufferedImageOp>(new InvertFilter()));
    model.addElement(new DisplayInfo<BufferedImageOp>(new InvertAlphaFilter()));
    model.addElement(new DisplayInfo<BufferedImageOp>(new LensBlurFilter()));
    model.addElement(new DisplayInfo<BufferedImageOp>(new LevelsFilter()));
    model.addElement(new DisplayInfo<BufferedImageOp>(new LifeFilter()));
    model.addElement(new DisplayInfo<BufferedImageOp>(new MarbleFilter()));
    model.addElement(new DisplayInfo<BufferedImageOp>(new MarbleTexFilter()));
    model.addElement(new DisplayInfo<BufferedImageOp>(new MedianFilter()));
    model.addElement(new DisplayInfo<BufferedImageOp>(new MinimumFilter()));
    model.addElement(new DisplayInfo<BufferedImageOp>(new MirrorFilter()));
    model.addElement(new DisplayInfo<BufferedImageOp>(new MotionBlurFilter()));
    model.addElement(new DisplayInfo<BufferedImageOp>(new NoiseFilter()));
    model.addElement(new DisplayInfo<BufferedImageOp>(new OilFilter()));
    model.addElement(new DisplayInfo<BufferedImageOp>(new OpacityFilter()));
    model.addElement(new DisplayInfo<BufferedImageOp>(new OutlineFilter()));
    model.addElement(new DisplayInfo<BufferedImageOp>(new PointillizeFilter()));
    model.addElement(new DisplayInfo<BufferedImageOp>(new PosterizeFilter()));
    model.addElement(new DisplayInfo<BufferedImageOp>(new QuantizeFilter()));
    model.addElement(new DisplayInfo<BufferedImageOp>(new RaysFilter()));
    model.addElement(new DisplayInfo<BufferedImageOp>(new ReduceNoiseFilter()));
    model.addElement(new DisplayInfo<BufferedImageOp>(new RippleFilter()));
    model.addElement(new DisplayInfo<BufferedImageOp>(new ShadowFilter()));
    model.addElement(new DisplayInfo<BufferedImageOp>(new SharpenFilter()));
    model.addElement(new DisplayInfo<BufferedImageOp>(new SkeletonFilter()));
    model.addElement(new DisplayInfo<BufferedImageOp>(new SmearFilter()));
    model.addElement(new DisplayInfo<BufferedImageOp>(new SolarizeFilter()));
    model.addElement(new DisplayInfo<BufferedImageOp>(new SparkleFilter()));
    model.addElement(new DisplayInfo<BufferedImageOp>(new SphereFilter()));
    model.addElement(new DisplayInfo<BufferedImageOp>(new SwimFilter()));
    model.addElement(new DisplayInfo<BufferedImageOp>(new ThresholdFilter()));
    model.addElement(new DisplayInfo<BufferedImageOp>(new TwirlFilter()));
    model.addElement(new DisplayInfo<BufferedImageOp>(new UnsharpFilter()));
    model.addElement(new DisplayInfo<BufferedImageOp>(new WaterFilter()));
    return model;
}
 
開發者ID:RockManJoe64,項目名稱:swingx,代碼行數:70,代碼來源:PainterDemo.java


注:本文中的com.jhlabs.image.ThresholdFilter類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。