//方框滤波 int g_nBoxFilterValue; void on_ChangeBoxFilter(int,void*) { if(g_nBoxFilterValue>=1) { boxFilter(g_srcImage_Contrast,g_dstImage_Contrast,-1,Size(g_nBoxFilterValue,g_nBoxFilterValue)); imshow("方框滤波",g_dstImage_Contrast); } } void Test_BoxFilter() { namedWindow("方框滤波"); g_srcImage_Contrast=imread("D:\\OpenCV Projects\\OpenCV_Test_Image\\16.jpg"); g_nBoxFilterValue=1; createTrackbar("trackbar","方框滤波",&g_nBoxFilterValue,10,on_ChangeBoxFilter); on_ChangeBoxFilter(g_nBoxFilterValue,0); imshow("原图",g_srcImage_Contrast); }
时间: 2024-12-22 15:37:48