The purpose of this lab is to gain experience working with the Python bindings for OpenCV.
$ python cv_demo.pyNote that this file is not a ROS node. This is pure python code that can be executed without starting ROS.
find_reddest_pixel
according to the docstring. You should complete this function by
creating a nested for loop to access all pixels in the image. Note
that you will probably need to convert the pixel values to integers.
They are stored in the image as 8-bit unsigned integers. Performing
arithmetic on 8-bit unsigned integers will always result in 8-bit
unsigned integers.
find_reddest_pixel_fast
according to the docstring. You should complete this function without
any loops by applying OpenCV operations. The completed function should
be much faster than the previous version.
src/kinect_subsciber.py
This is a special subscriber class for approximately synchronizing the Kinect topics.
src/point_cloud2.py
This provides utility functions for extracting information from PointCloud2 messages.
nodes/kinect_vision_demo.py
This is a node that demonstrates subscribing and publishing to image topics in ROS.
nodes/kinect_depth_demo.py
This node demonstrates working with PointCloud data in ROS.
nodes/kinect_vision_demo.py
.
Copy your find_reddest_pixel_fast
into that file.
$ rosrun image_view image_view image:=/red_marked_image
nodes/kinect_depth_demo.py
.
Copy your find_reddest_pixel_fast
into that file.
Copy your completed version of detect_red.py into the src folder of the vision_demo package. Submit your completed vision_demo package using subversion.