首页 > 代码库 > 14.高斯滤波器

14.高斯滤波器

//高斯滤波
int g_nGaussianBlurValue;
void on_ChangeGaussianBlurValue(int,void*)
{
	if(g_nGaussianBlurValue>0 && g_nGaussianBlurValue%2==1)
	{
		GaussianBlur(g_srcImage_Contrast,g_dstImage_Contrast,Size(g_nGaussianBlurValue,g_nGaussianBlurValue),0,0);
		imshow("高斯滤波",g_dstImage_Contrast);
	}
}

void Test_GaussianBlur()
{
	namedWindow("高斯滤波");
	namedWindow("原图");
	g_srcImage_Contrast=imread("D:\\OpenCV Projects\\OpenCV_Test_Image\\16.jpg");
	g_nGaussianBlurValue=http://www.mamicode.com/3;"trackbar","高斯滤波",&g_nGaussianBlurValue,15,on_ChangeGaussianBlurValue);
	on_ChangeGaussianBlurValue(g_nGaussianBlurValue,0);
	imshow("原图",g_srcImage_Contrast);
}

技术分享

 

14.高斯滤波器