Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement