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.)
Related
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 3 years ago.
Improve this question
I'm creating an Android app which has to identify draws made by children. The structure of the draw is this:
I noticed that the Google Cloud Vision AI instrument can identify that the draw corresponds to an animal and this is exactly what I'm looking for. Since a child can draw and write what he wants (this means that texts and numbers are accepted) I understood that he could access to the paid features of the service. Are there instrument like this one which identify objects/human being and that can be implemented in Android?
The Google Cloud Vision API allows one to submit an image and get back an interpretation of that image. The data returned can contain a variety of sections. At the highest level these are:
Labels
Text
Document (OCR)
Safe determination
Face detection
Landmark detection
Logo detection
Image properties
Web similar images
Cropping suggestions
When you supply an image, you have the choice of how many of these features are examined from the supplied image. When you make the API call to process the image, you declare which (one, some or all) of the above are to be processed. From your description, it sounds like you are looking for label detection and nothing more.
Since Google has to run significant compute and other data processing work against the image, there is a charge for the service of interpreting an image. Looking at the pricing page we seem to see that Google charges in units of 1000 images. There is a free tier which is 1000 images/month. If you need to process less than this, then there should be no cost. If you need to process more than 1000/month, it appears that the charges vary based upon the processing required. For example, it appears to be $1.50 for every 1000/month above the first 1000/month that are free. The price decreases automatically if you have very high volumes of images to process. If you ONLY need label detection then when you submit an image for processing, ensure that is all that is requested in the API call. If you request additional interpretations of the image you will be billed for those in addition.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about programming within the scope defined in the help center.
Closed 8 years ago.
Improve this question
I am a programming newbie. I am asked to shrink an image to 1/4 its original size. And tutor told me I can replace 4 pixel with one pixel, so as to make it 1/4. How Can I do replacing work in java. Can anyone give me an example?
If you are new to programming then this is absolutely a lesson you should not be undertaking because it involves file IO, loops, data structures, and math. None of these are relevant to the basics you should be learning now.
The basic algorithm would be that you read the pixels in the image into a matrix, and every 2x2 square of pixels could be replaces by one pixel by averaging the colors.
I am not going to give you a full answer because it would involve lots of API lookups to create a fully functional application to do this. There would be a lot of code you probably wouldn't even understand if I showed it to you.
If this is for school, you are either far behind in your studies, or else your teacher is giving an unecessarily complex early assignment. Regardless of where this is coming from, you need to ask for a simpler assignment.
Either way, I recommend you take a step back and solve some simpler problems first so that you understand the components necessary to solve this problem.
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.
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
Problem: I have to plot a simple 3D graph/diagram with x,y,z coordinates given for some points.
My goal is to export this 3D diagramm to svg -> I will have to make a projection as svg is not (yet) able to handle 3D.
So my input is a 3D diagramm with x,y,z coordinates and the output is a 2D view reduced to x,y coordinates.
Does anyone know a (preferrable small) java lib like
this one for javascript?
The projection might be just point3d to point2d. That is all I really need.
Thank you!
If all you need is something simple then I might say just write it yourself. If you don't need to move the camera you can assume a lot of the calculations zero out, and you can just do the following to get the 2d coordinate for any 3d point:
rect2d.x = rect3d.x / rect3d.z;
rect2d.y = rect3d.y / rect3d.z;
Doing that you can just simple take all of the 3d points that make up your polygon, and use the 2d points as your SVG primitive. The tricky part you're going to have to deal with is hidden surface removal, but that's not too hard. Shading is going to be your real problem, but maybe you can play around with gradients to emulate light.
Have a look at JFreeChart. Have a look at Batik for saving it to SVG
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 5 years ago.
Improve this question
I'm looking for a Java library that is capable of performing spatial calculations on sets of lat/lon data. Here are some of the functions that I'm looking for:
Calculate the Great Circle distance between two points
Determine if a point lies within a simple closed polygon, where the polygon is defined by an ordered list of points
Determine if the line between point "A" and point "B" intersects a simple closed polygon, where the polygon is defined by an ordered list of points
Determine if point "A" is within a certain radius of point "B"
What I'm NOT looking for:
I don't want a library that is dependent upon a database geospatial component, such as Oracle Spatial, and cannot function independently.
I don't want a library whose purpose is to generate graphics/maps/etc. I am building an analysis module for an existing application and the end goal is not to create pretty pictures.
I don't want a library for searching large amounts of spatial data. If it also happens to do this, that's ok, but I'm not going to use that feature.
The organization is planning to acquire a license for Oracle Spatial eventually (so spatial searching will be covered at that point), but for now I need to implement the analysis functions that I have mentioned above on small data sets without relying on database-supplied spatial support.
I believe GeoTools would satisfy your requirements. Note that it does have facilities for doing graphics/maps, but they can be left unused easily enough.
There is a new library Spatial4J that seems to fullfill your needs, it supports various spaces and shapes
Spatial4j is a general purpose spatial / geospatial ASL licensed open-source Java library (...)
I haven't used it so far but the README is complete, and repositery is rather popular, and it's available on maven repositery
I was looking for such spatial library when I end up both on the repo and on this question.
Simplelatlng gives more simple API for this:
https://code.google.com/p/simplelatlng/wiki/GettingStarted
In spite of your desire to avoid a library that is used to draw maps, I'd recommend OpenMap. The com.bbn.openmap.geo package of that library does most if not all of the things you are asking for.
I've used STRtree java class to index by lat lng data and distance queries
https://locationtech.github.io/jts/javadoc/org/locationtech/jts/index/strtree/STRtree.html