#include #include #include using namespace std; using namespace cv; int main() { Mat img = imread("resources/szita2.png"); imshow("img",img); string menu = "tool"; namedWindow(menu,WINDOW_NORMAL); resizeWindow(menu,Size(500,50)); int radius = 1, sigma = 1; createTrackbar("radius", menu, &radius, 25); createTrackbar("sigma", menu, &sigma, 25); Mat blur_img, gauss_img, median_img, bilat_img; while (waitKey(20) != 'q') { int size = max(2 * radius + 1, 3); Size size2(size, size); blur(img, blur_img, size2); imshow("blur",blur_img); GaussianBlur(img, gauss_img, size2, sigma, sigma); imshow("gauss", gauss_img); medianBlur(img, median_img, size); imshow("median", median_img); bilateralFilter(img, bilat_img, 5, sigma*10, 2*radius+3); imshow("bilat", bilat_img); } return 0; }