Difference between revisions of "Identification of beer bottle using OpenCV"
(New page: 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/r...) |
|||
Line 1: | Line 1: | ||
+ | |||
+ | == Task == | ||
+ | |||
This project should help robot to recognize beer/Club Mate bottle, navigate to it and grab it. | 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/ | + | 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 | ||
+ | |||
+ | [http://www.st.fmph.uniba.sk/~habovstiak6/color-tracking.cpp Download source code (9.6K)] |
Latest revision as of 09:30, 5 August 2012
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