Object Detection? - java

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.

Related

Get Image dimension on click in Android using open cv and java?

I am new in android development and I have to make a module for android app which automatically detects the exact dimensions of an object being photographed by the user's camera.
I have stumbled upon many examples and the best one is:
http://www.pyimagesearch.com/2016/03/28/measuring-size-of-objects-in-an-image-with-opencv/
I have read this complete post. But I think there must be also a way to get the object's size without a reference object.
could someone suggest any way to achieve this. Or some API which might be providing this capability.
Used the pyimagesearch's way of calculating dimensions of the package. Right now this approach works fine for us. But the reference object concept is a bit non-satisfactory. But for now it's the only way I could think of.
please refer to this URL for the python solution to the problem.

Android Image editing/warping with Java?

Hopefully not making this too vague... but I have been dealing with a lot of image scaling and manipulating with an app I'm working on and wanted to know:
Is it possible/feasible to warp images using java code and if so, is it possible? I have read up on JAI but can't seem to grasp it very well. Is there any form of built in implementation that would work with Android 2.3 or higher?
Any tutorials or examples that someone may have come across would be a great help as I have been researching for a while and can't seem to gain any ground.
End goal: to be able to warp an image (point to point by pixels) in multiple places and then saving the bitmap. This would be processed behind the scenes and show the user the end result.
do you have an example of the kind of warping that you want to do? It's certainly feasible but you'll probably end up doing pixel-by-pixel manipulation to generate the warped image.
there is a previous discussion here:
android image processing tutorial?

Android - Bitmap OCR

I get this problem:
The type java.awt.image.RenderedImage cannot be resolved. It is indirectly referenced from required .class files
I know it means that there is no reference to it in my build-path and I heard that java.awt.image is not in the Android SDK. So I am trying to figure out how to work around it.
This is my code:
Bitmap image = (Bitmap)data.getExtras().get("data");
String text = new OCR().recognizeEverything(image);
Obviously you can see that I am trying to use a OCR library. If it is impossible to get around this then can anyone show me a reference to maybe a "how to make an OCR program" or something along those lines. I pretty much have NO experience with images.
Thanks!
If your OCR library uses java.awt classes internally, you can't use it on Android. Porting it to use Android classes instead is likely to be non-trivial, especially if you have no experience. This library is being actively developed, and is reported to work on Android (I haven't personally used it). You might want to give it a try. Also, searching helps too: this is a fairly frequent question on SO, you might get some other ideas from previous answers.
We are developing pure java OCR library here:
http://sourceforge.net/projects/javaocr/
At the moment, there is some image processing stuff, invariant moment based recognition
and high performance binarisation. There are also demos schowcasing complete roundtrip for android ( gathering samples, performing recognizer training, performing reconigtion )
I already published 2 appluications based on it:
http://www.pribluda.de/android/charger/
http://www.pribluda.de/android/ocrcall/

is there any inbuilt function for image recognition

i want to use a function for image recognition
i dont want to make an algorithm.
please suggest me a function where i could compare two images and tell whether these images belong to the same object.
please help me!.
Arbitrary image recognition is something that computers can't yet do (even for supercomputers). However, Google Goggles comes close, being able to recognize a wide range of objects. Read its limitations, and see if it suits your purpose.
Yes. There are definitely ways to do this but they all depend on what you are trying to do. If you are more specific about what you want to compare then it will be easier to give a more thorough answer.
There are some excellent libraries out there but it will require some effort on your part to learn and understand how to use them and how to use them on the iPhone.
The most famous algorithms so assist in finding images inside other images are called SIFT and SURF. Unfortunately both are patented and cannot be used commercially in an application.
Consider using OpenCV for most of your image operations.
Or you could use OpenFrameworks (google has tagged it as a phishing site for some reason, im sure theyll fix that soon)
You might also consider VXL which has started to become more popular.
Good luck!

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