Opencv Laplace算子

时间:2022-04-23 06:22:55

//通过拉普拉斯-锐化边缘
kernel = (Mat_<float>(3,3)<<1,1,1,1,-8,1,1,1,1);//Laplace算子
filter2D(img2, img_laplance, CV_32F,kernel, Point(-1, -1), 0, BORDER_DEFAULT);
img2.convertTo(img_sharp, CV_32F);
img3 = img_sharp - img_laplance;

img3.convertTo(img3, CV_8UC3);
img_laplance.convertTo(img_laplance, CV_8UC3);

imshow(win3, img3);