Best way to handle images in Java - java

I will develop a Java application that uses some image processing algorithms. I have done some image processing applications using C++. I'm currently using BufferedImage object to save data from images but I'm wondering if there is a better way to handle images in Java (improve performance).
Do you guys have any recommendation?
Thanks!!!

if you want to work with images i would look at JavaCv: https://github.com/bytedeco/javacv
JavaCV first provides wrappers to commonly used libraries by researchers in the field of computer vision: OpenCV, FFmpeg, libdc1394, PGR FlyCapture, OpenKinect, videoInput, and ARToolKitPlus.
I think you will find all what you need.
Luca

For JAVA there exists for example:
FiJi
ImageJ
Fiji
BoofCV
Rapidminer with IMMI (for image mining)

Related

Image processing in Java like MATLAB Image Processing Toolbox

Does it exist a solution for Java that allows to working with images in a very similar way to MATLAB IPT?
I mean, are there some libraries to do something like IPT4Java.imfilter(A, F) or IPT4Java.fspecial('average', [3 3])?
If not, what is the best solution to implement this kind of approach?
Java Advanced Imaging (JAI) supports a multitude set of filters that you can apply on images.
You could have a look at the Java wrapper around OpenCV:
http://code.google.com/p/javacv/

Equivalence of cvMatchTemplate() in BoofCV or pure java computer vision library?

I am looking for solutions BoofCV or any pure java computer vision library that doesn't require OpenCV to do template matching of images to detect object within a picture.
For example, finding the position of an image within a bigger picture.
I have had success with cvMatchTemplate() example on OpenCV, but interested in using BoofCV to achieve the same results.
This functionality has recently been added to BoofCV. See example below:
http://boofcv.org/index.php?title=Example_Template_Matching
It seems this functionality is not implemented in BoofCV.

What Java libs to use for basic image manipulation?

I'm looking to do a couple basic features with images and Java...
image resizing and cropping
possibly making composite images
What java library would be the easiest to use for that purpose?
thanks
Java Advanced Imaging API
http://java.sun.com/products/java-media/jai/forDevelopers/jaifaq.html
Have a look at the standard Java 2D graphics API first; it can do all the things you mention (resizing, cropping, compositing) without the need for exernal libraries such as Java Advanced Imaging.
See 2D Graphics in The Java Tutorials for an introduction.
Java Advanced Imaging (here is an FAQ for it).
See also this article.
Apache also has an implementation which aims to be a more portable than other frameworks (and is slower). See the sanselan page.
Catalano Framework. You can use the same code in Android too, contains several algorithm in parallel.
Project: https://code.google.com/p/catalano-framework/
Article: http://www.codeproject.com/Articles/656059/Catalano-Framework

Java: create graphics without awt?

Is there any library out there to create graphics without using AWT?
What I need is simple drawing functions (like to draw a line) and text drawing functions to create graphics in memory for a Google app engine application. App engine does not support AWT.
Thanks!
Not unless you want to implement your own image class (say, a bitmap) and rendering algorithms for lines, shapes, images.
If you have experience with computer graphics and rasterization, this may not be very hard, but otherwise it will be more than you want to bite off.
You might also try the appengine-awt project, though it's a bit experimental.
You might try using SenseLan. In the requirements section, it says they don't use awt or ImageIO. Of course, there is the Images api but it seems fairly limited in what it offers.
Edit:
It looks like there are a couple of Python possibilities that could offer you some limited drawing capabilities. You could probably write appropriate image functionality as python web services, and keep the rest of the app in Java:
Replacing Functionality of PIL (ImageDraw) in Google App Engine (GAE)
http://denislaprise.com/2008/08/21/drawing-images-on-google-app-engine/
Use Batik for GAE which is available as a dependency of FOP on GAE.
You can also track the issue further on the Google app engine bug tracker where others have shared other ideas in the comments.
'The Java 2D API is a set of classes for advanced 2D graphics and imaging, encompassing line art, text, and images'
http://java.sun.com/products/java-media/2D/index.jsp
Here's another possibility: org.eclipse.draw2d It probably relies on eclipse SWT.
TinyLine provides vector graphics support on the Google App Engine server side, and also provides SVG rendering support. See the SVG Thumbnail images demo.
Google Web Toolkit contains a nice graphics library designed for interfacing with the Google app engine.
edit to clarify: Google App Engine is designed for hosting applications on the web. You need to design graphics that can run in the browser. To do this, you need to write code in a web language, Javascript, for example. Google Web Toolkit contains a Java graphics library which compiles down to Javascript, saving you the effort of writing the Javascript yourself.
I hesitate to mention PJA, which appears to work if the AWT classes are present, but the security manager prevents you from using them.
If you can use Python on GAE instead of Java, then there's pybmp.

Is it possible to record video of a Java Swing Component?

I am looking for a way to make a video out of a java JComponent. I found ways to save components as images, but ideally I would like to be able to have the component paint to the screen and to a video file. I am hoping to find a solution that does not require libraries outside of the core JDK, but lightweight libraries might be considered.
Thanks
I don't believe there are libraries that will do what you are asking. Indeed, it seems a rather strange approach. Could you explain what it is that you are trying to achieve.
I suspect that a more viable approach is to use a screen video capture tool like Camtasia to capture what the user is doing. It costs money, but they do have an evaluation download if your boss is a cheapskate.
The core Java JDK doesn't provide a way to write videos, but you can create videos from raw images using the Xuggler open-source project. See this source code for examples of creating a video from raw images that are snapshots of a desktop.
Art

Categories