Object Recognition/Detection? - java

Here is my issue, I need to detect a bolt and quarter in an image, I have been searching and found OpenCV but from what I see its not in Java yet. How would you guys go about solving this?

There is actually a Java interface to OpenCV that you can use. Its open source and hosted on google Code.
javaCV
There's also a partial port of opencv to Java. Available here

If you are using Java, I would consider using a fully portable solution, such as ImageJ.
There are already some object detection toolboxes available ;)
See this SO post for more details.

Related

How to capture webcam input in java without an external library?

My question is exactly as the title states. I've spent some time googling and all I can find are recommendations to use external libraries. However, I'd like to do this without using any external libraries and documentation is lacking on how to go about this.
I'm afraid it is not possible. The two main approaches in java is to use either JMF or openCV. JavaFX has no plan to develop a Webcam API so it is not going to change soon.
You should look at this question: How can I take image at webcam with javaFX at win7 64bit?
Here is a link to javafx + opencv integration: http://ladstatt.blogspot.fr/2013/04/using-isight-camera-with-javafx.html
JavaFX + JMF does not seem to work now: Webcam access from JavaFx
But there is hope with JavaFX 8: https://github.com/carldea/WebcamFX
Not possible without external libs unless you depend on JNI. Period.
In the past I got good results using JTwain-based solutions.

how to capture a video from /dev port in linux using java

i am trying to capture video from my /dev/video1 usb camera using java, i was wondering as to how to actually do this? my project is supposed to capture the video and stream it to another computer. is it also possible to set up an avconv server using java?
Java does not have an extensive support for media. You can use GStreamer JNI bindings for this or switch to QT or native C/C++ GStreamer.
It's already been done for you so you might take a look into the existing projects.
v4l4j wouble be a great place to start.
update
As Andy Ross commented the library I linked is very low level and you may be looking into something more easy to use as gstreamer-java.

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.

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.

How to get video and audio streams from web cameras with Java?

How can I get video and audio streams from web cameras with Java (in a cross-platform way)?
For example, we have a computer with 3-4 USB web cameras; we want to get their streams and make them visible in the user interface. How can we perform such a thing? I need code for a simple app which would find ALL cameras on the computer and let us select camera to wach. Can any one, please share such one?
With java media framework JMF or FMJ
Here is an example with JVM
I see your comment about the solution needing to be "pure" java, but this is really "nearly" impossible. You will need to use some sort of native library for accessing the devices, with that being stated; I suggest that you look at Xuggler as your solution. Xuggler supports Windows, Mac, and Linux and they also offer example code for handling audio and video. Lastly the library is FREE.
Webcam capture example: http://xuggle.googlecode.com/svn/trunk/java/xuggle-xuggler/src/com/xuggle/xuggler/demos/DisplayWebcamVideo.java
While Xuggle does not have an example of microphone capture, you can find samples on the mailing list or you could use code written by the packet-mulitbroadcaster project found here: https://code.google.com/p/packet-multibroadcaster/
You can try my solution. It uses OpenCV to capture the image and jetty server to transmit it via WebSocket. The example has three classes and it will be easy to understand.
Now I can send only video, but I'm working on audio aswell.
I'd use flex. It can be relatively easily integrated with java backend.
UPD:
Pure Java needed
Then you should consider JavaFX solutions. I'm not a big expert in javafx, I've only written some basic test applications, but I'm sure it's a modern way of solving described problem with pure java.

Categories

Resources