Histogram drawing - Image processing tools - java

I've an issue with drawing an image histogram. I would like to create simple image histogram with basic adjustments. The problem is if there are simple libraries/sdk that could help achieve this. The technology does not matter. I've found that matlab has a lot of image/graph processing tools but it is still kid of "inaccessible" due to the tools. Java/Javascript/python/c# would be great so that I've tagged this question.
AFAIK we can take as eg. RGB components to draw histograms and there would be great if those library would allow to adjust them and in response process the image. I think what I'm looking for is often used in every tool working with graphics.
thx

For python you have matplotlib (http://matplotlib.org/index.html) , it's quite easy and very similar to matlab

Related

Java - Image Processing Package

I'm trying to make a maths inspired background image for my computer. What I've decided to do is a visualization of the Collatz Conjecture (video for explanation of the mathematical problem and method of visualization: https://www.youtube.com/watch?v=LqKpkdRRLZw&t=224s). Now I know that there are tons of different cool high resolution images on this very topic but half of the fun in it is making it myself.
So on to the problem. The tree structure is already implemented and took a couple of hours (I'm not a great Java programmer) so what I want to do now is create the actual image. I'm in essence looking for a simple image processing package or even some image processing software that can read information from a .txt file and will let me tell it what to do with it. I want to be able to draw lines, assign widths and colors and chose background colors etc. I had thoughts of doing the entire thing in Matlab instead so if you recommend I do it there I can do that as well. Also python is an option. But to clarify the problem isn't the actual making of the tree but rather the visualization and making a pretty image. Thanks for any help.
EDIT: I just found this (http://marvinproject.sourceforge.net/en/index.html). It seems to do what I want. Is it any good?

Interactive Flow Chart

I have written a few C programs that are pretty extensive. I am looking to draw a flow chart/ER Diagram of how the header files are called and which call to which. While I could use Visio and draw this in a few hours, I am looking to make an interactive diagram. I have started one in Python using Imagine Magick but I am wondering whether Java/JavaFX/JavaGraphics would be the best way to go about this task. Any suggestions for the most efficient way to make a program that will draw a diagram of my large scale project?
NOTE: Python has worked thus far and it has drawn a small scale diagram with arrows to each relation but it is slow.

The use of image processing to extract data from a diagram

I have a data flow diagram (a diagram that looks like a flow chart). It has a set of specific geometrical components like rectangles, circles, ellipses and arrows.
What I'm trying to achieve is to detect these shapes and be able to know which component is connected to which component (through the lines) and finally read the text inside each one to extract data from the diagram and do further processing. It is also notable to mention that the diagram will not be drawn by hand but computer generated so we don't have to worry about angles and ratios being inaccurate.
I'm currently working in Java and I was wondering if this is going to be possible since Java is not the best language when it comes to image processing (correct me if I'm wrong). And if it's possible I'd you guys to point out where I should start looking.
I think Java is fine, and it has many libraries to process images. ImageJ is just one example. Personally, I like to use Python, so I write scripts in this language using Java API of the DMelt platform. Look at the documentation of this projecst, wiki. Here is a link to a few examples.
Doing this in Java wasn't a great idea because mainly the lack of online resources. After a good amount of research, I found that the best and the easiest approach was the use of C# and Emgu CV which is a cross platform .Net wrapper to the OpenCV image processing library.
This example helped me to get started with detecting basic geometrical shapes like Lines, Rectangles and Triangles.

Creating and drawing huge (Buffered) images in Java

I'm working on an application which draws out a matrix - using Java 2D - which can become quite large, for example 30000 x 30000 pixels.
At this moment I've experimented a bit with BufferedImage but creating such a huge BufferedImage causes out of memory exceptions, even when enlarging the heap.
Now I was thinking splitting the image up into several images/regions, and when I'm done in a certain region write it to disk and create a new region/BufferedImage and continue drawing.
I'm interested in thoughts of other people on how they would handle this. I've been away from Java for a while so any concrete examples are welcome.
I contribute to a new/small open source project which may be quite well suited to your needs.
The project is Glimpse. Its intended to aid in construction of 2D data visualizations in Java with a focus on handling large data sets well and making it easy to provide real-time interactivity to allow easy exploration of data.
It utilizes OpenGL to take advantage of hardware features on modern GPUs like texture memory and shaders to achieve the above goals. So if you're set on using Java2D then this won't work for you. However, Glimpse panels can be placed side-by-side with other Swing components, so it's easy to drop into your existing Swing GUI. The only caveat it that you'll need a decent graphics card.
The image is an example of a large matrix of data whose coloring is being dynamically adjusted via the color scale on the right (the matrix data is stored in a GPU texture and the dynamic re-coloring is accomplished via a custom shader). The source for this example is HeatMapExample.java. There's lots of other examples like that which provide starting points for working with Glimpse's other features.
You can learn more at glimpse.metsci.com. There's an intro video on the front page, along with Java WebStart examples. The source is hosted on GitHub.
if you just want to generate the image on disk, then look at pngj - it can generate big png images with no problems because it writes lines of pixels to disk as they are available. the api is a little png-specific, but it's not too complex (it might help to read a little background on the png image format before using it).

Java Graphics library

I'm looking for a high-level java graphic library for creating artistic text, watermarks, resize, crop, image identification and manipulation.
ImageMagic is a good example of such library, but its java ports are somewhat problematic (they either run imagemagic through JNI or via commandline and are hellish to deploy to servers).
Ideally I'd like to have similar functionality to ImageMagic, but pure Java and open-source, free to use.
Has anyone seen something like that?
This is for a server-side component. A service that manipulates images of various web formats (png, jpg, gif etc).
Java has its own libraries, of course (Graphics2D) but I'm looking for something of higher level.
Here are several use cases:
Resize and crop images. If it has "smart resize" or "smart crop" that'll be cool, for example seam carving resize, or cropping by points of interest in the photo
Drawing artistic text on images. Using fonts, colors, text effects (3d text, charcoal and other effects)
Embedding watermarks.
Layering images, using images as background, masking with images etc.
Image identification such as - number of colors, stdev etc.
As mentioned, Java in its Graphics2D supports all of the above but is too low level so I'm looking for something that's nicer to work with.
Thanks!
Java Advanced Imaging ( JAI ) sounds like what you want. From the website:
The Java Advanced Imaging API provides
a set of object-oriented interfaces
that support a simple, high-level
programming model which lets you
manipulate images easily.
I found it relatively simple to work with. And the performance was better than spinning off ImageMagic processes.
Use ImageJ. In addition to being a neat program, it can be used as a library.
The Apache SVG Batik library can
be used to display some vectorial
drawing in SVG.
The eclipse project
contains a library called Graphical
Editing Framework (GEF) shipped with
a painting and layout plug-in called
Draw2D. see
http://whf.poac.ac.cn/codeopen/jiaocheng/java2s/Code/Java/SWT-JFace-Eclipse/2D.htm.
Raw Java2D makes it quite easy to do resizing and cropping (just make sure that you reduce in powers of 2, the backend doesn't handle this automatically). I only found JAI useful for my usage to do color quantization... the rest of the pipeline seemed unnecessary for basic functions.

Categories

Resources