复制代码
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33#include<iostream> #include<opencv2/highgui/highgui.hpp> #include<opencv2/imgproc/imgproc.hpp> using namespace std; using namespace cv; char* window_name = "Laplace Demo"; Mat src, src_gray, dst; int kernel_size = 3, scale = 1, delta = 0, ddepth = CV_16S; int main() { src = imread("哆啦A梦.jpg"); if (!src.data) { return -1; } imshow("哆啦A梦", src); namedWindow(window_name); GaussianBlur(src, src, Size(3, 3), 0, 0, BORDER_DEFAULT); cvtColor(src, src_gray, CV_BGR2GRAY); Mat abs_dst; Laplacian(src_gray, dst, ddepth, kernel_size, scale, delta, BORDER_DEFAULT); convertScaleAbs(dst, abs_dst); imshow(window_name, abs_dst); waitKey(0); return 0; }
最后
以上就是要减肥万宝路最近收集整理的关于C++版OpenCV·第十二集:拉普拉斯算子的全部内容,更多相关C++版OpenCV·第十二集内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复