OpenDroneMap / ODM

A command line toolkit to generate maps, point clouds, 3D models and DEMs from drone, balloon or kite images. 📷
https://opendronemap.org
GNU Affero General Public License v3.0
4.72k stars 1.08k forks source link

Parsing of ccd_defs.json needs improvement #291

Closed joelgraff closed 8 years ago

joelgraff commented 8 years ago

Running OpenDroneMap on some test images generated the error:

Traceback (most recent call last): File "../../OpenDroneMap/run.py", line 986, in <module> prepare_objects() File "../../OpenDroneMap/run.py", line 415, in prepare_objects fileObject["ccd"] = float(ccdWidths[fileObject["id"]]) KeyError: u'PENTAX Corporation PENTAX Optio S5i'

The issue is that the camera description was not found in the ccd_defs.json file.

However, the camera description is there (line 269):

"PENTAX Corporation PENTAX Optio S5i": 5.76,

But, of course, the key it was seeking was slightly different:

PENTAX Corporation PENTAX Optio S5i

The difference being an extra space between the manufacturer name and the model description. Duplicating this line and removing the extra space in the ccd_defs.json file resolved this error.

Seems the fix should involve using some regex pattern matching on spaces in the camera descriptions to avoid one-off errors like this.

dakotabenjamin commented 8 years ago

Good catch, however in the current dev branch we rely solely on Mapillary's sensor data, so I'm not sure if we should spend time fixing this problem. AFAIK OpenSfM handles parsing EXIF data robustly.