This week's book giveaway is in the OCPJP forum.
We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line!
See this thread for details.
The moose likes Java in General and the fly likes Suggestion for image processing Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Suggestion for image processing" Watch "Suggestion for image processing" New topic
Author

Suggestion for image processing

Jim Size
Greenhorn

Joined: Aug 10, 2010
Posts: 29
hello,
i am doing a medical research with a university and i need to acquire information from images.
i am reading "Digital Image Processing An Algorithmic Introduction Using Java" and i found out a open source program named ImageJ.
so i want to ask you a question.

(1) what do you suggest? should i use this program in my research or should i make my own java program?

i have no idea how difficult is to construct such a program.
i've started reading about images, parsing images etc.

my goal is to acquire information from a jpeg (for example format) image, like the percentage of a color in the image. Also the percentage of a selected color into an area.

(2) i would love some suggestions about books, websites etc into this subject.

thanks a lot!

[i want some help for (1) and (2)]
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 39478
    
  28
Don't know.

What does the documentation for that project say?
This question is too difficult for "beginning", so I shall move it.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42371
    
  64
Having used it for years, as well as having written several plugins for it, I'm quite familiar with ImageJ. It is *the* image processing library/application in Java if you're working in the life sciences; you needn't look further.

Looking at the examples you mention, there are different ways you might use it to accomplish these:
  • You could use ImageJ just as an image processing library - use its API to open images, retrieve and manipulate pixel values etc.
  • You could write a plugin - that's a Java class that implements a particular ImageJ interface, and which you can then invoke from ImageJ's GUI if you run it as an application (see the link in my signature for some examples of what plugins can do)
  • You can write a macro - kind of similar to a plugin with a Java-like syntax. Macros are interpreted by ImageJ, so there's no separate compilation step. Macros can't do everything plugins can, but for the examples you mention they'd be fine, and would be easier to get started with.

  • As an aside - JPEG is probably the one format that you will never encounter when doing quantitative image processing, because it does not preserve pixel values.


    Ping & DNS - my free Android networking tools app
    Jim Size
    Greenhorn

    Joined: Aug 10, 2010
    Posts: 29
    thanks for the response, i didn't know where to add my topic i am sorry for any trouble.

    so lets say i got an image and that image has 4 different colors, lets say Red-Green-Blue and Black and i have to find the percentages of R-G-B in the picture.
    then it would be great if i could find the allocation of those colors into the picture, you know [Gauss, etc.] i don't know yet what is gonna be my allocation but
    maybe i could get some nice results thats for start.

    Ulf Dittmer thanks for help!!! (firstly )
    - you say that imageJ is the number 1 in medical science, but can i use it in my research without any risk, getting blamed that i use a tool that i haven't
    designed it?
    - i don't know how to write a plug in (i have never used it before) so i need to learn more about it.

    i didn't know that Jpeg doesn't preserve pixel values, i will find out what format should i use. (tiff,gif,png,jfif,exif,pbm etc.)

    - will i encounter any problems if i turn my jpeg format into the format i'll use? like losing some values or getting values that are not correct?
    (because i think that the doctors data are all jpeg images)

    - have you heard about Gonzales book that works also with Matlab?

    thanks again cheers!
    Ulf Dittmer
    Marshal

    Joined: Mar 22, 2005
    Posts: 42371
        
      64
    so lets say i got an image and that image has 4 different colors, lets say Red-Green-Blue and Black and i have to find the percentages of R-G-B in the picture.

    How would "red" be defined? Just as the pixel value 255/0/0? That would be easy to check for, but it's not generally how real-life images come along - they have different shades of colors, e.g. 240/20/20 would still be considered red.

    can i use it in my research without any risk, getting blamed that i use a tool that i haven't designed it?

    We can't know what you may be blamed for by people we don't know, but unless the objectives specifically state not to use any 3rd party tools, then it would be folly to reinvent the wheel, especially one that's so generally well-regarded.

    i don't know how to write a plug in (i have never used it before) so i need to learn more about it.

    Like I said, it's probably easier to start with macros, and may be sufficient for simple tasks.

    i didn't know that Jpeg doesn't preserve pixel values, i will find out what format should i use. (tiff,gif,png,jfif,exif,pbm etc.)

    TIFF would be good (probably the most common format in the life sciences), and PNG is also a possibility. GIF and PBM are very limited and obsolete. JFIF is basically another name for JPEG.

    will i encounter any problems if i turn my jpeg format into the format i'll use? like losing some values or getting values that are not correct? (because i think that the doctors data are all jpeg images)

    If the data is in JPEG format already then there's no way to avoid problems - the results you get may differ between platforms, and even between different JVM versions. That's why it can't be used anywhere where pixel values matter.

    have you heard about Gonzales book that works also with Matlab?

    No
    Jim Size
    Greenhorn

    Joined: Aug 10, 2010
    Posts: 29
    thanks a lot for the support!

     
    I agree. Here's the link: http://aspose.com/file-tools
     
    subject: Suggestion for image processing