首页 > 代码库 > 13.均值滤波

13.均值滤波

//均值滤波
int g_nBlurValue;
void on_ChangeBlurValue(int,void*)
{
	if(g_nBlurValue>0)
	{
		blur(g_srcImage_Contrast,g_dstImage_Contrast,Size(g_nBlurValue,g_nBlurValue));
		imshow("均值滤波",g_dstImage_Contrast);
	}
}
void Test_Blur()
{
	namedWindow("均值滤波");
	namedWindow("原图");
	g_srcImage_Contrast=imread("D:\\OpenCV Projects\\OpenCV_Test_Image\\16.jpg");
	createTrackbar("blurtrackbar","均值滤波",&g_nBlurValue,10,on_ChangeBlurValue);
	on_ChangeBlurValue(g_nBlurValue,0);
	imshow("原图",g_srcImage_Contrast);
}

技术分享

 

13.均值滤波