A fast and lightweight Vulkan (GPU) accelerated computer vision pipeline for simple color detection.
The pipeline consists of the following stages:
- Acquisition (capture image from camera & upload to GPU)
- HSV color-space conversion
- Filtering based on hue
- Morphological filtering (3x3)
- Max pooling (2x2)
- Tracking / centroid calculation
On the Raspberry Pi4, the Vulkan accelerated pipeline is about 2x faster and takes 4x less CPU than the equivalent pipeline in OpenCV.
~/local_point
: geometry_msgs::msg::Point
the 3D position (in the camera frame) of the detected color blob.
~/camera_image/compressed
: sensor_msgs::msg::CompressedImage
the compressed camera image including the crosshair pointing at the detected color blob.
~/lock
: std_msgs::msg::Bool
indicates whether a color blob is currently detected.
Make sure libturbojpeg
is installed and your ROS environment is sourced (source source /opt/ros/<dist>/setup.bash
).
Build with
cargo b --release
the compiled executable is placed in ./target/release/ros2-publisher
.
ros1-publisher 1.0.0
USAGE:
ros1-publisher [FLAGS] [OPTIONS] [__ros_args]...
FLAGS:
-h, --help Prints help information
--raw-color-image Transmit unprocessed (yet compressed) color image
--transmit-depth-image Transmit depth image
-t, --transmit-image Transmits the camera image with a crosshair. Images are compressed via libjpegturbo.
WARNING: This may generate a lot of data!
-V, --version Prints version information
-v, --verbose Be verbose
OPTIONS:
-c, --compressor-quality <compressor-quality> Compression quality [default: 60]
-l, --lock-timeout <lock-timeout> Lock timeout in ms [default: 1000]
-m, --min-area <min-area>
The smallest area in pixels required by the detector. Smaller areas will be ignored [default: 110]
ARGS:
<__ros_args>... Roslaunch adds some special args e.g. __name:=... __log:=... [default: ]
- viewer UI
- fixes
- vulkano 0.30
- ROS1 gazebo node
- OpenCV reference
- histograms
- Improved: ROS1 & ROS2 integration
- Added: Hole fill filter
- Added: Transmit compressed depth image
- Added: ROS2 integration and compressed camera image streaming
- Added: Max pooling before tracker
- Initial release
Requires Vulkan 1.1 or higher.
MIT