Maybe an easy question but since I am a noob I dont know how to do it in an elegant way. I am analyzing video. For that I am taking differences between the frames. If nothing has changed the resulting frame will be empty or black if I display it with imshow(...). How do I find out if I am looking of one of these black (empty) frames?
I tried:
Mat threshold_output;
...
threshold_output.empty() --> does not work
or
threshold_output == 0 --> compiler error
Maybe someone can tell me :).
Thx
you can use minMaxLoc and check whether maxVal == 0 :
// Localizing the best match with minMaxLoc
double minVal; double maxVal;
minMaxLoc( threshold_output, &minVal, &maxVal);
I solved the problem with this:
if (countNonZero(NewData) < 1)
{
cout << "Eye contact occurs in this frame" << endl;
}
Thanks!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With