Ask Your Question
0

Set a specific resolution on the tutorial-3-CameraControl in OpenCV4Android SDK

asked 2013-05-27 10:37:16 -0600

MysticBE gravatar image

updated 2013-05-28 08:45:31 -0600

Oke, so basically tutorial-3-CameraControl in the OpenCV4Android SDK gives back a list of all the resolutions available for your device. But it starts at a 960 x 720 resolution for my device. What I want is that the application starts with a 320 x 240 resolution instead of having to switch manually every time from 960 x 720 too 320 x 240.

I have tried the following: Changed the size.height too 320 and the size.height too 240 in the JavaCameraView.java. This worked (it now opens at 320 x 240) BUT when I try to set it to a different resolution, it always stays 320 x 240 (cause it returns those values every time, I get that)

Is there any way to resolve this problem, and still make the application start with a 320 x 240 resolution?

 public int getWidth(Object obj) {
        Camera.Size size = (Camera.Size) obj;
        return 320;
    }

    public int getHeight(Object obj) {
        Camera.Size size = (Camera.Size) obj;
        return 240;
    }
edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

answered 2013-05-28 09:24:05 -0600

atasoyh gravatar image
public int getWidth(Object obj) {
        Camera.Size size = (Camera.Size) obj;
        return 320;
    }

    public int getHeight(Object obj) {
        Camera.Size size = (Camera.Size) obj;
        return 240;
    }

If your app get sizes using these methods, they are staticly return values.

edit flag offensive delete link more

Comments

please read the full question first, i was already aware of this. It's currently the only method to get my resolution to 320 x 240 at the start.

MysticBE gravatar imageMysticBE ( 2013-05-28 18:58:46 -0600 )edit

Question Tools

Stats

Asked: 2013-05-27 10:37:16 -0600

Seen: 521 times

Last updated: May 28 '13