in reply to Regarding Perl Counting

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:

  1. Break video into frames
  2. Reduce color pallet (possibly to a limited grayscale) to reduce the possibility of false readings due to frame-to-frame changes in lighting.
  3. Possibly reduce image size, to reduce the possibility of false readings due to changes by objects not of interest.
  4. Loop through the frames, comparing each to its successor, looking for more than pixel changes than a particular threshold that you set, to indicate that a sufficient movement has occurred.

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.

Replies are listed 'Best First'.
Re^2: Regarding Perl Counting
by jellisii2 (Hermit) on Feb 14, 2014 at 17:49 UTC
    And FFMPEG can do all of the image manipulation for you. I do most of this for $work myself already.