标签:col src bin size class bsp show printf const
这个算法还是用来进行边缘检测的
===============================
1 #include <opencv2/opencv.hpp> 2 #include <iostream> 3 using namespace std; 4 using namespace cv; 5 6 Mat src, dst, gray_src; 7 8 int main(int agrc, char** agrv) { 9 10 src = imread("C:\\Users\\32829\\Desktop\\aa.jpg"); 11 if (!src.data) { 12 printf("no load..\n"); 13 return -1; 14 } 15 const char* input_win = "input"; 16 const char* out_put = "out_put"; 17 namedWindow(input_win, CV_WINDOW_AUTOSIZE); 18 namedWindow(out_put, CV_WINDOW_AUTOSIZE); 19 imshow(input_win, src); 20 GaussianBlur(src, dst, Size(3, 3), 0, 0); 21 cvtColor(dst, gray_src, CV_BGR2GRAY); 22 Mat edge_image; 23 Laplacian(gray_src, edge_image, CV_16S, 3); 24 convertScaleAbs(edge_image, edge_image); 25 threshold(edge_image, edge_image, 0, 255, THRESH_OTSU | THRESH_BINARY); 26 imshow(out_put, edge_image); 27 28 waitKey(0); 29 return 0; 30 }
=============================
标签:col src bin size class bsp show printf const
原文地址:https://www.cnblogs.com/xiaoyoucai/p/10196225.html