1 | initial version |
you're leaking memory, in the end it can't allocate another Mat.
if you use temporary Mat's created with new
, you have to release()
them manually, java's gc does not see natively, c++ allocated memory (for the pixels)
Mat grayImage1 = new Mat();
Imgproc.cvtColor(frame1, grayImage1, Imgproc.COLOR_BGR2GRAY);
// ... process grayImage1
// ... later:
grayImage1.release()