How do you auto-rotate a captured image using Phonegap? - java

I'm working on an example I got from Phonegap on capturing Images using the built in device camera. If I rotate the device, the saved image stays in that orientation.
I know in javascript, I can manipulate images-- and Phonegap has a G-Calibration sensor api I can use.... but Is there a straight forward way through Phonegap to auto-detect orientation?

the problem is that the exif data (which contains the orientation among other things) is not passed by the plugin.
For this reason you need to try to understand which "way" the picture was taken.
Worst case, allow the user to rotate it.

Related

Real time emotion detection with OpenCV and Tensorflow in Android Studio

I am trying to build an Android app with Android Studio(Java), that based on a tensorflow model(pretrained in python) is able to classify the emotion of the person standing in front of the device's camera. My app needs to take the frame, apply some opencv operations like facedetection, grayscale, resize, crop, and histogram equlisation, and after that, giving the result to the model, it will predict the emotion. I have an activity that is showing the camera, but i dont know how to do all this frame manipulation and prediction in the background, when on the phone's screen the preview of the camera and the tags of the predictions, are the only things showing.
I managed to do this on PC very easly, running on the max FPS of the webcam, so i think it should be possible on the phone too.
Is there any similar project that i can get inspiration from? or does anyone know a bit of documentation or a way to do something like this ?
I would suggest checking out the Google ML Vision API's, they can easily be integrated into an Android App and are very accurate. There are many API's like the image labeller and facial labeller. Just check them out here:
https://developers.google.com/ml-kit/vision/face-detection/android
Hope I could help!

Creating 3D image model from 2D image using AR in Android

I'm new to Augment Reality and not having a compatible device to run examples provided for ARCore. I am having a few questions and want them to clear before going further as I'm getting clear about those through any mean. The app I'm working over is gonna perform the following task.
Detect a logo from a product
Create a 3D model of it using AR
display the generated 3D model at the exact same surface
Here is a sample image captured from a box. I want to display the text and logo in the 3D model.
My Questions
is it possible to display both logo and text as a 3D model or AR
supports images only?
Should I use ARCore or OpenCV or any other to do the task? which one is efficient regarding time and memory to implement?
Maybe it would be a discussion-based question but I am literally unable to find a solution for it.
Thanks everyone!
If you do not have ARCore supported device, you can try Vuforia + Unity instead. Vuforia also supports image recognition and overlay with AR. Check out this tutorial for your use case.
If you still want to use ARCore, you should check out Augmented Images feature. The challenge here if your logo has a good score to be able to work nicely for tracking and overlaying AR.
You can check image quality/score with this tool.

Capture Android screenshot without having the View

I have found a lot of examples like this:
how to Capture screen in android and covert it to image
I need to capture an screenshot of screen activity, but I'm developing an external library, so I can't get current activity of the application to get the View and then flush the bitmap into canvas. Is there another way to capture a screenshot?
If you are trying to save the image from Snapchat, you need to save the Bitmap in another way.
With a rooted phone you can access the apps storage and copy the image while the app shows it.
That way the app wont notice you took a "Screenshot" :)

How do I retrieve the photographs taken by the camera on a phone running Android OS?

I am developing an Android application that retrieves the photographs taken by the phone camera and converts it to an alternative format. How can I retrieve the photograph that has just been shot as well as those that have been shot some time ago but still exists on the phone?
Converting the image format for existing images is just a matter of recursing file storage for images, usually the sd card but not limited to it. As far as hooking into the existing camera application you'll have to review its source to see if that is possible but you can have a service listen for the camera button and start checking for new images to convert. Android does not keep a central database of images or discriminate between "camera" and "other sources" meaning someone or something will have to decide what to convert.
You also may want to consider using the existing camera app as a library and extending it so that you are guaranteed to get the image right after its created.

android - capture of the entire screen programatically

Is it possible to capture the entire screen from Android application code? I'm developing an application like VNC for Android platform.
Regards
I think that depends on what you are trying to capture. I'm sure you can use Moss's method to create a screenshot from your own application - that is, something you render yourself.
As I understand it however, capturing from other views, apps, etc. is designed to be impossible for security reasons. This is to avoid apps being able to take screen shots from other apps, which would make it easy to steal sensitive data.
yes it is. You just need to create a canvas and assign it a Bitmap, then draw to that canvas instead of the canvas you use in your onDraw method and save the bitmap on the SDcard for example.
Just to renind you that this method will work if you handle the drawing, so you should use a custom home screen for it to capture wether you want. (just get the default android home screen :D).
I don't have personal experience with it, but this open source project sounds like it might either solve your problem, or provide you clues as to which API to use:
http://sourceforge.net/projects/ashot/
Screen capturing tool for Android
handsets connected via USB to a
desktop/laptop. It is great for
fullscreen presentations, product
demos, automatic screen recording, or
just a single screenshot. Without
root.

Categories

Resources