Face recognition in Java - java

Can any one suggest me an open source face recognition framework in Java?

There are a few open-source Face Recognition Java systems you can try, but don't expect much, because I am looking for the same thing but I'm still looking for a better option!
Note that finding any face within in image is called "Face Detection", following any face is called "Face Tracking", and determining the identity of a detected face is called "Face Recognition". I'm telling you this because you probably have to use different software and algorithms to do each one! The answer by Paul tells you that OpenCV can do Face Detection easily (Haar Cascade Detector), but not Face Recognition as easily (actually it does have a way to do Eigenface Recognition), which it sounds like you need Face Recognition, so OpenCV isn't necessarily your best option since you are using Java.
You can try FAINT which does both Face Detection and Face Recognition in Java, but it is pretty much undocumented. There is also "http://darnok.org/programming/face-recognition/", but I can't seem to get good results out of it. There is also "http://uni.johnsto.co.uk/faces/" for Face Recognition, and "Neuroph" for Face Recognition / Detection.
If you find a good solution, please tell me at "draw3d#shervinemami.co.cc"
Good Luck!
Shervin Emami

Check out OpenCV. A well-documented and acclaimed face detection technique by Viola & Jones has been implemented, known as Haar cascade.
A complete tutorial -- from training to experimentation -- is available here. Note that you don't actually need to do training; OpenCV comes bundled with several feature cascades, including a few for face detection.

Accurate face recognition is a task that can be broken into several steps:
Face detection
Facial landmark point discovery
Rotation, cropping, alignment, and scaling using your landmarks
Facial descriptor point discovery (these are not human readable)
Comparison to known faces to find the closest match
This can be done with several libraries but requires bytedeco wrappers for OpenCV and Caffe as well as a library such as ND4j for matrix comparison.
OpenCV has HAAR cascades for face detection and can use flandmark for facial point recognition. This will allow you to perform steps 1-3.
Facial descriptor discovery can be done using the bytedeco wrapper for Caffe and VGG Face Descriptor library (http://www.robots.ox.ac.uk/~vgg/software/vgg_face/)
Finally, Nd4j can be used for comparing images. If you have enough images classified by individual, perhaps you can use a neural network from the library for classification.

Related

Object Detection?

I need to detect objects from an image taken by the camera in Android, however, I cannot seem to figure out how to do so. Many of the tutorials I found online are about Face detection or use machine learning to detect objects of a certain shape, however, I need a method for general objects. Is it necessary to use OpenCV, and/or would ARCore be useful in this scenario? Or is there another API that could be used with Android for this?
You can implement with OpenCV much easier than other image processing libraries. There is no general method for all objects. However, you can start digging from the image segmentation to create your own custom image transformation algorithms.
https://opencv-java-tutorials.readthedocs.io/en/latest/07-image-segmentation.html
There are trained models for object detection. You can use one of them. I suggest exploring this. https://github.com/tensorflow/models/tree/master/research/object_detection
Best regards.

Java Sample Face Recognition

I'm trying to develop a system whereby somebody can take a picture of somebody's face and, after the image has been sent to a remote server, the client will be able to read information about the person.
I have, previously, experimented with JavaCV, however, I have found it too inaccurate for my purpose. I have tried these JavaCV algorithms so far:
Fisher Face Recognition
Eigen Face Recognition
LBPH Face Recognition
However, I need to build a facial recognition system. This will be 'standalone' and will not be run on Android (for example). I need some help in choosing the correct java sdk/library (and also whether commercial solutions, such as 'Cybula', 'NeuroTechnology' and 'Sensible Vision' can be avoided).
Any help would be much appreciated!
Thanks,
Matt
Face recognition is only the last step in the process. To solve this problem, you first have to find the face in the picture (face detection) and then in the detected face you will have to extract the characteristics of the face depending on the quality of the picture, light/flash used, facial/sideways, ... (feature extraction).
Process chain:
face detection -> feature extraction -> face recognition
There are probably a hundred publications for each of these topics. It's up to you to assemble something.
Also notable: this is not the kind of problem that has one global best solution. The chosen approach is at most optimal for the one special problem that you are trying to solve.
Other keywords that you might want to consider:
face tracking
pose estimation
facial feature tracking
emotion recognition
holistic templates
feature geometry
Also noteable: most SDKs that say they do face recognition in reality only do face detection (and sometimes (rarely) feature extraction). To do face recognition you need a huge database of known faces (face features), which of course most "vendors" don't have (not talking about all those agencies though... LOL).
Try Face++ API for Java,see here.Face++ SDK for Java, can be used in Android project.
It is recommended that Face++ free APIs are easy to use.Enjoy it :)

Facial Recognition in Java/Processing

