Motion detection

We will now make our focus a bit more wide-scale and detect any motion at all, not just faces. Again, we'll use Accord.Net for this and use the Motion detection sample. As with facial recognition, you will see just how simple it is to add this capability to your applications and instantly become a hero at work! Let's make sure you have the correct project loaded into Microsoft Visual Studio:

With motion detection, anything that moves on the screen we will highlighted in red, so using the following screenshot you can see that the fingers are moving but everything else remains motionless:

In the following screenshot, you can see more movement, denoted by the red blocks along this anonymous hand:

In the following screenshot, you can see that the entire hand is moving:

If we do not wish to process the entire screen area for motion, we can define motion regions, where motion detection will occur only in those regions. In the following screenshot, you can see that I defined a motion region. You will notice in upcoming screenshots that this is the only area that motion will be processed from:

Now, if we create some motion for the camera, you will see that only motion from our defined region is being processed, as follows:

You can also see that, with a motion region defined and Peter the meditating Gnome in front of the region, we are still able to detect motion behind him, but his face is not part of the recognition. You could of course, combine both processes to have the best of both worlds, as follows:

Another option that we can use is Grid Motion Highlighting. This highlights the motion detected region in red squares based upon a defined grid. Basically, the motion area is now a red box, as you can see:

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset