-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
executable file
·24 lines (22 loc) · 781 Bytes
/
main.cpp
File metadata and controls
executable file
·24 lines (22 loc) · 781 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
#include <cstdio>
#include <string>
#include "imager/image.h"
#include "deconvolver.h"
using namespace std;
int main(int argc, char ** argv) {
if (argc < 3)
printf("Needs an input file and an output file\n");
string in_path(argv[1]);
string out_path(argv[2]);
printf("Cleaning %s\n", in_path.c_str());
deconvolver dc = deconvolver(in_path);
dc.deconvolve(8);
printf("Total time: %fs, FFT time: %fs, MatrixMult time: %f, LeastSquares time: %f\n", dc.time(), dc.fft_time(), dc.matrixMult_time(), dc.leastSquares_time());
image out(dc.height, dc.width, dc.img);
if (argc >= 3) {
string sky_path(argv[3]);
image sky(sky_path);
printf("L2 Error of image with %s: %f\n", sky_path.c_str(), out.l2Difference(sky));
}
out.save_pgm(out_path+".pgm");
}