Our calibration data is usually read-only to prevent accidental modifications. Unfortunately, this becomes a problem when the data is stored as an INI file, as the function camera_calibration_parser::readCalibrationIni() uses
std::fstream fs(file_name);
By default, files are opened in read-write mode in this way. With read-only files, this inevitably leads to an error. Simple solution is to use std::istream instead of std::fstream. For the time being, our local version uses
bool readCalibrationIni(
const std::string & file_name, std::string & camera_name,
CameraInfo & cam_info)
{
std::ifstream fs(file_name);
return readCalibrationIni(fs, camera_name, cam_info);
}
and works as expected. It would be nice to see this fixed.
Our calibration data is usually read-only to prevent accidental modifications. Unfortunately, this becomes a problem when the data is stored as an INI file, as the function
camera_calibration_parser::readCalibrationIni()usesstd::fstream fs(file_name);By default, files are opened in read-write mode in this way. With read-only files, this inevitably leads to an error. Simple solution is to use
std::istreaminstead ofstd::fstream. For the time being, our local version usesand works as expected. It would be nice to see this fixed.