The code you posted was an example of replicating the output of the wc(1) command from Unix, which counts lines, words, and characters in a file. While I have not attempted it personally, to count movements in a video I would imagine a process similar to the following:
There are probably better ways than this, but this is what came to my mind. I hope more knowledgeable monks will share their experiences and provide the guidance you seek to help you solve your problem.
Hope that helps.
In reply to Re: Regarding Perl Counting
by atcroft
in thread Regarding Perl Counting
by anisha3
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |