Android: Preview Size vs Frame Size

asked 2014-04-17 13:33:41 -0600

Vion gravatar image

Hello everyone,

I'm new to OpenCV but I'm a very experienced Android Developer. Currently, I have the following goal: I want to process the live video stream of my camera using OpenCV. So far I have set up a JavaCameraView, set up the NDK methods for processing the image and get the result. This works fine.

But now I want the following: The user should not be distracted by the VideoStream that is captured of him (don't worry, the user knows that the stream is captured, but he should not see it while it is captured). So in general - I do not want a preview (however, I really need real-time tracking).

As you always need a Preview in Android to capture Videoframes, I implemented the standard workaround. I created a 1x1px surfaceview on which the preview is displayed.

And here, I have the problem. While reducing the surfaceview size, I discovered that the frame resolution of the camera for the preview frames was also reduced. This makes sense for the preview, but it does not make sense for the processing of the image.

Thus, I have the following question:

Is it possible to show a low resolution image on the surface view but process a high resoltution image? If yes, how?

Best regards, Vion

edit retag flag offensive close merge delete