-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.cpp
42 lines (31 loc) · 1.07 KB
/
main.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
#include "main.h"
#include "FractalCode.h"
#include "getFractalCode.h"
#include "ImageReconstruction.h"
#include <math.h>
#include "C:\OpenCV2.3\include\opencv2\opencv.hpp"
#include "getPSNR.h"
int main(int argc,char** argv)
{
//artificial image
//cv::Mat src=cv::imread("./input/src.png");
//cv::Mat dst=cv::imread("./input/dst.png");
//natural image
cv::Mat dst=cv::imread("./input/128lenna.png");
//cv::Mat resize;
//cv::resize(dst,resize,cv::Size(128,128));
//imwrite("128lenna.png",resize);
cv::Mat src= cv::Mat::zeros(dst.rows,dst.cols,CV_8UC3);
//cv::GaussianBlur(dst,src,cv::Size(3,3),2,2);
const int ITERATIONNUM=10;
const int ROWS=dst.rows;
const int COLS=dst.cols;
const int RANGEBLOCKSIZE=4;
const int DOMAINBLOCKSIZE=2*RANGEBLOCKSIZE;
FractalCode obj[1024];
double t=(double)cv::getTickCount();
getFractalCode(obj,dst,RANGEBLOCKSIZE,DOMAINBLOCKSIZE);
std::cout<<"processing time="<<((double)cv::getTickCount()-t)/cv::getTickFrequency()/60<<"min"<<std::endl;
ImageReconstruction(obj,src,dst,RANGEBLOCKSIZE,DOMAINBLOCKSIZE,ITERATIONNUM);
return 0;
}