-
Notifications
You must be signed in to change notification settings - Fork 0
/
hiding1.cpp
51 lines (35 loc) · 968 Bytes
/
hiding1.cpp
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
39
40
41
42
43
44
45
46
47
48
49
50
51
#include<opencv2\opencv.hpp>
#define fun(x,y,k,l)
cv::Mat decreaseResolution(cv::Mat src ,cv::Rect part)
{
///////////////////////decrease resolution
int i,j,r,c,rp,cp,px,py;
r=src.rows;
c= src.cols;
rp= part.width;
cp = part.height;
px = part.x;
py = part.y;
///////////////////////////////////
for(i=py;i<py+cp;i++)
for(j=px;j<px+rp;j++)
{
}
}
int main()
{
cv::Mat image,image1,lowres;
char *s= (char *)malloc(sizeof(char)*30);
gets(s);
image=cv:: imread(s);
cv::imshow("figure1",image);
cv::cvtColor(image,image1,CV_RGB2GRAY);
cv::imshow("figure2",image1);
cv::Rect part = cv::Rect(45,90,(int)image1.rows/4,(int)image1.cols/4);
///////////////////////////////////////////////////////////////////////
// decrease the resolution of the selected part //////////////////////
/////////////////////////////////////////////////////////////////////
lowres = decreaseResolution(image1,part);
cv::waitKey();
return 0;
}