Motion detection is a process of detection a change in position of an object relative to its surroundings. It has importance in any vision based detection and tracking system. In the last couple of decades, several techniques have been introduced to accomplish this task effectively, however there is no perfect method which can overcome the various problems that are faced during detection.
Last month I had a task to analyze video stream captured from camera on mobile device. The goal was to have efficient algorithm for movement recognition, which could be used also by older and slower mobile devices (e.g. iPhone 4). Since I had only few days for that task, the only possibility was to implement an existing and proven library which could give me some heavy functions out of the box.
The most suitable library, which was available for free on both iOS and android platforms, was OpenCV. OpenCV offers all transformations which I needed and much more. OpenCV is a library of programming functions mainly aimed at real-time computer vision, developed by Intel. It is free for use under the open source BSD license. The library is cross-platform (available also on iOS) and it focuses mainly on real-time image processing.
Motion detection implementation can be done in more than one way. There is no one true method for all of the situations and external conditions. During the design process of my motion detection algorithm I had to take into consideration things like:
In order to process frames from video stream I had to define some processes, which I had to perform using OpenCV: