图像的均值滤波与canny变换
#include <opencv2/opencv.hpp>
using namespace cv;
int main()
{
//载入原始图
Mat srcImage = imread("1.jpg");
//显示原始图
imshow("【原图】", srcImage);
// 灰度图
Mat grayImage;
cvtColor(srcImage, grayImage, COLOR_BGR2GRAY);
// blur滤波
Mat edge;
blur(grayImage, edge, Size(3, 3));
// 运行Canny算子
Mat canny;
Canny(edge, canny, 3, 9, 3);
imshow("【canny图】", canny);
waitKey(0);
}