Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
I am trying to do some image processing on a coloured image and for me to do so I need to separate the RGB values and modify them separately. I am just implementing a increase in brightness filter. I am doing this in java. Can someone help me out please
You have a few options.
First, you need to be able to load an image that supports the BufferedImage class. For this, you're best using the ImageIO API. Take a look at Reading/Loading an Image.
Once you have this, you can obtain the pixel information in a verity of ways.
One of the simplest is to use BufferedImage#getRGB, which returns a packed integer of the pixel.
Depending on the type of image, you can obtain the individual color values Color(int, boolean), which will unpack the integer accordingly (you can also do this manually, but I never remember the maths and this is simpler).
Alternativly, you can access the Raster directly, via BufferedImage#getData, which provides you access to more methods for manipulating the underlying pixel information (such as grabbing regions of pixels for example)
Now, if all that sounds like more fun then you can handle, you can easily perform image brightening using a BufferedImageOp...
See, Adjust brightness and contrast of BufferedImage in Java and How to change the contrast and brightness of an image stored as pixel values and Change brightness of image using RescaleOp for examples (these where just the top few that popped up on Google)
Related
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 9 years ago.
Improve this question
I apologize if this is the wrong place to ask - please let me know if it is, and I will remove this post.
My question is - are there any Java graphic libraries that can take RGB values as inputs and maps those onto a graph? I have been looking at JFreeChart, and a number of the open source solutions, but looking at the documentation, I haven't been having much luck.
Currently, I have a multi-dimensional array that stores 1302 RGB values, which corresponds to 93 rows and 14 columns. As each "index" stores a RGB string in this format i.e. 0,0,0 I hope to graph each individual color into a x-y graph such as like this:
In the above graph, the black is a 0,0,0 value, while the cyan, green, red, etc, are all their individual RGB values.
Since you're asking about plotting heat maps, the answer is yes. Many, in fact, but one such library is jHeatChart over at http://tc33.org/projects/jheatchart
Note that just because your values are encoded as "RGB Strings" doesn't mean you want to ask about using RGB strings, you want to ask about plotting temperature values. The fact that they're RGB strings is irrelevant since we can transform them however we need to make them suitable input.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
I have a 3D array representing a 3D object (x,y,z). The values stored in the array are RGB colors. Is it possible to generate an image of the object from any given point of view?
That is certainly possible. The keywords here are transformation and projection, basically you define a point for every (3D) Pixel inside your array. Then you multiply all the points with a bunch of matrices and get a 2-dimensional result.
Here is an article about how OpenGL does it's transformations:
http://www.songho.ca/opengl/gl_projectionmatrix.html
You could mimic the whole pipeline in C++ to produce a bitmap on your CPU or use OpenGL directly which would be a thousand times faster. When using OpenGL you could also view your model in realtime from all sides, but that would essentially be a full 3D-Application.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 9 years ago.
Improve this question
I want to create a custom Swing component that renders certain enteties and connections between them. The user shall be allowed to select those entities and connections as well as moving them using Drag&Drop (only within that component). Additionally the user shall be able to zoom in and out of the overall view.
Do you know of any rendering framework that might help creating such a component or do I need to implement it all on my own?
A custom rendering program is an item that takes some understood data and turns it into drawing instructions.
If you want to add zooming, your custom rendering program will keep track of the size of the data item it is to draw, and the zoom scaling factor, such that if you were to zoom in 1.1 on a 12 pixel tall item, you would then draw that at 13.2 pixels high.
If you want to add drag and drop, you need to be able to receive a mouse click-and-drag event, which will give you a pixel coordinate. You back map that starting pixel coordinate to some non-zoomed pixel, then find out the non-zoomed item under that pixel. You then move that item the (translated for the zoom) correct number of non-zoomed pixels and request a redraw (remember the drawing layer will take care of the current zoom level).
As far as a rendering framework, there are two that come default with Java, and you've mentioned one. Swing is fine if you really want to build this functionality yourself, and AWT is also in Java, but it probably shouldn't be used independently of Swing unless you have some special requirements.
Outside of that there's SWT, and a number of high level convenience libraries like JGraph, etc which bind to one or other underlying frameworks to do the actual work. Whether those convenience libraries will do exactly what you wish, or even if they can be configured to do what you wish remains to be seen, depending on the very specific details that will only be discovered and handled after you start trying a convenience library.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 9 years ago.
Improve this question
I am interpreting scientific (STEM) images into their component parts and adding semantics. These images are born digital, noise-free and either binary (monochrome) or have a small number of colours. I would like Java libraries/methods to partition the images into the whitespace-separated components and to identify (classify) the resulting segments. A typical image is:
where I would want the extracted segments to include numerals and other characters (some rotated) and the asterisks in the diagram. [I will use other methods to extract the geometrical components - e.g. the bars) . I would also like the library to identify identical segments (e.g. 6 zero characters, 5 decimal points). I have successfully used Tesseract for characters but many of the segments may not belong to a Unicode character set (e.g. purpose-created symbols).
UPDATE: I have opened a bounty. I am only interested in libraries, NOT suggestions for algorithms as I have already written a prototype one. If the functionality is part of a larger system (e.g. I think JBIG2 has this functionality) please make it clear where the entry points are.
NOTE: "born-digital" means that the image was created without noise, clean lines unlike - say - scanned documents.
I am only aware of openCV. With this you can analyze your image like:
binarizing it (if you have a few colors or greyscale)
gather blobs in Mat-objects
get the position of those Mats to get the correct label (which should be a Mat for each letter)
and then apply your algorithm to those Mats
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 7 years ago.
Improve this question
I'm looking to do some image processing in Java and I'll be developing in Ubuntu with Eclipse.
So here is my objective:
From a greyscale image, I would like to be able to detect certain sized objects and draw a rectangular frame around them. However, the catch is that this image is captured from a thermal imaging camera so to detect body heat the pixels will have a value within a certain range.
After detecting all the objects in the image, I will need to count them, but that's later.
So here's my challenge. Which tools/apis/open classes can I use to do something like this. I looked around and found some basic manipulations such as rotate, crop, resize. But haven't really found anything I can use.
Where should I look/start?
thanks a lot in advance
ImageJ is very useful:
http://rsbweb.nih.gov/ij/
Although ImageJ is set up as a GUI, you can use it as a library too (I do that too)
You'll have to search for a proper object detection plugin (but there are some floating around...)
good luck!
Eelco
On this page you can find open-source tool for image processing and image mining:
http://spl.utko.feec.vutbr.cz/en/image-processing-extension-for-rapidminer-5
This article fully explains the algorithm you're looking for, and the accompanying source code is here. You can see it in action in this video.
(Disclaimer: I'm the author; but I do think this is very useful, and have successfully used the algorithm a lot myself.)
The algorithm tracks moving objects, finds their bounding rectangle (which the application draws), counts the number of pixels in each objects, correlates them throughout frames as the same object (with an int ID). You may need to do a trival conversion of your grayscale image to RGB (by copying the gray values to all three channels) since the algorithm was designed for color input.
When it comes to commercial computer vision applications, OpenCV and the Point Cloud Library aka PCL are your best friends. And articles like the one linked explains how to use tools like OpenCV to accomplish full stack motion tracking. (The pure Java implementation shows how it works down to the individual pixels.)