After converting the ROS images to OpenCV type, the function detect_edges(cv::Mat) 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 Canny edge detector, we extract the edges of the image.