-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest08.cpp
More file actions
36 lines (27 loc) · 927 Bytes
/
Copy pathtest08.cpp
File metadata and controls
36 lines (27 loc) · 927 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
25
26
27
28
29
30
31
32
33
34
35
#include<opencv2/opencv.hpp>
#include<iostream>
using namespace std;
int main(int argc, char** argv)
{
cv::Mat src, dst;
src = cv::imread("C:/Users/RedwallBot/Desktop/Notes/OpenCV_learning/img/shiprock.jpg");
if (!src.data)
{
cout << "could not load image..." << endl;
return -1;
}
char input_title[] = "input image";
char output_title[] = "blur image";
cv::namedWindow(input_title, CV_WINDOW_AUTOSIZE);
cv::namedWindow(output_title, CV_WINDOW_AUTOSIZE);
cv::imshow(input_title, src);
cv::blur(src, dst, cv::Size(5, 5), cv::Point(-1, -1));
cv::imshow(output_title, dst);
cv::imwrite("C:/Users/RedwallBot/Desktop/Notes/OpenCV_learning/img/blur_image.jpg", dst);
cv::Mat gblur;
cv::GaussianBlur(src, gblur, cv::Size(5, 5), 11, 11);
cv::imshow("gaussian blur", gblur);
cv::imwrite("C:/Users/RedwallBot/Desktop/Notes/OpenCV_learning/img/gaussianblur_image.jpg", gblur);
cv::waitKey(0);
return 0;
}