Android Camera 4 rotating positions problem

117 views
Skip to first unread message

Tsrif Tsal

unread,
Feb 6, 2020, 11:29:25 PM2/6/20
to Kivy users support
Hi,

I develop Android App with OpenCV and I'm facing rotation problem of Camera widget. Only one landscape position is correct, and the opposite portrait, The opposite portrait doesn't change positions of other widgets on screen, they are not caught by the rotation event.

I read about rotating canvas 'before' but that's not a solution for these weird 4 different positions.

Anyone facing with the same problem, because it's crucial for the camera to work correct on rotation.

rot kivy.png

Alexander Taylor

unread,
Feb 8, 2020, 6:43:08 AM2/8/20
to Kivy users support
Are you able to provide actual screenshots of the camera in 4 different orientations? I'm not clear if your images are properly to scale, it would be useful to see exactly what is happening to the texture.

It's likely  that Kivy is displaying the raw texture provided by the camera in every case. You can correct for this yourself using canvas instructions, as a workaround.

James D

unread,
Feb 8, 2020, 6:56:09 AM2/8/20
to Kivy users support
Do you need to rotate the image with cv.rotate() or cv.flip() before placing the image in the label.

Tsrif Tsal

unread,
Feb 8, 2020, 10:48:23 AM2/8/20
to Kivy users support
Here are actual screen shots. As you can see only left landscape is correct.
Top picture is portrait and bottom pictures are opposite portrait as phone is rotating.
rotations.png
Reply all
Reply to author
Forward
0 new messages