Modules
Colormap
Colormap UObject
Description
This UObject can be used to track a blob of color in an image. It takes an image as input, and try to find a blob of some color in it (you can specify which color it should track). If it finds the blob of color, it computes it's position in the image.
What is in this tarball
- README : README file (contains useful informations)
- colormap.cc : source code of UObject
- colormap.hh : header file of UObject
- Makefile : Makefile.linux to be used under linux
Requirement:
- Urbi SDK 1.5 or higher
Example of use: with Aldebaran NAO:
Makes the NAO follow some pink/orange object with the head:
Launch the Colormap UObject on the NAO:
urbi-launch -r colormap.so -- -H <ip_of_nao> -p 54000
Then connect with netcat or any telnet-like tool to the NAO and type:
// We will track pink/orange blobs
var Global.ball = colormap.new("camera.val", 0, 255, 120, 190, 150, 230, 0.0015, false);
var Global.speed = 0.2;
t:whenever (ball.visible)
{
// Move the head toward the object
headYaw.val = headYaw.val + speed * camera.xfov * ball.x &
headPitch.val = headPitch.val - speed * camera.yfov * ball.y
},
// Activate head motors and camera.
camera.load = headPitch.load = headYaw.load = 1;
// Increase camera refresh rate
camera.rate = 1;
// Activate the tracking
ball.load = 1;
- Downloads colormap.tgz