image pattern matching in java - java

Earlier i was searching for fingerprint recognisation in java, but didn't find anything how to implement. So, now i have decided to just matching the pattern of two images of fingerprint after getting fingerprint manually. And then, compare their pattern. And i think, this can be done by comparing two image and matching their pixel similarity (as per my finding).
So, now i am looking for any API/library/SDK/framework or anything available in Java, for comparing pattern of two images and getting the percentage match between them.
I'll appreciate any idea !!

Have a look at WEKA. There might be something in there for your needs, but as Stefan Kendall already mentioned it's not easy at all.
Also, http://opencv.willowgarage.com/wiki/ might be useful, but unfortunately there is no java version yet.

I haven't used it, or even properly studied it - but from what I have seen, this project may help you. (Currently it is for Java and .NET):
http://sourceforge.net/projects/biometricsdk/

Related

Curve matching in Java

First question here so sorry if anything I ask is completely stupid.
I'm working in a shape recognition project where it is supposed for me to develop an application that receives two images: an original one and a sketch made by a user. I am supposed to detect contours of the two images and find the best match in the original image corresponding to the sketch made by the user.
I am already learning some basics about the Canny edge detection and was able to get the contours of several images. After having the contours, I need to analyze all contours in the image and find the best match, disregarding translation, rotation, scaling and occlusion.
Then, I found this code that does exactly what I want:
http://www.morethantechnical.com/2012/12/27/2d-curve-matching-in-opencv-w-code/ but is in C++.
Do you know any alternative for similar code in Java or any algorithm that could be useful to me? I also discovered BoofCV but it seems that such task is not implemented.
Thank you for your patience.
EDIT:
I've been searching for other ways of doing this, and I found the Hausdorff distance:
http://cgm.cs.mcgill.ca/~godfried/teaching/cg-projects/98/normand/main.html
Is it possible to modify this algorithm to be rotation invariant? They only talk about translation and scaling.
As you mentioned you already have the source code in C++ and can't find a Java version - possibly your best bet might be to convert the C++ code into Java code. If you don't need all parts of the C++ program, you might want to covert only the parts (classes) that you need.
Conversion from C++ to Java might not be always trivial but I am guessing it might be easier if you know exactly what you want and how you want your program to behave. Below is a link to some conversion tools - although they might not be free.
http://www.researchgate.net/post/How_to_convert_the_C_C_code_to_java2

JavaPlot: How can I use the fit method of GNUPlot?

I have a set of 6 points. Now I want to create a trend line (fifth-degree polynomial). I don't have much experience with GNUPlot, yet, but I found the "fit" method which should do exactly what I want. The problem is that I don't know how to call the method within JavaPlot. Even if it wasn't implemented in JavaPlot it should be possible to use that method somehow, right? The JavaPlot website even states:
Moreover, is flexible enough to give special parameters to gnuplot, even if the library does not support it (yet).
Does anyone know how I can plot a fitted (trend) line in JavaPlot?
JavaGnuplotHybrid might be a solution. It allows hybrid programming with Java and gnuplot, which means all gnuplot features are supported. You need to learn some bit about gnuplot first though.
For more details:
Project page: https://github.com/mleoking/JavaGnuplotHybrid
Wikipedia: https://en.wikipedia.org/wiki/JavaGnuplotHybrid

JOpenChart dates on x axis

I am trying to use JOpenChart, unfortunately, the documentation stinks, not even a javadoc as far as I can see.
My problem is that I am trying to use a date on the x axis, and I don't see how this is done. The tutorial implies that I need to use ObjectChartDataModel, but the constructor takes DataSet[] instead of DefaultDataSet[], which is probably fine. I assume one can polymorph to the other (hard to know for sure because, no javadoc is provided), but it takes an Object[] as a second parameter and I have no idea what that is.
Does anyone know this tool that can either answer my question or at least point me at where the documentation exists. The only documentation he seems to offer is this: http://jopenchart.sourceforge.net/tutorial.html which is nice, but doesn't really cover all the bases.
May I suggest http://www.jfree.org/jfreechart/ or if you can afford it http://www.jidesoft.com/products/charts.htm. I've used both and they each have their strengths. The chart you are trying to use I never had much luck with.

