2021SC@SDUSC
高斯滤波处理(消除高斯噪声)
Mat MyClass::getGass(Mat image, bool show){
Mat cimage;
GaussianBlur(image, cimage, Size(3, 3), 0);
if (show)
imshow("高斯滤波图", cimage);
return cimage;
}
处理结果:
Sobel x-y差处理(只考虑x轴,消除y轴不必要信息):
Mat MyClass::getSobel(Mat image, bool show){
Mat cimageX16s, cimageY16s, imageSobelX, imageSobelY, out;
Sobel(image, cimageX16s, CV_16S, 1, 0, 3, 1, 0, 4);
Sobel(image, cimageY16s, CV_16S, 0, 1, 3, 1, 0, 4);
convertScaleAbs(cimageX16s, imageSobelX, 1, 0);
convertScaleAbs(cimageY16s, imageSobelY, 1, 0);
out = imageSobelX