-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathformmapunsigned.cpp
More file actions
52 lines (48 loc) · 1.53 KB
/
Copy pathformmapunsigned.cpp
File metadata and controls
52 lines (48 loc) · 1.53 KB
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
52
#include "CImg.h"
#include "Global.h"
#include "Commons.h"
#include <iostream>
#include <string>
#include <time.h>
#include <fstream>
#include <iostream>
using namespace std;
const unsigned char red[] = { 255,0,0 };
int main()
{
string imagename,orgimg;
string scaleimagename;
int sx, sy;
int ex, ey;
cout << "Image name: ";
cin >> scaleimagename;
cout << "Blur scale image name: ";
cin >> imagename;
//cout<<"Enter original imagename: ";
//cin>>orgimg;
string scaleimage=basepath+"scale-"+scaleimagename+".jpg";
//string originalimage=basepath+orgimg;
string imagefilename=basepath+imagename;
string circledImage=basepath+"Pointsmarked-"+orgimg;
string mapexcelfile =basepath+scaleimagename+"plotData.csv";
ofstream fout;
ifstream fin;
fout.open(mapexcelfile.c_str());
fin.open("scaleMap.txt");
CImg<unsigned short> blurscaleimage(imagefilename.c_str());
CImg<unsigned short> scaleimagecomputed(scaleimage.c_str());
//CImg<unsigned short> circled(originalimage.c_str());
//CImg<unsigned short> rgbimg=convert_to_RGB_image<unsigned short>(circled);
Xdim = blurscaleimage.width();
Ydim = blurscaleimage.height();
int x, y,z;
while(fin>>x>>y){
fout<<x<<" "<<y<<" "<<(double)blurscaleimage(x,y)/10<<" "<<(double)scaleimagecomputed(x,y)/2<<"\n";
//rgbimg.draw_circle(x,y,1,red,1,1);
//rgbimg.draw_circle(x,y,2,red,1,1);
}
fin.close();
fout.close();
//rgbimg.display();
//rgbimg.save_tiff(circledImage.c_str());
}