Identification of beer bottle using OpenCV

From RoboWiki
Revision as of 10:30, 5 August 2012 by Robot (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Task

This project should help robot to recognize beer/Club Mate bottle, navigate to it and grab it. Main goal is find bottle in an image captured by camera and show, how robot should go (left/right).

Solution

Color tracking was chosen in order to find bottle. Club Mate bottle has lid of unique blue color. At first, program should be calibrated by hand (or semi-automatic). Then it will search for bottle lid. Commands for robot are written to stdout.

Program filters correct colors making white-black image (white, where pixel color is in range) and it applies filters to remove noise. Then it finds contours of white areas and filters out weird shapes caused by noise. After this processing one rectangle should remain. Rectangle is drawn to visualise result and apropriate message is written to stdout.

Program is written in C++, using libcv, libhigghgui and libcvaux. Compile: g++ -W -Wall -lcv -lhighgui -o color-tracking color-tracking.cpp Run: ./color-tracking Tested platform: Ubuntu Linux 10.10 "Maverick Meerkat" Author: Martin Habovštiak

Download source code (9.6K)