Ask Your Question

cpares's profile - activity

2018-06-18 03:23:31 -0600 received badge  Taxonomist
2015-11-17 20:43:41 -0600 received badge  Famous Question (source)
2014-03-20 06:51:12 -0600 received badge  Notable Question (source)
2013-07-16 11:25:36 -0600 received badge  Popular Question (source)
2012-09-04 15:43:43 -0600 received badge  Student (source)
2012-08-27 01:51:27 -0600 received badge  Scholar (source)
2012-08-24 04:18:52 -0600 asked a question Error reading YUV buffer

Hello!

I'm trying to get high resolution uncompressed images through the camera of an Android phone (Samsung Galaxy S3). I set width and height using VideoCapture.set(Highgui.CV_CAP_PROP_FRAME_WIDTH, width) and same for height, but whenever I go to a mid-high resolution, the following error starts appearing:

ERROR reading YUV buffer: width=1600, height=1200, size=2880000, receivedSize=1036800

I'm guessing it means that the buffer is not big enough to store all the data, which I understand, but there must be some way to allocate a bigger buffer. Does anybody know how, or any workaround?

Thank you!

2012-08-24 04:12:05 -0600 answered a question How to set camera resolution in OpenCV on Android?

In case anybody ever finds this useful, I found a (partial) solution: If your VideoCapture variable is called vc, this should work:

    vc.set(Highgui.CV_CAP_PROP_FRAME_WIDTH, desiredFrameWidth);
    vc.set(Highgui.CV_CAP_PROP_FRAME_HEIGHT, desiredFrameHeight);

Mind that the combination of width and height must be one of the supported picture formats for your camera, otherwise it will just get a black image. You can get those through Camera.Parameters.getSupportedPictureSizes().

However, setting a high resolution appears to exceed the YUV conversion buffer's capacity, so I'm still struggling with that.

2012-08-23 10:01:40 -0600 received badge  Editor (source)
2012-08-23 09:59:05 -0600 asked a question How to set camera resolution in OpenCV on Android?

Hello!

I'm trying to develop an app for Android, and I would need to get a resolution as high as possible for the camera, through VideoCapture.

Right now I'm stuck in the default 960x720, which is poor for what I need, and my phone, a Samsung Galaxy S3, is able to provide, theoretically, up to 8Mpx (3,264×2,448 for pictures, and 1,920×1,080 for video, according to Wikipedia).

Is there any way to obtain a higher resolution? How?

I'm really sorry if this has been asked before; I have been looking for hours and I have found nothing.

Thank you for your time!

EDIT: I'm running OpenCV v2.4, I forgot to mention.