1

I'm working on OpenCV project using android, where the yawning detection is done in,

public Mat onCameraFrame(CvCameraViewFrame inputFrame){

        //Yawning detection done here using detectMultiScale() method
        //code is working fine
        .....
       }

As the detection continues application starts slowing down, because it is storing the frames in the application ( After installation application size is 2 Mb, after few minutes of detection size grows to 30 Mb and growing). The frames are released using,

public void onCameraViewStopped() {
        mGray.release();
        mRgba.release();

    }

But I want my app to run for long time without any lagging, Actually it is Real-time app to detect yawning.

I wanted to release the each frame mRgba or mGray every minute instead of releasing them once camera stopped.

Is there any possible solution that enables us to destroy frames every minute.

Can I release frames just after processing them.

Please do help me, please do not close this question.

Punith K
  • 656
  • 1
  • 9
  • 26
  • 1
    Buffer the frames in an array with timestamp of ceation. If current time - frame timestamp > 1min: destroy frame. Or if you know the amount of images in 1 minute: create a ringbuffer that holds as many frames. – Micka Sep 06 '14 at 08:56
  • @Micka After Storing frames in array how to release them after a minute. – Punith K Sep 08 '14 at 05:48
  • 1
    You need some time measurent functions. I dont know which ones exist for java on android, but google and stackoverflow will probably help you. This for example: http://stackoverflow.com/questions/5369682/get-current-time-and-date-on-android – Micka Sep 08 '14 at 06:23

0 Answers0