I am working on a difference sensing patch and require a method of calculating the average amount of movement in a video feed. I could do this by counting the number of white pixels in the feed after the diff sensing has occurred, i just don't know how to do this. Does anybody know a way of doing this?