Java library for creating straight skeleton?

I have as an input a 2D polygon with holes, and I need to find it's straight skeleton, like in the picture:
(source: cgal.org)
Maybe there is a good Java library for it?
And if not, can you point me to the good explanation of the algorithm, so I could implement it myself? (I haven't found good resources on Google)
I wrote this a little while back. Not sure if it's robust enough.
https://github.com/twak/campskeleton
(edited for 2018...)
See http://www.sable.mcgill.ca/~dbelan2/roofs/roofs.html which contains an applet.
You may be able to use the JTS Topology Suite. It is a very capable library that I've used on a number of projects - never for straight skeleton, but it may be possible.
Edit:
Ah. I see that "Straight Skeleton" is a technical term. The wikipedia article references several algorithms. Have you looked at those?
As I understand it, you have a (convex?) polygon. From it, you subtract 1 or more (potentially non-convex) polygons. You want to turn the result into a set of polygons without holes. Are there extra rules that you're trying to apply?
I have a hard time coming up with a set of rules from the example that you provided. The outer polygons are non-convex; so it doesn't seem like you're trying to find a convex set to represent the result (which is a relatively common task).
If you could use the breakdown shown below, the algorithm is pretty simple. Can you clarify?
Can I ask u what is your purpose for finding Straight skeleton? Is it personal or commercial? I would be interested in knowing how you r using it to solve real time problems? I do have a java library that does that. My algorithm is listed here http://web.stcloudstate.edu/rsarnath/skeleton/definition.htm

Image Comparison Techniques with Java

I'm looking for several methods to compare two images to see how similar they are. Currently I plan to have percentages as the 'similarity index' end-result. My program outline is something like this:
User selects 2 images to compare.
With a button, the images are compared using several different methods.
At the end, each method will have a percentage next to it indicating how similar the images are based on that method.
I've done a lot of reading lately and some of the stuff I've read seems to be incredibly complex and advanced and not for someone like me with only about a year's worth of Java experience. So far I've read about:
The Fourier Transform - im finding this rather confusing to implement in Java, but apparently the Java Advanced Imaging API has a class for it. Though I'm not sure how to convert the output to an actual result
SIFT algorithm - seems incredibly complex
Histograms - probably the easiest out of all mentioned so far
Pixel grabbing - seems viable but if theres a considerable amount of variation between the two images it doesn't look like it's going to produce any sort of accurate result. I might be wrong?
I also have the idea of pre-processing an image using a Sobel filter first, then comparing it. Problem is the actual comparing part.
So yeah I'm looking to see if anyone has ideas for comparing images in Java. Hoping that there are people here that have done similar projects before. I just want to get some input on viable comparison techniques that arent too hard to implement in Java.
Thanks in advance
Fourier Transform - This can be used to efficiently can compute the cross-correlation, which will tell you how to align the two images and how similar they are, when they are optimally aligned.
Sift descriptors - These can be used to compare local features. They are often used for correspondence analysis and object recognition. (See also SURF)
Histograms - The normalized cross-correlation often yields good results for comparing images on a global level. But since you are just comparing color distributions you could end up declaring an outdoor scene with lots of snow as similar to an indoor scene with lots of white wallpaper...
Pixel grabbing - No idea what this is...
You can get a good overview from this paper. Another field you might to look into is content based image retrieval (CBIR).
Sorry for not being Java specific. HTH.
As a better alternative to simple pixel grabbing, try SSIM. It does require that your images are essentially of the same object from the same angle, however. It's useful if you're comparing images that have been compressed with different algorithms, for example (e.g. JPEG vs JPEG2000). Also, it's a fairly simple approach that you should be able to implement reasonably quickly to see some results.
I don't know of a Java implementation, but there's a C++ implementation using OpenCV. You could try to re-use that (through something like javacv) or just write it from scratch. The algorithm itself isn't that complicated anyway, so you should be able to implement it directly.

Categories

Resources