Showing posts with label OpenCV. Show all posts
Showing posts with label OpenCV. Show all posts

Friday, January 3, 2014

Ixonos Goes "Imaging Tampere Get-Together"

Companies with a presence in Tampere, Finland have started movement towards making the region a center for imaging expertise, which means focusing efforts in pattern recognition, image enhancement, augmented reality etc. With this in mind, a get-together event was held in late November, and Ixonos with its bright and enthusiastic engineers had to be there too! Other participants included many participants from the Tampere University of Technology, Intel and several startups and older players in the fields of video surveillance etc.

Instead of just showing up with a stack of callcards, though, we decided to amuse the crowd by whipping up a special demonstration software running on the Intel MinnowBoard. It turned out well, and was much loved by the participants.

Ixonos Imaging Demo The system consist of a Playstation 3 camera attached to a MinnowBoard, along with a display for visualising the imaging algorithm results.  MinnowBoard is a small and low cost embedded platform using Intel® Atom™CPU. In addition, a racing track playset with two electric cars was used as the pattern recognition problem. The software consists of the Ixonos Embedded Linux BSP (base support package) , the OpenCV imaging library and a very simple application that tracks two cars on the racing track, calculating their lap times and counts.
Minnowboard (at the back), PS3 camera, racing track!
Car recognition is done by simple color segmentation. The colors are preset, and blobs of certain color are recognised with the OpenCV routine . The centroid of each blob is then visualised on the screen, and their passage over the "startline" is tracked. Very simple. Not a display of our pattern recognition algorithm abilities (call us if that is what you want), but rather of our ability to quickly integrate a complete system where we could later drop a specialised algorithm into. And fun. The purpose was to have fun!

More detailed image processing steps:
  1. Capture image frames (640x480)
  2. Resize frames down to 320x240
  3. Blur to reduce noise
  4. Convert from BGR to HSV color space
  5. Apply filtering thresholds and create binary image
  6. Use moments to calculate the position of the center of the object
  7. Use coordinates to track the object and apply tracking visualizations on top of the image
  8. Display frames with tracking visualizations




The proud author (Ilkka Aulomaa) of the playset car recognition system
About the authors Ilkka Aulomaa, M.Sc. - author of the car recognition system software and setup Mikael Laine, M.Sc. - author of this blogpost, and participator "in spirit" in creating the demonstrator (which means sitting on a sofa and making smart ass comments). He has has written his Master's thesis under the title "On Optical Character Recognition on Mobile Devices" (later published as "A Standalone OCR System for Mobile Cameraphones" in the proceedings of 2006 IEEE 17th International Symposium on Personal, Indoor and Mobile Radio Communications. He has also participated in research in the field of pattern recognition.

Friday, October 11, 2013

Sweet and tasty approach to OpenCV and MinnowBoard

PC-esque cheap hardware is booming, and there seems to be no limit to the cool apps you can create on boards like Beaglebone, Rasperry Pi, or Minnowboard.

This obvious trend has had our attention for a long time now, plus we've got some customer cases going with the basic idea of migrating from expensive legacy systems to cheap off-the-shelf processing boards with huge capabilities in a meak form-factor.

Recently, some of our clients have expressed their interest in imaging systems, so we decided to whip up a small demo involving our "Ixonos BSP" small-footprint Linux distro and the industry standard OpenCV imaging library.

In this demo we used the MinnowBoard, Intel's small and low cost board which is based on Atom processor. The camera we used is a basic USB webcam from Logitech. Pictures below:

The Minnowboard with webcam watching candy drops

The camera setup allows the system to see some candy drops in this rather trivial pattern recognition demonstrator. The system acquires image rasters of the scene using v4l2 and OpenCV. Circle shaped patterns are detected using opencv function "HoughCircles", based on Hough Circle Transform. Code snippet below demonstrates simple circle detection using HoughCircles:
//circle detection
vector<vec3f> circles;
HoughCircles(detected_edges, circles, CV_HOUGH_GRADIENT,
             1, minSizeThreshold,  lowThreshold, lowThreshold/2,
             minSizeThreshold, minSizeThreshold + minSizeThreshold / 2);

printf("total circle count: %d\n",  circles.size());
After detecting all the circles, they are categorized according to color and statistics are printed to the screen.

Candy drops detected
 
Another picture below illustrates a situation with some more candy drops.
More candy drops detected


Ilkka Aulomaa, SW Engineer - Ixonos
Kalle Lampila, SW Engineer - Ixonos