0 Replies Latest reply: Mar 12, 2010 2:48 AM by 843802 RSS

    ImageJ and JAI

    843802
      Hi,
      I am using ImageJ as library and need some help. So i have jPanel1 in my
      jFrame and i need import brightness/contrast functions and link these
      functions with my opened image. This is my implementation:

      ///////////////////////////////////////////////////////////////////////////////////////
      Graphics g = this.jPanel1.getGraphics();
      Point p = new Point(0,0);

      ImagePlus imp =
      IJ.openImage("/home/dashko/imgs/.obrazok.temp/obrazok4.jpg");
      ColorProcessor cp = (ColorProcessor) imp.getProcessor();
      int[] pixels = (int[]) cp.getPixels();
      BufferedImage bimg = new
      BufferedImage(cp.getWidth(),cp.getHeight(),BufferedImage.TYPE_INT_RGB);

      bimg.setRGB(0,0,cp.getWidth(),cp.getHeight(),pixels,0,cp.getWidth());

      g.drawImage(bimg, p.x, p.y, this.jPanel1);
      ///////////////////////////////////////////////////////////////////////////////////////

      So question: How can i change brightness and contrast in my jPanel1 image
      using ImageJ library?
      Is there some doc with examples of using ImageJ as library?

      I tried almost everything. Creating new objects of ContrastAdjuster, copying
      pieces of code in my jFrame. I think something very important is missing me.
      Please help me!

      Or maybe you will tell me about another better library to processing images
      easyli with examples? I need strong contrast algorithm. JAI?

      Thank you very much.
      Mike