Ask Your Question

AFK's profile - activity

2016-05-31 10:00:14 -0500 received badge  Popular Question (source)
2014-04-01 04:47:40 -0500 received badge  Student (source)
2013-12-07 06:19:03 -0500 commented answer Android Native OpenCV sample: camera preview changes with orientation.

landscape orientation in the Manifest file solved the problem.

2013-11-13 15:58:24 -0500 commented question Android Camera opens in landscape mode orientation for front camera in openCV\javaCV

thank you @bunta

2013-11-13 15:26:54 -0500 answered a question Android Native OpenCV sample: camera preview changes with orientation.

Thank you Alexander,
if I understand well, the rotation of the image is not an OpenCV feature, correct?
In fact, I guessed so. I take a little of your time just to make a simple example.
I have two Android devices, a Galaxy S2 with Android 4.0.3 and a Nexus 10 with Android 4.3. The two device behave in a very different way for the Camera application (the default official camera app installed, to take photographs).
Galaxy S2: when rotating the camera, from landscape to portrait to landscape etc., the image does not update with the orientation.
Nexus 10: every time orientation changes, images updates: it freezes and restarts after 'processing' the rotation. but anyway, the image still maintains the same aspect and orientation...
It's easier to see it on the device than to explain.
This makes me think it must be an Android feature.
In fact I would like to reproduce the 4.0.3 behaviour (much better IMHO) on 4.3, do you think this could be possible? The change on the manifest will do?

For the native sample, I will surely check it out. I also made some fixes, I will be pleased to send you if I do not find them on the 2.4.7. Thank you again.
AFK

2013-11-13 14:53:14 -0500 received badge  Supporter (source)
2013-11-11 14:19:35 -0500 received badge  Editor (source)
2013-11-11 06:56:47 -0500 received badge  Necromancer (source)
2013-11-09 11:23:01 -0500 asked a question Android Native OpenCV sample: camera preview changes with orientation.

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.

  1. it only started when the orientation was landscape
  2. it crashed when trying to put the device portrait
  3. 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:

  1. in landscape mode, 90 deg CCW with respect to portrait, everything is well, the text above is aligned with the image from the camera.
    image description
  2. in portrait mode, the image is stretched and rotated 90 deg CCW.
    image description
  3. in landscape mode, 90 deg CW with respect to portrait, image is rotated 180 deg, text is correct and image upside down.
    image description

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

AFK

2013-11-09 10:09:10 -0500 commented question Android Camera opens in landscape mode orientation for front camera in openCV\javaCV

hi Bunta, did you solve your problem? would you please let me know? thank you. ciao

2013-11-09 10:03:59 -0500 answered a question OpenCVManager service is incompatible with this app. Try to update it via Google Play

hi, you probably already solved your problem, by the way: OpenCV Manager was not compatible with Android 4.3 (API 18) until a couple of weeks ago, with the version 2.12, library version 2.4.6.2 rev 4. you should have solved your problems if you updated OpenCV Manager. ciao a.