Hi, I'm Artur Olszak and this is my programming blog :-)
You can contact me here.
Some links: LinkedIn, GitHub, Stackoverflow, SoundCloud.

2014-09-11 22:11:25

Motion detection with OpenCV for iOS

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.

The algorithm

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:

  • camera image noise
  • lightning changes
  • accuracy of detection
  • low performance of mobile device

In order to process frames from video stream I had to define some processes, which I had to perform using OpenCV:

  • background and foreground separation
  • edge detection
  • image subtraction


Useful links:

<-- back


2015-08-18 15:33:39

Since 2013