Android OpenCV "CvCameraViewListener"

asked 2014-05-30 10:12:13 -0500

MrRed gravatar image

updated 2014-05-30 10:17:07 -0500


I am trying to make an Android app that makes use of the smartphone camera. So far I have been successful running the Sample Codes provided with the OpenCV Library. However, I noticed that every single one of these codes make the following declaration:

 implements CvCameraViewListener2{...}

The methods implemented are:

public void OnCameraViewStarted(int width, int height)
public void onCameraViewStopped()
public Mat onCameraFrame(CvCameraViewFrame inputFrame)

The problem I have is that the onCameraFrame(CvCameraViewFrame inputFrame) method returns a "Mat" object to be displayed in the screen, and I don't want that. I want to be able to retrieve the frame from the camera and manipulate it without the need of displaying anything on the screen. I thought I could maybe modify the CameraViewBase class, but I a afraid I will mess things up when there might be a simpler and more straightforward solution.

All help and suggestions are welcome. Thanks folks!

edit retag flag offensive close merge delete