Motion detection

You can already see that we are not only doing facial detection, but motion detection as well. So let's turn our focus to be a bit wider scale and detect any motion, not just faces. Again, we'll use Accord.NET for this and use the motion detection sample. As with facial detection, you will see just how simple it is to add this capability to your applications and instantly become a hero at work!

With motion detection, we will highlight anything that moves on the screen in red. The amount of movement is indicated by the thickness of red in any one area. So, using the following image, you can see that the fingers are moving but that everything else is motionless:

As the movement of the hand increases, you can see increased movement in the entire hand:

Once the entire hand starts to move, you can see not only more red but also the total amount of red increasing relative to the movement:

If we do not wish to process the entire screen area for motion, we can define Motion Regions; motion detection will occur only in those regions. In the following image, you can see that I've defined a Motion Regions. You will notice in upcoming images that this is the only area that motion will be processed from:

Now, if we create some motion for the camera (fingers moving), we will see that only motion from our defined region is being processed:

You can also see that, with a Motion Regions defined and Peter the meditating Gnome in front of the region, we are still able to detect motion behind him while filtering out non-interesting items; but his face is not a part of the recognition. You could, of course, combine both processes to have the best of both worlds:

Another option that we can use is grid motion highlighting. This makes the motion detected region highlighted in red squares based on a defined grid. Basically, the motion area is now a red box, as you can see here:

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

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