In previous posts I have discussed using fiducials to extract location and orientation for an object. Here I want to mask out the robot (with the fiducial) and identify the location of four different colored baskets and the obstacles in the environment.
Original Image:
Final Image:
All objects are identified by color with their coordinates. The corners of the obstacles are identified. This information is stored in a state matrix which is then used to calculate a set of relational features about the objects in the image.
The openCV2.0 python libraries that were built for windows are broken. The libraries were compiled with minGW instead of visual studio. This means that simple things like Canny and Threshold will throw bizarre exceptions. Here is a binary built by Max Grobe using visual studio that works just fine. To make OpenCV 2.0 work follow these steps:
Download this installer (Thanks Max) I will mirror this locally, but I am having trouble with my ISP (UK -> USA)
Copy the contents of the C:\OpenCV2.0\Python2.6\Lib\site-packages directory to your python Site Packages directory.
Go to Control Panel -> System -> Advanced -> Environment Variables. Add the OpenCV2.0\bin directory to your path. (See image.)
Run the camshift.py demo in the samples folder. Distribution only includes the new c++ bindings so the other samples won’t work.
To import the library use: import cv. This will require that you preface each command with cv. ie cv.NamedWindow. This also needs to be done in the namespace so cv.IPL_DEPTH_8U
Alternately, you can just from cv import * which will import all the commands. Remember you don’t need the cv front of everything, so that classic cvLoadImage becomes LoadImage etc.
As it turns out you don’t need encoders and fancy sensors to do localization. An incredibly noisy motor model, highly variable bluetooth delays all can be over come by just adding more noise.
More details to come on how to actually do it…. For now look at the 1999 paper by Thrun, Fox etc.
A movie demonstrating the technique is shown below.