I am doing a project that requires some facial recognition. I am attempting to find a Java implementation of this. I am not looking for facial detection. We are trying to do facial recognition through a live camera feed.
Is there any way to implement this in Java or Processing?
At the moment the only ones I have been able to find are in some type of C, which is not going to work for me.
I am working on the Face Detection/ Face Recognition topic as well. I can recommend the following links for Face Recognition:
Direct Java Implementations:
JavaFaces: A Java Implementation of Face Recognition with Eigenfaces
Explanation and Refactoring of the above library
Article Face Recognition using Eigenfaces
Implementation with OpenCV so you could use JavaCV to implement FR in Java:
OpenCV implementation of Face Recognition
I used the first approach - using javafaces directly. If you accomplish using OpenCV/JavaCV to make FR work give me a hint please.
Cheers
For Processing, I recommend the OpenCV for Processing Library. Easy to use and with a lot of examples.
To complete the answer:
A repository of Processing examples for ITP fall workshop about face detection, recognition, and miscellaneous tracking methods.
Face-It by Shiffman
Although quite old question but still relevant.
You can use opencv library. Although its written in C++. But it offers java bindings too. Only drawback is you will have to build java bindings yourself. Here is one article written by myself which explains the procedure to build the java bindings and sample programs for facial recognition.

Which SVM library to use on Android?

We are trying to have an online handwritten text recognizer for the Android platform. The inbuilt Gesture Recognition in android uses (from what I gather from the code) a K-NN checking of points, most probably the control points of a smoothed Bezier curve.
Instead of that we'll get some standard feature data from the points generated by the user on the touchscreen and then train an SVM for about 50 character classes (initially) to check how well our feature selection is working.
So considering that this SVM will have to run on a mobile phone which may not be state of the art in terms of processing power, which library should be used? Also to be considered is which library will be most easily integrated into development on the Android SDK using Eclipse IDE?
I have LibSVM in mind, but anyone with experience of using such on mobile platform should be able to give an educated guess of what to go for.
Thanks in advance.
I gather that what you need to do on the Android device is only evaluating the SVM on new data and not training. In that case, you really don't need any library. You just need to output the model (the weights) from LIBSVM or whatever library/method you plan to use, into your source code (whatever it is) and evaluate it on new data as your Android application requires.

Count the number of objects in an Image

I am investigating the possibility of image processing to identify certain objects and also count them in an image.
I will be given a picture and I need to identify the number of boxes present in that image.
Does anybody have any experience with any Machine Vision/ Image Processing libraries like ImageJ, Fiji, JAI, jMagick ,Java Vision Toolkit? Which do you think is best suited for the job? What do you guys suggest? If the APIs can be used from Java, it would be better. Thank you.
Edit:
I am dealing with warehouse brown boxes. Yes I am talking about regular photos. The source is usually a mobile phone picture.
Edit2:
I am sorry the answer got autoselected. : (
I have never used the libraries you listed but I have used OpenCV.
OpenCV is a well supported and proven computer vision library. It has built in features to count the number of primitive shapes in an image. It is written in C++ but you could create a small wrapper to be invoked via JNI.
RoboRealm is another proven computer vision system used by robotic hobbyists. It is a closed source commercial product that uses a socket based control API.
http://opencv.willowgarage.com/wiki/FullOpenCVWiki
http://www.roborealm.com/index.php
If you must stick to Java, you can still use OpenCV.
If it's just boxes you can use Hough Transforms to detect them.
You can use OpenSURF to detect phones based on source images you feed to it.
Don't think this would be feasible in your case: HAAR Cascades. You could create a custom HAAR clasifier, but the training process can be quite time consuming.
HTH,
George
In Java, there are several projects that extend the Java Advanced Imaging API to provide computer vision:
JavaVis
image processing in java + IPJ - computer vision extensions for JAI
Java Vision Toolkit - JVT (EDIT: opps, this is mentioned in the question.)
There is a paper for JavaVis which introduces the library, compares and constrasts with these other two libraries mentioned.
JavaVis has these features:
handles 2D and 3D images (3D being most relevant in this case)
Has a GUI for inspecting potential results
Matlab image export
Also for java is NeatVision. Unlike the others, documentation is clearly visible for this project.
None of these projects are going to give you a simple turnkey solution. You will need to understand how computer vision works, and create a sequence of processing steps on the photos to help get the best results from the vision algorithms. To that end, JavaVis maybe most useful, since it is aimed towards teaching computer vision.
If you are not talking about real time image processing, you could write an API to Amazon Mechanical Turk.
Are you willing to develop your own code for that? There are several techniques that can be applied and tuned to your specific problem, but I never used a packaged library, always developed my own code. I can provide references for that if you're interested.

Categories

Resources