Ask Your Question
0

Fail to set camera resolution higher then 640x480 using Tutorial 5

asked 2013-02-09 13:08:08 -0500

umyangxd gravatar image

updated 2013-02-09 13:12:06 -0500

Hi, I am new to Opencv and Android, and I am learning the samples provided by the opencv4android sdk. I have a question regarding the Tutorial 5.

The program shows a menu of a list of the resolutions supported by the cameras of my Acer Iconia A100 (up to 1280x720). However, I am not able to use any resolution that is higher than 640x480. Whenever, I set a resolution that is higher than 640x480, the program ignores it, and use only 640x480 to capture the image frames. Downwards works fine, meaning that I can change to any resolutions lower than 640x480.

I have tried the same Tutorial 5 on my Galaxy Nexus, and found the same problem. The only difference is now the program does not allow me to use resolutions higher than 960x620. According to the menu, the cameras on Galaxy Nexus support way higher resolutions.

Thanks for your help!

-umyangxd

edit retag flag offensive close merge delete

2 answers

Sort by ยป oldest newest most voted
4

answered 2013-02-10 12:14:14 -0500

Tutorial-5 sets camera resolution if it fits to screen. In case, when resolution is higher then View size it fails back to the maximum possible resolution. It is default Android camera behavior.

edit flag offensive delete link more

Comments

Thanks for the answer! Is there anyway to get around this? I need to capture and process higher resolution video frames in the background, meaning that I do not need to display them on the screen. I tried to hide JavaCameraView by using android:visibility="invisible" but the sdk stops streaming the frames.

Any suggestions on what I should do? I really appreciate your help.

Thanks!

umyangxd gravatar imageumyangxd ( 2013-02-10 12:44:56 -0500 )edit
3

answered 2013-02-10 23:54:03 -0500

Iwas wrong in previous answer. Resolution selection is a part of OpenCV4Android SDK logic. I review Android SDK source code and find issue. In current implementation of JavaCameraView and NativeCameraView resolution is always constrained by View size. I prepare pull request to fix the issue.

edit flag offensive delete link more

Comments

Thanks a lot!

umyangxd gravatar imageumyangxd ( 2013-02-11 12:01:15 -0500 )edit
Login/Signup to Answer

Question Tools

Stats

Asked: 2013-02-09 13:08:08 -0500

Seen: 2,302 times

Last updated: Feb 10 '13