Capturing a frame in a double while loop
Hi! I have a problem with something like this. The case is that if i > a && i < b
(it is just an example, the whole thing is a bit more complex) I need my function to still capture frames but use static variables from //do something1
. Unfortunately, whenever this second while
loop starts, I get an error saying that the frame
object is empty - nothing has been captured. Any idea how to solve it? Cheers.
int i = 0;
while(cap.isOpened())
{
cap >> frame;
//do something1
while (i > a && i < b) //for a < b
{
cap >> frame;
//do something
}
++i;
}
What's exactly error message? May be you should check frame empty
I don't understand while loops : it's only a if with else i++
Does this help?
CAP_PROP_POS_MSEC
Because loops are far more complicated and it is not really helpful to show what's inside of them.
@supra56 how exactly shall I apply it?
I can't post here. It is forbidden content