Android: Saving constucted image on screen - android

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.

Related

tensorflow object detection from image not from live Camera

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.

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 to check if image exists in Gallery or not?

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!

Android custom camera api shoot pictures with custom png as background

I want make an Android app with custom camera API, which can take pictures with some png files as frames(Like some web came apps in PCs). And also first I want to take a picture of ball(or something) which act as frame for the second photo that I am going to take. Anybody have an idea?
Most devices already have a camera application, which you can start for the result if that suits your requirement.
But if you have more extensive requirement android also allows you to directly control the camera. Directly controlling the camera is much more involved and you should access your requirement before deciding on either approach.
You can refere to the following develper guides to get details of both
http://developer.android.com/training/camera/photobasics.html
http://developer.android.com/training/camera/cameradirect.html
Once you get the Bitmap, you can use the canvas element to combine the two bitmaps.

Displaying modified live camera preview

I've currently made an android app that can display a live preview of the camera, but I'm looking for a way to perform live pixel manipulation (ie, make the image grayscale, sepia-toned, etc.). As of yet I haven't found any code for someone whose done this before.
Any help would be appreciated.
You could use the Camera.Parameters to set the appropriate effect. Read more about it here.
If you want to do the manipulation by yours then use onPreviewFrame of camera. This gives you raw byte[] of YUV format (its by default, you could set it to other formats also. Look here for setting the preview format).
Now you could able to perform any pixel manipulation you want on byte[].
Hope this helps!
I have answered this question here. In short, this tutorial gives you probably the best way, how to achieve this (by using OpenCV, a free Computer Vision library). You can download their example application from their website as well.

Categories

Resources