Ask Your Question
0

frame image transmitted is upside down in android

asked 2016-10-18 09:23:07 -0600

Morgan Jeong gravatar image

updated 2016-10-18 09:25:49 -0600

image description

My client sent this picture. the picture is showing that objects are upside down.

He is using Nexus 5X and android 7.0 (Nuget) OS.

i just locked OpenCV Activity orientation to landscape.

It is my manifest

 <uses-permission android:name="android.permission.CAMERA" />
    <uses-feature android:name="android.hardware.camera.autofocus"  />   

    ...

    <activity
                    android:screenOrientation="landscape"
                    android:name=".opencv.OpenCVCameraActivity"
                    android:theme="@style/AppTheme.Fullscreen" />

I have tested it on my testing devices and a lot of emulators with cam.

Galaxy Note 2, Galaxy 3, LG G3, AVD API 24, AVD API 23, AVD etcs..

All of those devices showed me working correctly except my client owns.

I can not be able to debug the phone. Because, My client lived far away.

Does anyone have any idea? Please, give me piece of advice to resolve it.

edit retag flag offensive close merge delete

Comments

looking at the keyboard, the picture does not only seem to be upside down, but also flipped horizontally (so rotated by 180degrees), so as if the phone was held the wrong way. I cannot see how this could be a openCV issue, is your client also having trouble with other apps?

benT gravatar imagebenT ( 2016-10-18 10:24:48 -0600 )edit

i found an article on google.

https://9to5google.com/2015/11/07/why...

OpenCV for Android is using older Camera API :/

Morgan Jeong gravatar imageMorgan Jeong ( 2016-10-18 13:19:41 -0600 )edit

1 answer

Sort by ยป oldest newest most voted
0

answered 2016-10-18 15:44:20 -0600

tibuurcio gravatar image

updated 2016-10-18 16:03:36 -0600

I have a Nexus 5X and after trying a lot of workarounds for this problem I simply locked my Activity orientation into android:screenOrientation="reverseLandscape" mode instead of only landscape and it's working properly.

Keep in mind that this will probably make so that your app presents the same issue in the phones you have already tested. This is probably due to the fact mentioned in your question comments about the nexus 5x camera.

edit flag offensive delete link more

Comments

if you are using older Camera API, you can get the information of Camera mounting by querying Camera.getCameraInfo. the values is normally 90 degree. but, Nexus 5X has 270 degree. so, i just checked the value and flip the frame buffer by using opencv.

Morgan Jeong gravatar imageMorgan Jeong ( 2016-10-26 05:24:20 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2016-10-18 09:23:07 -0600

Seen: 1,142 times

Last updated: Oct 18 '16