Skip to content

Commit 172e2c2

Browse files
authored
Add files via upload
1 parent a20edd4 commit 172e2c2

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

imageSmoothingMedianBlur.cpp

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
#include <opencv2/opencv.hpp>
2+
3+
void imageSmooothing(const cv::Mat & image) {
4+
cv::namedWindow("Input image", cv::WINDOW_AUTOSIZE);
5+
cv::namedWindow("Output image", cv::WINDOW_AUTOSIZE);
6+
7+
cv::imshow("Input image", image);
8+
9+
cv::Mat out;
10+
11+
cv::medianBlur(image, out, 5);
12+
cv::medianBlur(out, out, 5);
13+
14+
cv::imshow("Output image", out);
15+
16+
cv::waitKey(0);
17+
}
18+
19+
int main (int args, char** argv) {
20+
21+
cv::Mat img = cv::imread(argv[1], -1);
22+
23+
if (img.empty()) {
24+
printf("No image found\n");
25+
return -1;
26+
}
27+
28+
imageSmooothing(img);
29+
}

0 commit comments

Comments
 (0)