tensorflow object detection from image not from live Camera - android

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.

Related

gallery instead of camera activity (Tensorflow) in Android

Is it possible to not use the camera activity and load the images from gallery for object detection using Tensorflow object detection API?
Obviously yes!
When you use the camera (not talking about real-time image detection, such as using Yolo with Tensorflow), you take a snapshot image and then you process that bitmap with Tensorflow. Instead of that, what you can do is, select an image from the gallery, convert it to bitmap and then process it using Tensorflow.
If you further need example or sample, I would be happy to help you out. But for that make sure you post or show what you've done or tried so far.

How do you record AR video processed by OpenCV on Android?

I'm creating an Android app that makes use of OpenCV to implement augmented reality. One of the needed features is that it saves the processed video. I can't seem to find any sample code on real-time saving while using OpenCV.
If the above scenario isn't possible, another option is to save the video first and have it post-processed by OpenCV and saved back as a new file. But I can't find any sample code for this either.
Could someone be kind enough to point me to either direction, or give me an alternative? It's ok if the alternative doesn't use OpenCV.
Typical opencv flow is, you receive frames from camera, convert to RGB format, perform matrix operations then return to activity to display in View. You can actually store the modified frames as images somewhere in sdcard and use jcodec to create your mp4 out of your images. See Android make animated video from list of images.

Compare two images using OpenCV in Android

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!

Android Video from camera

What should I read for creating a basic augmented reality app for android?
I read the android reference articles, and I learnd that I could use the Intent(using the built in app) or construct my own "costumized" app (with camera).
I wanted to know what I should read more about, so that I could create something basic like a shape on the screen
By the way:
Cant I just see the current image given by the camera with out the need of saving it? (all of the articles want me to save the files captured, and as you know augmented reality(in my case) does not need saving the file, but does it "on the fly" , am I correct?
you can see the preview using surfaceview while recording from a mediarecorder.
the preview can be seen using setPreviewDisplayfunction of media recorder. its pretty simple to use.
I highly recommend you have a look at OpenCV. I have not used it with Android, but I know it to be a fairly painless and accessible way to image processing.

Android: Saving constucted image on screen

My users are going to construct and image out of other images in the game, what I then need to take is capture the image they have created and save it.
Im really not sure how to capture the final image, I am using OpenGL ES so the Canvas option is viable
Thanks
I think glReadPixels is probably what you're looking for. Khronos has better documentation of this function.

Categories

Resources