I need to develop an app that captures the picture using Camera API and compare that picture with all other pictures in the database. For comparing the images i'm going to use OpenCV. But i'm new to openCV. I have set up the openCV in Eclipse. But i don't know what functions can be used to compare two images. i'm stuck here.
Comparison here is, lets say i take a picture of a plant, and i have a picture of the same plant in my database but in some other height, width and position. Here i should compare the pictures and say that they are similar. How can i achieve this kind of comparison? Help me!
Related
Hi i want to try myself on object detection on Android in images not in live camera previews and i've seen that there is tensorflow lite. Sadly the tutorials i could find are all for live camera previews and not for images. So does anyone know about a tutorial or something for tensorflow lite or some other way to detect objects in images, that could teach me how to do basic object detection?Thanks in advance!!
I think generally it's two steps:
Get image (no matter from preview or photos or anything), convert it to android.graphics.Bitmap
Do Object detection from Bitmap
The part (1) is more like an Android question. For (2), you could checkout this example
Note: To use the recognizeImage method, you need to resize the Bitmap to INPUT_SIZE * INPUT_SIZE by your own, which is not obvious.
In my application when a user captures the image before saving into the gallery.
I want to check is there any image matches with the current image (at least 50%). If any image found get the image from gallery and display to the user.
I am very new to android development. Can anyone help me out to do above task.
You'll have to use a Java library for this. I suggest taking a look at this thread.
If you'd like to develop something on your own, the basic idea is this. To compare two images, represent each of them as a matrix of pixels and compute similarity between those two matrices. If you do choose to implement it yourself, take a look at matrix similarity, cosine similarity in particular. A very simple example is here.
Good luck!
I'm from Russia. I'm learning Android. I'd like to compare two images using OpenCV. I would like to get position that difference between two images. What functions should I use? thanks
I want to do OCR for Sindhi, in an Android application, the idea is to let the person write on screen and then capture up the frame and then compare it with the images of the words pre saved in the mobile, and the image that matches up the most(using FLANN?) with the frame would have some text against it, and I just want to pronounce that text then. So please tell me if my approach is wrong, as I am new to Android and OpenCV both, or else tell me how do I start?
If I understand well your aim, you want to compare the text written on the screen of the mobile with images where text is present, right?
I've done a bit of OCR on Android and I used OpenCV and Tesseract.
Tesseract is a real OCR engine but you need to have images that are as "clean" as possible. That's why you need OpenCV to clean them up before using Tesseract.
OpenCv for Android : http://opencv.org/platforms/android.html
Tesseract for Android : https://github.com/rmtheis/tess-two
So to give you the main lines of my workflow for a similar application :
Grab the text written by the user in a string or an array of strings.
Go fetch your pre-saved images
Process them through OpenCV, OpenCV is mainly used here to clean the images by getting rid of noise especially. You should try using a Glaussian Blur, then an Adaptive Threshold and a Bitwise-NOT (OCR engines deal better with black and white images that you obtain with the Bitwise-NOT)
After you get some clean images with OpenCV, process these images through Tesseract. That will give you a string for each image that contains the detected text on the images.
Compare your different strings gathered on Tesseract with the user's text by parsing each word to find out the text that matches the best.
For the audio part of your app, I'm not sure how to proceed, they must be some libraries out there that might help.
You must be aware that using all these libraries on Android is quite a struggle, you might have problems with the build of the project, follow well the different documentation that is provided on the official websites.
Suggestions on the best (preferably easiest way) to compare two images in android.
The first image is in my SD Card.
The second image was taken using Camera in android.
How to measure percentage similarity between those 2 images??
Thanks a lot.
Android does not provide any picture comparison algorithms for you.
Therefore, you will need to write one yourself - one that fits your needs, since not all image comparison algorithms/techniques are the same, and some work better in some cases than others.
You might want to start by looking at the SIFT technique, and find an image matching algorithm that suits your requirements.