Ask Your Question
0

Hello OpenCV Sample - camera view rotated by 90deg anticlockwise

asked 2015-01-14 01:29:53 -0600

Raj gravatar image

updated 2015-01-14 02:00:57 -0600

I refered the documentation provided at Android Development with OpenCV to create a Hello OpenCV Sample.

On launching the application in my Android Device (version 4.4.4), the camera view being rendered on screen is rotated by 90 degrees anticlockwise.

I am not sure if this is the expected behavior of the application. If not, is there some way to fix it?

Code is exactly same as that provided in this link for the Hello OpenCV example. There are no errors shown in logs. I am using Eclipse Juno with Android Development Tools (ADT) and OpenCV library - 2.4.9. Project build target is set as Android 4.1.2 (API level 16).

edit retag flag offensive close merge delete

Comments

Cant this be set inside the android SDK, where you control the landscape or portrait mode visualisation?

StevenPuttemans gravatar imageStevenPuttemans ( 2015-01-14 02:09:09 -0600 )edit

I am not sure how to set that for incoming camera feed. The application orientation (landscape/portrait) itself can be set by adding android:configChanges="orientation" and android:screenOrientation="portrait" in the AndroidManifest file.

Raj gravatar imageRaj ( 2015-01-14 07:56:53 -0600 )edit

1 answer

Sort by ยป oldest newest most voted
1

answered 2015-09-02 04:18:53 -0600

In Hello OpenCV Sample, in AndroidManifest.xml file, just add this line to your <activity> tag:

android:screenOrientation="landscape"

By this, you are simply telling your activity to always run in landscape mode. This is way of assigning screen orientation mode in Android Development. After that run your project, and you will notice that your problem has been resolved.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2015-01-14 01:29:53 -0600

Seen: 1,292 times

Last updated: Jan 14 '15