Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version
  • mask = new Mat() should go into some initalization routine (like onCameraViewStarted, done once only)
  • copyTo() and clone() are indeed the same
  • mRgba.release(); that's the wrong one.
  • //mask.release(); well, if you return it, you must no release it before.

again, the problem is the reocurring new there. move all your temporary allocations to onCameraViewStarted(), and release all of them in onCameraViewStopped()

  • mask = new Mat() should go into some initalization routine (like onCameraViewStarted, done once only)
  • copyTo() and clone() are indeed the same
  • mRgba.release(); that's the wrong one.
  • //mask.release(); well, if you return it, you must no not release it before.

again, the problem is the reocurring new there. move all your temporary allocations to onCameraViewStarted(), and release all of them in onCameraViewStopped()

  • mask = new Mat() should go into some initalization routine (like onCameraViewStarted, done once only)
  • copyTo() copyTo() and clone() clone() are indeed the same
  • mRgba.release(); that's the wrong one.
  • //mask.release(); well, if you return it, you must not release it before.

again, the problem is the reocurring new there. move all your temporary allocations to onCameraViewStarted(), and release all of them in onCameraViewStopped()

  • mask = new Mat() should go into some initalization routine (like onCameraViewStarted, done once only)
  • copyTo() and clone() are indeed the same
  • mRgba.release(); that's the wrong one.
  • //mask.release(); well, if you return it, you must not release it before.

again, the problem is the reocurring new there. move all your temporary allocations to onCameraViewStarted(), and release all of them in onCameraViewStopped()