Only released in EOL distros:  

Package Summary

track colors in 3d!


cmvision_3d.png Cmvision_3d uses the /blobs topic produced by cmvision, in addition to 3D data from a registered depth image, to publish both 1. the position of each color blob relative to its camera frame, and 2. frames in the tf stack for each color.

Frames are broadcasted with the camera's frame_id as their parent_frame, and from there they can be transformed as necessary. Note: this package depends on cmvision's commit fac7a32. This should be released into Hydro, but if it is not yet, make sure to grab the latest changes.


Selecting Blob Colors

Please see the cmvision package for instructions to select blob colors, after which you can place your colors.txt file within the /colors folder, and link to it via modifying color_tracker.launch.

Detecting and Projecting Blobs to 3D

You will need to modify launch/color_tracker.launch to do the following:

  1. Set the "image" arg to your image topic.
  2. Set the "depth_image" to your depth image topic (which must be registered depth to produce meaningful results).
  3. Set the "camera_topic" arg to your camera_topic.
  4. Set the "color_file" file parameter to your .txt colors file, as described in cmvision.

        <arg name="image" default="/your/image/topic"/>
        <arg name="depth_image" default="/your/depth_image/topic"/>
        <arg name="camera_topic" default="/your/camera_info/topic"/>
        <!-- Do we want to publish our blobs to tf? -->
        <arg name="publish_tf" default="true"/>

  <node name="cmvision" pkg="cmvision" type="cmvision" args="image:=$(arg image)" output="screen">
          <!-- Location of the cmvision color file -->
          <param name="color_file" type="string"
                 value="$(find cmvision_3d)/colors/yourColors.txt" />

After you've done this, you can proceed to run both cmvision and color_controller using

roslaunch cmvision_3d color_tracker.launch

Note: This stuff will pretty much work out of the box if you're running openni_launch openni.launch depth_registration:= true on a Microsoft Kinect, as the defaults for the above arguments are set to the relevant topics for the Kinect environment.



Subscribes to /blobs and publishes /blobs_3d, which includes the 3d points of each found color.

Subscribed Topics

blobs (cmvision/Blobs)
  • A list of color blobs and their locations. We project each one of these colors into 3D and republish to /blobs_3d.
depth_image (sensor_msgs/Image)
  • The depth registered image topic. Should be remapped to the name of the real depth image topic.
camera_topic (sensor_msgs/CameraInfo)
  • We need camera info in order to perform the correct calculations in mapping from the image plane to 3D space. Should be remapped to the name of the real camera info topic (e.g, on a Microsoft Kinect this is camera/rgb/camera_info).

Published Topics

blobs_3d (cmvision_3d/Blobs3d)
  • a modified version of cmvision/Blobs that replaces pixel x,y information with geometry_msgs/Point info.


publish_tf (bool, default: true)
  • Are we going to publish our blobs to tf? NOTE: If there are multiple catches for a single color, it only publishes the one with the largest area.

Wiki: cmvision_3d (last edited 2014-08-19 17:45:58 by ahubers)