Motion detection algorithm
Now we have the video input ready to use and the video display working as well. The next step is the heart of this chapter: how to deploy a motion detection algorithm following the rapid prototype development principle.
Firstly, let's spend some words to introduce the frame difference-based motion detection algorithm, which is employed in this chapter. As shown in the previous figure, the motivation is very simple. If we already know the background information—for example, if the background is stationary—then for each captured frame, simply subtracting the background image yields the regions of interest, that is, the motion area.
However, this method has several shortcomings. The most important is, how to get the background image? The best method is human aid. For example, the operator manually chooses a frame without any interesting object as the background image, which increases the operational complexity and uncertainty of the system. Even so, problems still exist...