Motion detection with OpenCV
Usually, motion detection is done by the segmentation of background and foreground content in images. Because of that, while detecting motion, we usually assume that the background part of the given scene that appears in our camera is static and will not change over consecutive frames of the video. By analyzing these consecutive frames, we can extract the background of that scene in some way, and so the foreground can also be extracted. If some objects are found in the foreground, we can assume that motion is detected.
But this assumption is not always right in the real world—the sun rises and sets, the lights are on and off, and the shadows appear, move, and disappear. Any changes of these kind might change the ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access