yingminisize / droidar

Automatically exported from code.google.com/p/droidar
0 stars 0 forks source link

How to avoid camera apect ratio issue #14

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Hi all,

I currently testing the DroidAR lib, however I've got an issue with the camera 
aspect ratio:

When moving the phone I can see the aspect ratio changing and the video feed 
seems to be stretched. Is there anyway to lock the orientation maybe in order 
to avoid this behavior?

Thanks for the great work.

Hidden

Original issue reported on code.google.com by dev.hidd...@gmail.com on 22 Sep 2011 at 11:26

GoogleCodeExporter commented 9 years ago
do you mean the ratio flips when the phone switches from landscape mode to 
normal mode or the other way around? this should normally not happen when you 
use the manifest in the droidar project. there switching these modes is blocked.

Original comment by simon.heinen on 22 Sep 2011 at 3:22

GoogleCodeExporter commented 9 years ago
I use the same manifest. Actually I can also notice this behavior with your 
APKs.

I sent a photo to illustrate.

Original comment by dev.hidd...@gmail.com on 22 Sep 2011 at 3:55

Attachments:

GoogleCodeExporter commented 9 years ago
i know this problem, its because of the different screen ratio in comparison to 
the camera preview ratio. 
The solution would be to calculate the corect size for the camera preview view 
but this would lead to a black area on the left or right side of the screen. i 
think its better this way, because normally the user would not use the device 
in this rotated position. we added the "black area" solution for marker 
detection and you can find the solution in here: 
http://code.google.com/p/droidar/source/browse/trunk/ARMarker/src/markerDetectio
n/MarkerDetectionSetup.java
Search for the optimalLayoutParams field and understand how it is calculated, 
you will have to do the same in your custom setup. if you still want this fixed 
i can fix this in a week

Original comment by simon.heinen on 22 Sep 2011 at 6:44

GoogleCodeExporter commented 9 years ago
Isn't it a camera calibration issue? It maybe annoying to fix because of 
Android fragmentation... Anyway, I'll have a look at the markerDetection sample.
Don't bother working on it. Focus on your exams! ;-)

Original comment by dev.hidd...@gmail.com on 23 Sep 2011 at 8:03

GoogleCodeExporter commented 9 years ago

Original comment by simon.heinen on 24 May 2012 at 6:26