1 | initial version |
You can use countNonZero() which returns an int of how many nonzero pixels are in a frame. To account for noise you could use some kind of minimum score that's required before you count the eyes as present, but just put that in your loop and you'll be set.