loop on frames video in opencv java
I am trying to loop on frames video in openCV java here is my code
Mat frame = new Mat();
int numOfFrames = 0;
boolean hasNext = true;
while(hasNext){
hasNext = video.read(frame);
numOfFrames++;
}
the problem is , it loops forever with no result or error or memory leak ! any help please
You would like to use the capture function and not the read. Read only reads location of data, then needs to be followed by a imdecode to recover the data. The capture function does it all combined for your.