- Canny(gray-level image, output contours, low threshold, high threshold);
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/imgproc/imgproc.hpp>
#include <iostream>
using namespace std;
using namespace cv;
int main()
{
Mat image= imread("image.jpg");
Mat image_gray;
cvtColor(image,image_gray,CV_RGB2GRAY);
namedWindow("original image",WINDOW_NORMAL);
imshow("original image",image_gray);
Mat contours;
Canny(image, contours, 70, 350);
namedWindow("Canny",WINDOW_NORMAL);
imshow("Canny",contours);
waitKey(0);
}

#include <opencv2/highgui/highgui.hpp>
#include <opencv2/imgproc/imgproc.hpp>
#include <iostream>
using namespace std;
using namespace cv;
int main()
{
Mat image= imread("image.jpg");
Mat image_gray;
cvtColor(image,image_gray,CV_RGB2GRAY);
namedWindow("original image",WINDOW_NORMAL);
imshow("original image",image_gray);
Mat contours;
Canny(image, contours, 70, 350);
Mat contoursInv;
threshold(contours, contoursInv, 128, 255, THRESH_BINARY_INV);
namedWindow("Canny",WINDOW_NORMAL);
imshow("Canny",contoursInv);
waitKey(0);
}
