Canny 图片的边缘检测

#include <iostream>
#include <opencv2/opencv.hpp>
#include "opencv2/highgui/highgui.hpp"
#include "opencv2/imgproc/imgproc.hpp"
using namespace std;
using namespace cv;

int main(int argc, char** argv) {
	Mat img_rgb, img_cny;

	//  创建图片
	img_rgb = imread("C:/Users/andy.ke/Desktop/qietu/1234.jpg");
	namedWindow("example gray", WINDOW_AUTOSIZE);
	imshow("example gray", img_rgb);

	// 对图片进行边缘检测
	Canny(img_rgb, img_cny, 10, 100, 3, true);
	namedWindow("example canny", WINDOW_AUTOSIZE);
	imshow("example canny", img_cny);

	waitKey(0);
}

猜你喜欢

转载自blog.csdn.net/s12117719679/article/details/85092903