1
| void cv::Canny(InputArray image, OutputArray edges, double threshold1, double threshold2, int apertureSize = 3, bool L2gradient = false)
|
使用 Canny 算法在图像中查找边缘。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
| #include <opencv2/imgcodecs.hpp> #include <opencv2/highgui.hpp> #include <opencv2/imgproc.hpp> #include <iostream> using namespace cv; using namespace std; int main() { string path = "../lesson1_pictureRead/img1.jpg"; Mat img = imread(path); Mat imgBlur,imgCanny; GaussianBlur(img, imgBlur, Size(3, 3), 3, 0); Canny(imgBlur, imgCanny, 75, 125); imshow("Image", img); imshow("ImageCanny", imgCanny); waitKey(0); return 0; }
|

“觉得不错的话,给点打赏吧 ୧(๑•̀⌄•́๑)૭”
微信支付
支付宝支付
<opencv>第五课 Canny边缘
https://hermione20.github.io/2024/10/14/第5课 Canny边缘/