calling mat.copyto and mat.clone in loop causes machine to freeze in java [closed]
I'm reading frames from video file and store them in queue to process them later with following code:
Mat frame = new Mat();
while(videoCapture.read(frame)){
if(frame.empty) break >
list.add(frame.clone());
}
which causes whole machine to freeze and become unresponsive, I've tried constructing new temporary mat object and make deep copy using mat.copyTo()
which causes the same problem. I've tried using opencv 3.4.8 as well as 4.2.0 and the results are the same... Am I doing something wrong? Is there other way how to read all frames into data structure than reading frame by frame?
out of memory ? after how many frames ?
Yea it was memory issue, after resizing frames to more manageable size it seems to work fine except it uses more than twice the memory equivalent c++ code needs