-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathGaussianFiltering.cpp
More file actions
24 lines (20 loc) · 924 Bytes
/
Copy pathGaussianFiltering.cpp
File metadata and controls
24 lines (20 loc) · 924 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#include <iostream>
#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/imgproc/imgproc.hpp>
using namespace std;
using namespace cv;
int main() {
Mat input_image = imread("images/lena.jpg", IMREAD_GRAYSCALE);
Mat filtered_image_1, filtered_image_2, filtered_image_3, filtered_image_4;
GaussianBlur(input_image, filtered_image_1, Size(7, 7), 1.0, 1.0, BORDER_REPLICATE);
GaussianBlur(input_image, filtered_image_2, Size(7, 7), 2.0, 2.0, BORDER_REPLICATE);
GaussianBlur(input_image, filtered_image_3, Size(7, 7), 3.0, 3.0, BORDER_REPLICATE);
GaussianBlur(input_image, filtered_image_4, Size(7, 7), 4.0, 4.0, BORDER_REPLICATE);
imshow("Filtered Image_1", filtered_image_1);
imshow("Filtered Image_2", filtered_image_2);
imshow("Filtered Image_3", filtered_image_3);
imshow("Filtered Image_4", filtered_image_4);
waitKey(0);
return 0;
}