Posted By

whitetiger on 11/09/06


Tagged

image jpg java filter images Converter RGB j2me gray JAI dilate bit planes


Versions (?)

Java - Erode


 / Published in: Java
 

  1. public RenderedImage erode(BufferedImage img)
  2. {
  3. KernelJAI kernel = new KernelJAI(7, 7, new float[]{
  4. 0, 0, 0, 0, 0, 0, 0,
  5. 0, 1, 1, 1, 1, 1, 0,
  6. 0, 1, 1, 1, 1, 1, 0,
  7. 0, 1, 1, 1, 1, 1, 0,
  8. 0, 1, 1, 1, 1, 1, 0,
  9. 0, 1, 1, 1, 1, 1, 0,
  10. 0, 0, 0, 0, 0, 0, 0
  11. });
  12. pb.addSource(img);
  13. pb.add(kernel);
  14.  
  15. return JAI.create("erode", pb);
  16. }

Report this snippet  

You need to login to post a comment.