简体   繁体   中英

Android + OpenCV: How to set camera resolution when using CameraBridgeViewBase

Hello I am using OpenCV4Android face detection sample. I would like to know how can I get my resolution of camera and set it to other value. In this example CameraBridgeViewBase.

I see that on object

private CameraBridgeViewBase   mOpenCvCameraView;

I can use

mOpenCvCameraView.setLayoutParams(); 

but every time I try to use it in some way I'm doing it wrong and my program crashes. Please help me with that problem.

try mOpenCvCameraView.setMaxFrameSize(width, height);

in the OnCreate() after mOpenCvCameraView = (CameraBridgeViewBase) findViewById(R.id.tutorial2_activity_surface_view);

I try and success in 2.4.6 tutorial 2.

BTW, check your phone camera supporting resolutions first.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM