本文作者Color Space,文章未经作者允许禁止转载!
本文将介绍OpenCVSharp图像边缘检测--Canny、Sobel、Laplacian!
代码演示:
///Canny边缘检测演示
Mat srcImg = Cv2.ImRead("2.png");
Cv2.ImShow("src", srcImg);
Mat grayImg = new Mat();
Cv2.CvtColor(srcImg, grayImg, ColorConversionCodes.BGR2GRAY);
Cv2.GaussianBlur(grayImg, grayImg, new Size(3, 3), 0, 0);
Cv2.Canny(grayImg, grayImg, 30, 100);
Cv2.ImShow("Canny&