Skip to Content
Mastering ROS for Robotics Programming - Second Edition
book

Mastering ROS for Robotics Programming - Second Edition

by Lentin Joseph, Jonathan Cacace
February 2018
Beginner
580 pages
13h 20m
English
Packt Publishing
Content preview from Mastering ROS for Robotics Programming - Second Edition

Finding edges on the image

After converting the ROS images to OpenCV type, the detect_edges(cv::Mat) function will be called for finding the edges on the image, using the following inbuilt OpenCV functions:

cv::cvtColor( img, src_gray, CV_BGR2GRAY ); 
cv::blur( src_gray, detected_edges, cv::Size(3,3) ); 
cv::Canny( detected_edges, detected_edges, lowThreshold, lowThreshold*ratio, kernel_size ); 

Here, the cvtColor() function will convert an RGB image to a gray color space and cv::blur() will add blurring to the image. After that, using the Canny edge detector, we extract the edges of the image.

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Mastering ROS for Robotics Programming - Third Edition

Mastering ROS for Robotics Programming - Third Edition

Lentin Joseph, Jonathan Cacace
Effective Robotics Programming with ROS - Third Edition

Effective Robotics Programming with ROS - Third Edition

Luis Sanchez, Enrique Fernandez Perdomo, Anil Mahtani

Publisher Resources

ISBN: 9781788478953Supplemental Content