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?