You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
where the filename is interpreted as ending on the first space, then gobbling up and turning the remainder of the nvm file into garbage.
We can handle this case by some trial and error handling in bundle_io at the above location:
//Gobble up any leading whitespace
in >> std::ws;
//Read a full line of camera details
std::string camline = std::getline(in, camline);
std::istringstream line(camline);
//Read out parts of the filename until we find an actual file
line >> nvm_cam.filename;
while(!std::ifstream(nvm_cam.filename)) {
std::string tmp;
line >> tmp;
nvm_cam.filename += " " + tmp;
if(!line) break;
}
if(!line) {
//We've gobbled up the whole camera line searching for a missing file, so skip it.
//Since later data may be dependent on the camera ordering however,
//we still push the invalid camera and parameter bundle. There may be other ways
//to handle this.
nvm_cam.filename = "<invalid camera, file not found: '" + nvm_cam.filename + "'>";
bundle_cams.push_back(bundle_cam); nvm_cams.push_back(nvm_cam);
continue;
}
//Replace remaining uses of 'in' within the loop with 'line'
With this, mve should be able to handle this weakness in the nvm file format without breaking otherwise correct files nor fail disastrously on missing camera files.
To fully avoid any inconsistencies (given that nvm doesn't have any escape characters), we would have to go one step further and parse a camera line in reverse, extracting each numeric token and then interpreting the remainder as a file name. I think this may be overkill though.
The text was updated successfully, but these errors were encountered:
Hi!
I'm running the active version of mve in the ODM docker container.
From this, I have an intermediate nvm file with a set of images generated through ODM wherein the filenames contain spaces.
When mve attempts to load this file, it introduces an error on
mve/libs/mve/bundle_io.cc
Line 112 in 2106a5b
We can handle this case by some trial and error handling in bundle_io at the above location:
With this, mve should be able to handle this weakness in the nvm file format without breaking otherwise correct files nor fail disastrously on missing camera files.
To fully avoid any inconsistencies (given that nvm doesn't have any escape characters), we would have to go one step further and parse a camera line in reverse, extracting each numeric token and then interpreting the remainder as a file name. I think this may be overkill though.
The text was updated successfully, but these errors were encountered: