C++ implementation: cv::Canny(im, edges, 100, 200); // convert canny to BGR cv::cvtColor(edges, edges, CV_GRAY2BGR); /