AndroidOpenCVCamera icon indicating copy to clipboard operation
AndroidOpenCVCamera copied to clipboard

How to resize image output from camera?

Open AnhQuanTran opened this issue 7 years ago • 2 comments

Hello. Size of image output = (h,w) = (554, 960) How to resize or get size with default camera Thanks

AnhQuanTran avatar Aug 24 '18 18:08 AnhQuanTran

Hi @AnhQuanTran. I believe the preview image size can be changed by modifying line 77 in CameraActivity.java:

        mView.setMaxCameraPreviewSize(1280, 920);

By changing these arguments, you can set the max width and height (in pixels) of the camera preview image.

J0Nreynolds avatar Aug 27 '18 10:08 J0Nreynolds

I want to resize image got from frame camera, not image preview. I tried changing these arguments

mView.setMaxCameraPreviewSize(1920, 1080);

But output image size still is 554x960

glReadPixels(0, 0, m.cols, m.rows, GL_RGBA, GL_UNSIGNED_BYTE, m.getMat(ACCESS_WRITE).data);

AnhQuanTran avatar Aug 27 '18 17:08 AnhQuanTran