A method and system are provided for counting moving objects in a digital
video stream. In contrast to known computationally-expensive methods,
areas of motion are determined by threshold subtracting a current video
frame from a short term average video scene. An object box surrounding an
object is determined by threshold subtracting the current video frame
from a long term average video scene. Coordinates of the moving object
are identified by associating the area of motion with the object box, if
it overlaps the area of motion, to define a moving object box. An event
counter can be incremented when the moving object box is in a buffer zone
in the current frame, and was in a detection zone in an earlier frame,
and was initially detected in a buffer zone on the opposite side of the
detection zone.