Ask Your Question
0

Lower resolution with JavaCameraView in Android

asked 2013-03-06 06:11:44 -0600

MysticBE gravatar image

I was wondering how to get a lower resolution when using the JavaCameraView

public List<size> getResolutionList() { return mCamera.getParameters().getSupportedPreviewSizes(); }

public void setResolution(Size resolution) {
    disconnectCamera();
    mMaxHeight = resolution.height;
    mMaxWidth = resolution.width;
    connectCamera(getWidth(), getHeight());
}

public Size getResolution() {
    return mCamera.getParameters().getPreviewSize();
}

My resolution is now 960x720, but I want to lower it for (hopefully) better performence, but I coulnd't find any solutions on how to solve this

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
2

answered 2013-03-06 06:58:57 -0600

There is a sample tutorial-3-CameraControl in OpenCV4Android SDK. It shows how to change preview resolution. If you want to scale up image some modifications in CameraBridgeViewBase class is needed (call of canvas.drawBitmap).

edit flag offensive delete link more

Comments

Thank you, is there anywhere were I might find some more information about how to modify this exactly, cause I would like the resolution to be spread all over the screen instead of the small area (320x240 for example). In http://answers.opencv.org/question/8111/android-stretch-camera/ you say that it isn't possible, has anything changed yet or is it still impossible? And what is the difference with fitting in view size?

MysticBE gravatar imageMysticBE ( 2013-03-06 10:39:56 -0600 )edit

Question Tools

Stats

Asked: 2013-03-06 06:11:44 -0600

Seen: 5,250 times

Last updated: Mar 06 '13