-1

I'm looking for a Java library that is Comerically Opensource that has the following features:

Converts to Grayscale

Convolution

Hough Transform

Most important: Easily convert RGB pixel data into an int/char/short [][][3] (1 2D array for each value of RGB)

Adam
  • 593
  • 7
  • 13
  • Possible duplicate of http://stackoverflow.com/questions/2407113/open-source-image-processing-lib-in-java –  Mar 13 '12 at 13:24
  • I've taken a look at them. Im looking for something that is really well documented. A lot of what I see requires tons of prerequisit documentation that is not clear for someone new to java. like to work with BufferedImage you need to understand what a color model is....to understand what a color model is you need to understand.... and so on. – Adam Mar 13 '12 at 13:26
  • 1
    Unfortunately you do not have a choice but to learn what these things are. Even someone who is not new to Java will find it hard to work with image processing if they did not understand these image processing fundamentals. Its a different knowledge domain and as such will require different skill set whether you use Java or not. To do it you have to learn both the image processing domain and the Java domain. – Vincent Ramdhanie Mar 13 '12 at 13:29
  • Dunno if this is an answer, but [JavaCV](http://code.google.com/p/javacv/) makes the C/C++ API of OpenCV available to Java, and OpenCV itself is well documented... – Samuel Audet Mar 13 '12 at 13:48
  • Im an electrical engineer...I understand signal processing. I dont understand how Java manipulates/works with pixels and data. Its really confusing. – Adam Mar 13 '12 at 14:16
  • These questions are duplicates of your original questions, posted yesterday. Please don't duplicate, and listen harder to the good answers provided yesterday. – Edwin Buck Mar 13 '12 at 18:53
  • Maybe you've been reading from a different Adam I didnt ask this question yesterday. – Adam Mar 13 '12 at 19:15

1 Answers1

1

-- Edited in response to comments --

While you may understand signal processing, the application of signal processing to images, or image processing is something you should pay attention to if you intend to leverage your signal processing to images in a non-wasteful (reinvent the wheel) manner.

"Writing it from scratch", using the 2D API performs grayscale color space translation in about 4 lines. Not too heavy price to pay. From page 175.

public static Color coverToGrayscale(Color color) {
  ColorSpace graySpace = ColorSpace.getInstance(ColorSpace.CS_GRAY);
  float[] gray = color.getColorComponents(graySpace, null);
  return new Color(graySpace, gray, 1.0f);
}

Convolutions are handled in chapter 10. The convolution exercise demonstrates a 3x3 blur kernel on pages 206-208. The framework can be used for any kind of convolution.

Hugh Transforms are not to be found in a typical image-processing library. Look to an edge detection / object detection library. If you port / modify a Fernandes / Oliveira styled algorithm, you can even leverage the kernel engine of the 2D API to render an image representing the findings of the transform.

Getting the pixel data as an array is an odd requirement. It's already in array format.

Again, I recommend the book, and a week to read it. It will literally save you weeks of programming time, if you attempt a "try to learn it as you go" approach using the lower level concepts of signal processing. That said, when you get to the kernel engine particulars, your signal processing knowledge is going to pay off in spades.

-- Original post follows --

It seems that there are two sides to this question. One is specifically about an open source Java API for low level image manipulation, the other is for more general documentation concerning low level image manipulation (color models, etc.).

I would recommend that you obtain a copy of "Java 2D Graphics" by Jonathan Knudsen. It is a bit out-of-date when it talks about non Java 2D constructs (the examples chain into the drawing subsystem the outdated way, and they don't launch the windows in a thread-safe manner); however, it is a good learning reference for the actual 2D graphics system, which hasn't changed.

In this book, it goes into color models in detail, and other low level pixel related items (font hints, antialiasing, transformation, etc). As such it can be a very valuable tool.

The 2D API is part of the Java standard libraries. There is no need for a "lower" image processing library, but depending on your needs, you might want a library to lie above it (and simplify common image processing tasks). Once you have a grasp of the primitives, perhaps you can find one of the previously reviewed libraries to have sufficient documentation to achieve your needs.

Edwin Buck
  • 69,361
  • 7
  • 100
  • 138
  • Java doesn't have transforms like hough built into it. I need to write it from scratch and to do that I need the pixel data. – Adam Mar 13 '12 at 14:17
  • @Adam, look to edited post. Find a old copy of the book. It will be well worth your while to leverage the existing framework. – Edwin Buck Mar 13 '12 at 17:16