Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

playDataset can't read calibration file #14

Closed
alejandronespereira opened this issue Feb 7, 2018 · 3 comments
Closed

playDataset can't read calibration file #14

alejandronespereira opened this issue Feb 7, 2018 · 3 comments

Comments

@alejandronespereira
Copy link

There seems to be a bug with the camera calibration reader in which no float is correctly read. Here's my output, using the sequence 45

Playback dataset /home/alejandro/Downloads/sequence_45/!
Load Dataset /home/alejandro/Downloads/sequence_45/: found 3000 files in folder /images; assuming that all images are there.
0.535719308086809       0.669566858850269       0.493248545285398       0.500408664348414       0.897966326944875
inputCalibration before
0
0
0
0
0
inputCalibration after
0
0
0
0
0
Failed to read camera calibration (invalid format?)
Calibration file: /home/alejandro/Downloads/sequence_45/camera.txt
Reading Photometric Calibration from file /home/alejandro/Downloads/sequence_45/pcalib.txt
Reading Vignette Image from /home/alejandro/Downloads/sequence_45/vignette.png
PhotometricUndistorter: Invalid vignette image size! got 1280 x 1024, expected 0 x 0. Set vignette to 1.
Dataset /home/alejandro/Downloads/sequence_45/: Got 3000 files!
Rectified Images: -1 x 0. K:
2.10578e-08 4.56277e-41 1.41933e-37
4.56277e-41 1.41933e-37           0
2.10578e-08           0           0

Original Images: 0 x 0. omega=0,000000 K:
0 0 0
0 0 0
0 0 0

ERROR: expected cv-mat to have dimensions 0 x 0; found 1280 x 1024 (image /home/alejandro/Downloads/sequence_45/images/00000.jpg)!
Segmentation fault (core dumped)

I added those lines for debugging purposes. Seems like
std::sscanf(l1.c_str(),"%f %f %f %f %f", &inputCalibration[0], &inputCalibration[1], &inputCalibration[2], &inputCalibration[3], &inputCalibration[4]);
at FOVundistorter.cpp isn't parsing the calibration file correctly. I've tried with other sequences to no avail.

@NikolausDemmel
Copy link

Looks like the same issue as #13 maybe? Have you seen my comments in #13 (comment)? What is your locale setting?

Could you try adding something like

std::setlocale(LC_ALL, "C");

to the start of your program. I don't really know how to properly set locale for scanf. You might need to do a quick google search to find the right call.

@alejandronespereira
Copy link
Author

Yes it seems to be a similar issue. I'll look into it and tell you how it goes, thanks!

@alejandronespereira
Copy link
Author

Yep. Works like a charm, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants