portrait mode image saved as landscape mode by requestCameraImage - android

I am using Metaio SDK 5.3 (for Android) for Instant Tracking.
My aim - I want to capture an image on device A and want use the same image for tracking on device B.
My approach - I have extended InstantTracking tutorial to capture an image and save it to send it across to device B using this method,
metaiosdk.requestCameraImage(path);
And am saving the tracking XML file simultaneously, to send across to device B.
Problem - When I capture an image in PORTRAIT mode, somehow, metaio saves it in landscape mode and so the resulting augmentation is 90 degrees rotated. When I capture an image in landscape mode, the augmentation is perfect.
Instant tracking initiated by "Instant 2D" button when device was in landscape mode. Augmentation content was augmented in landscape mode, alt text
Instant tracking initiated by "Instant 2D" button when device was in portrait mode. But this time, augmentation content was augmented in landscape mode, alt text
Is there a way I can control how the captured image is saved? Or why is metaio saving the portrait image in landscape mode?
Am I missing something here? Any help is much appreciated.
Thanks in advance!

Please see the answer on Metaio Helpdesk:
http://helpdesk.metaio.com/questions/33971/portrait-mode-image-saved-as-landscape-mode-by-requestcameraimage

Related

Landscape orientation on Media pipe Android App.. The camera orientation is wrong once the app is set in landscape mode

I created media pipe android app. And remove the restrictions so that it can work in landscape. But the camera is rotated by 90 degrees in landscape mode. Is there any solution for this?
Yeah, You'll need to modify 3 files. I couldn't get it to work with Auto rotate but its working perfectly if you need it to be always on landscape. Look at the steps I mentioned here: https://github.com/google/mediapipe/issues/568#issuecomment-975439977

AOSP Build. Always Landscape Display

I'm building from AOSP source code. I have a specific requirement where I need my phone to start in landscape mode, which includes Boot Logo, Animation (Well these can be done by rotating the animation frames). I would want to restrict the device to display only in landscape mode. I have used rotation lock app but I want to have it as part of the OS so the "Android is starting" boot message also will be displayed in Landscape. Where can I make the required changes in the source code? Your inputs are much appreciated.
You can set the user rotation in Android. But it only take efferts after the Android boot completed.
If you want to rotate the screen of boot logo, and boot animation, you should rotate the display in low level. There are some place to define the rotation in the display driver and bootloader.
I don't know the exact code place. You may ask you vendor whether the display rotation can be configured. I know that MediaTek provided the configuration to rotate the display.

Orientation of Phonegap camera picture (Android)

I've been searching for a while, but haven't found a solution.
I'm trying to get my app to capture a photo but always force the photo to be a portrait photo, regardless if you take the photo with your phone in portrait or landscape (Pretty much how Snapchat handles photos being taken).
I've made the app only portrait and that works fine, but if I take a photo with my phone in landscape, the android camera then flips the photo 90 degrees to be landscape.
As it's a portrait only app, I want to be able to show the full image in portrait (the user can turn their phone if the image is sideways!)
Any thoughts on this? I've tried setting targetWidth, targetHeight & correctOrientation but cannot seem to get it to work at all.
Here's what currently happens:
http://postimg.org/image/9k51ptfb1/
And here's what I want to happen:
http://postimg.org/image/mkxvu7nlj/
Note - the suggested duplication has an answer of "can't be done" with no other details, which is obviously not an answer!
Thanks,
Gary

Hint user to flip device when taking a Picture

In a part of an app I'm building the user should take an image / pick one from the gallery. The thing is, the image must be oriented horizontally. I would like to show the user a hint on-screen to flip his device if he is holding it in portarit, like google is doing in their new camera app (only in video mode, though)
Is it possible to do this without creating my own camera activity? I'm currently using ACTION_IMAGE_CAPTURE intent to open the default camera.
Eventually, I've built my own camera application which detects rotation and hints the user to rotate the device if it's in portrait mode.

Do I have to use the accelerometer in Android to get my photos to orient correctly?

I notice that when you take photos with the native camera app, they come out portrait or landscape (as they should), however, when I take photos in my app using the Camera class, they are always landscape, no matter how I'm holding the device.
I'm really hoping I don't have to monitor the orientation of the device and manually rotate the images... is there a less silly way to get this done?
TIA
You dont need to use accelerometer. You can just check the orientation by the time the photo is taken.
Developer Android
getResources().getConfiguration().orientation

Categories

Resources