Created
September 4, 2019 05:51
-
-
Save squm/9d0e9a4898ca2d9400b2595e7a97d337 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int | |
motion_count(Mat I) { | |
const int size = motion_mask_size; | |
resize(I, I, Size(size, size), 0, 0, INTER_NEAREST); | |
int i = 0; | |
int count = 0; | |
for ( | |
MatConstIterator_<uchar> | |
it = I.begin<uchar>(), | |
end = I.end<uchar>(); | |
it != end; | |
it++ | |
) { | |
const bool b = *it == 0 ? false : true; | |
if (b) { | |
count++; | |
} | |
} | |
return count; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment