Improved float/double when reading ascii formats (read in double and then convert to the needed type)
This commit is contained in:
parent
d127123513
commit
aa63261fae
|
@ -76,7 +76,7 @@ static void readline(FILE *fp, char *line, int max=100){
|
||||||
static bool ReadHeader(FILE *fp,unsigned int &num_cams, unsigned int &num_points){
|
static bool ReadHeader(FILE *fp,unsigned int &num_cams, unsigned int &num_points){
|
||||||
char line[100];
|
char line[100];
|
||||||
readline(fp, line);
|
readline(fp, line);
|
||||||
if( (line[0]=='\0') ) return false;
|
if( line[0]=='\0' ) return false;
|
||||||
line[18]='\0';
|
line[18]='\0';
|
||||||
if(0!=strcmp("# Bundle file v0.3", line)) return false;
|
if(0!=strcmp("# Bundle file v0.3", line)) return false;
|
||||||
readline(fp, line);
|
readline(fp, line);
|
||||||
|
@ -168,7 +168,7 @@ static int Open( OpenMeshType &m, std::vector<Shot<ScalarType> > & shots,
|
||||||
|
|
||||||
fscanf(fp,"%d ",&n_corr);
|
fscanf(fp,"%d ",&n_corr);
|
||||||
for(uint j = 0; j < n_corr; ++j){
|
for(uint j = 0; j < n_corr; ++j){
|
||||||
fscanf(fp,"%d %d %f %f ",&i_cam,&key_sift,&x,&y);
|
fscanf(fp,"%d %d %lf %lf ",&i_cam,&key_sift,&x,&y);
|
||||||
Correspondence corr(i_cam,key_sift,x,y);
|
Correspondence corr(i_cam,key_sift,x,y);
|
||||||
ch[i].push_back(corr);
|
ch[i].push_back(corr);
|
||||||
}
|
}
|
||||||
|
|
|
@ -272,9 +272,9 @@ public:
|
||||||
|
|
||||||
// read the stream
|
// read the stream
|
||||||
if(hascolor)
|
if(hascolor)
|
||||||
fscanf(fp,"%f %f %f %f %f %f %f", &xx, &yy, &zz, &rf, &rr, &gg, &bb);
|
fscanf(fp,"%lf %lf %lf %f %f %f %f", &xx, &yy, &zz, &rf, &rr, &gg, &bb);
|
||||||
else
|
else
|
||||||
fscanf(fp,"%f %f %f %f", &xx, &yy, &zz, &rf);
|
fscanf(fp,"%lf %lf %lf %f", &xx, &yy, &zz, &rf);
|
||||||
|
|
||||||
// add the point
|
// add the point
|
||||||
(*vi).P()[0]=xx;
|
(*vi).P()[0]=xx;
|
||||||
|
|
Loading…
Reference in New Issue