-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmean_filter.cpp
More file actions
38 lines (33 loc) · 777 Bytes
/
mean_filter.cpp
File metadata and controls
38 lines (33 loc) · 777 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
36
37
38
//please enter the image name
#include<iostream>
#include<opencv2/opencv.hpp>
using namespace cv;
using namespace std;
int main(int argc, char * argv[])
{
if(argc!=2)
{
return -1;
}
Mat img;
img = imread(argv[1]);
if(!img.data)
{
cout<<"No image data\n";
return -1;
}
//cout <<img[0]<<endl;
cout<<"first pixel="<< img.at<double>(0,0) <<endl;
cout<<"image dim="<< img.dims <<endl;
cout<<"height="<<img.size().height<<endl;
cout<<"width="<<img.size().width<<endl;
// what is the need to create the namedWindow
namedWindow("Display Window",WINDOW_AUTOSIZE);
imshow("Display Window",img);
Mat img1;
cv::blur(img,img1,cv::Size(3,3));
namedWindow("Resultant Window", WINDOW_AUTOSIZE);
imshow("Resultant Window",WINDOW_AUTOSIZE);
waitKey(0);
return 0;
}