Hello everyone,
I have read several questions about this topic, but not one was really focused on what I experienced.
I am running the native opencv sample on my cell and tablet: Samsung Galaxy S2 and Google Nexus 10.
on both devices, the sample did not work very well.
- it only started when the orientation was landscape
- it crashed when trying to put the device portrait
- the optimal resolution calculated was always limited to 640x480, no matter what device was selected
I took a glance at the code, to see if there were some enhancements possible: in fact, yes, it seems there are.
I figured out how to make it select a better resolution, and how to make it work also in portrait mode. In fact, these were little changes, which did not affect algorithms inside the sample.
Now the application works, but what I see is the following:
- in landscape mode, 90 deg CCW with respect to portrait, everything is well, the text above is aligned with the image from the camera.
- in portrait mode, the image is stretched and rotated 90 deg CCW.
- in landscape mode, 90 deg CW with respect to portrait, image is rotated 180 deg, text is correct and image upside down.
Some forum members (Itay) suggest to take the image and rotate (with a combined transpose and flip) in order to have it ready to display. I did not try, but I am positive it will work.
But I am looking for a different solution, if anyone can advice:
the image rotation happens when handling a command of the APP_CMD_INIT_WINDOW type.
Is it possible to check the orientation of the display and prevent OpenCV from rotating the image? Does it make sense? I would prefer not to affect java code or XML.
Did anyone encounter such a behaviour?
Sorry for the length. Thank you