Merge pull request #267 from dakotabenjamin/remove-ccd-defs

Remove local ccd_defs file and reference OpenSfM version

Former-commit-id: 3be6db8063
pull/1161/head
Dakota Benjamin 2016-03-04 15:43:17 -05:00
commit a91d859645
5 zmienionych plików z 21 dodań i 352 usunięć

Wyświetl plik

@ -114,7 +114,7 @@ fi
NUM_CORES=`grep -c processor /proc/cpuinfo`
## Add SuperBuild path to the python path
export PYTHONPATH=$PYTHONPATH:`pwd`/SuperBuild/install/lib/python2.7/dist-packages
export PYTHONPATH=$PYTHONPATH:`pwd`/SuperBuild/install/lib/python2.7/dist-packages:`pwd`/SuperBuild/src/opensfm
## Compile SuperBuild
cd SuperBuild

Wyświetl plik

@ -1,339 +0,0 @@
{
"Apple iPhone 5s": 8.46,
"Asahi Optical Co.,Ltd. PENTAX Optio330RS": 7.176,
"Canon Canon IXUS 240 HS": 6.17,
"Canon Canon DIGITAL IXUS 400": 7.176,
"Canon Canon DIGITAL IXUS 40": 5.76,
"Canon Canon DIGITAL IXUS 430": 6.18,
"Canon Canon DIGITAL IXUS 500": 7.176,
"Canon Canon DIGITAL IXUS 50": 5.76,
"Canon Canon DIGITAL IXUS 55": 5.76,
"Canon Canon DIGITAL IXUS 60": 5.76,
"Canon Canon DIGITAL IXUS 65": 5.76,
"Canon Canon DIGITAL IXUS 700": 7.176,
"Canon Canon DIGITAL IXUS 750": 7.176,
"Canon Canon DIGITAL IXUS 800 IS": 5.76,
"Canon Canon DIGITAL IXUS II": 5.27,
"Canon Canon EOS 10D": 22.7,
"Canon Canon EOS-1D Mark II": 28.7,
"Canon Canon EOS-1Ds Mark II": 35.95,
"Canon Canon EOS 20D": 22.5,
"Canon Canon EOS 20D": 22.5,
"Canon Canon EOS 300D DIGITAL": 22.66,
"Canon Canon EOS 30D": 22.5,
"Canon Canon EOS 350D DIGITAL": 22.2,
"Canon Canon EOS 400D DIGITAL": 22.2,
"Canon Canon EOS 40D": 22.2,
"Canon Canon EOS 5D": 35.8,
"Canon Canon EOS 5D Mark II": 36.0,
"Canon Canon EOS 6D": 35.8,
"Canon Canon EOS DIGITAL REBEL": 22.66,
"Canon Canon EOS DIGITAL REBEL XT": 22.2,
"Canon Canon EOS DIGITAL REBEL XTi": 22.2,
"Canon Canon EOS Kiss Digital": 22.66,
"Canon Canon IXY DIGITAL 600": 7.176,
"Canon Canon PowerShot A10": 5.23,
"Canon Canon PowerShot A20": 7.176,
"Canon Canon PowerShot A400": 4.54,
"Canon Canon PowerShot A40": 5.27,
"Canon Canon PowerShot A510": 5.76,
"Canon Canon PowerShot A520": 5.76,
"Canon Canon PowerShot A530": 5.76,
"Canon Canon PowerShot A60": 5.27,
"Canon Canon PowerShot A620": 7.176,
"Canon Canon PowerShot A630": 7.176,
"Canon Canon PowerShot A640": 7.176,
"Canon Canon PowerShot A700": 5.76,
"Canon Canon PowerShot A70": 5.27,
"Canon Canon PowerShot A710 IS": 5.76,
"Canon Canon PowerShot A75": 5.27,
"Canon Canon PowerShot A80": 7.176,
"Canon Canon PowerShot A85": 5.27,
"Canon Canon PowerShot A95": 7.176,
"Canon Canon PowerShot G12": 7.44,
"Canon Canon PowerShot G1": 7.176,
"Canon Canon PowerShot G2": 7.176,
"Canon Canon PowerShot G3": 7.176,
"Canon Canon PowerShot G5": 7.176,
"Canon Canon PowerShot G6": 7.176,
"Canon Canon PowerShot G7": 7.176,
"Canon Canon PowerShot G9": 7.6,
"Canon Canon PowerShot Pro1": 8.8,
"Canon Canon PowerShot S90": 7.44,
"Canon Canon PowerShot S95": 7.44,
"Canon Canon PowerShot S100": 7.44,
"Canon Canon PowerShot S110": 7.44,
"Canon Canon PowerShot S120": 7.44,
"Canon Canon PowerShot S1 IS": 5.27,
"Canon Canon PowerShot S200": 5.27,
"Canon Canon PowerShot S2 IS": 5.76,
"Canon Canon PowerShot S30": 7.176,
"Canon Canon PowerShot S3 IS": 5.76,
"Canon Canon PowerShot S400": 7.176,
"Canon Canon PowerShot S40": 7.176,
"Canon Canon PowerShot S410": 7.176,
"Canon Canon PowerShot S45": 7.176,
"Canon Canon PowerShot S500": 7.176,
"Canon Canon PowerShot S50": 7.176,
"Canon Canon PowerShot S60": 7.176,
"Canon Canon PowerShot S70": 7.176,
"Canon Canon PowerShot S80": 7.176,
"Canon Canon PowerShot SD1000": 5.75,
"Canon Canon PowerShot SD100": 5.27,
"Canon Canon PowerShot SD10": 5.75,
"Canon Canon PowerShot SD110": 5.27,
"Canon Canon PowerShot SD200": 5.76,
"Canon Canon PowerShot SD300": 5.76,
"Canon Canon PowerShot SD400": 5.76,
"Canon Canon PowerShot SD450": 5.76,
"Canon Canon PowerShot SD500": 7.176,
"Canon Canon PowerShot SD550": 7.176,
"Canon Canon PowerShot SD600": 5.76,
"Canon Canon PowerShot SD630": 5.76,
"Canon Canon PowerShot SD700 IS": 5.76,
"Canon Canon PowerShot SD750": 5.75,
"Canon Canon PowerShot SD800 IS": 5.76,
"Canon Canon PowerShot SX260 HS": 6.2,
"Canon EOS 300D DIGITAL": 22.66,
"Canon EOS DIGITAL REBEL": 22.66,
"Canon PowerShot A510": 5.76,
"Canon PowerShot S30": 7.176,
"CASIO COMPUTER CO.,LTD. EX-S500": 5.76,
"CASIO COMPUTER CO.,LTD. EX-Z1000": 7.716,
"CASIO COMPUTER CO.,LTD EX-Z30": 5.76,
"CASIO COMPUTER CO.,LTD. EX-Z600": 5.76,
"CASIO COMPUTER CO.,LTD. EX-Z60": 7.176,
"CASIO COMPUTER CO.,LTD EX-Z750": 7.176,
"CASIO COMPUTER CO.,LTD. EX-Z850": 7.176,
"DJI FC300S": 6.16,
"DJI FC300X": 6.2,
"DJI FC350": 6.17,
"DJI PHANTOM VISION FC200": 6.17,
"EASTMAN KODAK COMPANY KODAK CX7330 ZOOM DIGITAL CAMERA": 5.27,
"EASTMAN KODAK COMPANY KODAK CX7530 ZOOM DIGITAL CAMERA": 5.76,
"EASTMAN KODAK COMPANY KODAK DX3900 ZOOM DIGITAL CAMERA": 7.176,
"EASTMAN KODAK COMPANY KODAK DX4900 ZOOM DIGITAL CAMERA": 7.176,
"EASTMAN KODAK COMPANY KODAK DX6340 ZOOM DIGITAL CAMERA": 5.27,
"EASTMAN KODAK COMPANY KODAK DX6490 ZOOM DIGITAL CAMERA": 5.76,
"EASTMAN KODAK COMPANY KODAK DX7630 ZOOM DIGITAL CAMERA": 7.176,
"EASTMAN KODAK COMPANY KODAK Z650 ZOOM DIGITAL CAMERA": 5.76,
"EASTMAN KODAK COMPANY KODAK Z700 ZOOM DIGITAL CAMERA": 5.76,
"EASTMAN KODAK COMPANY KODAK Z740 ZOOM DIGITAL CAMERA": 5.76,
"FUJIFILM FinePix2600Zoom": 5.27,
"FUJIFILM FinePix40i": 7.6,
"FUJIFILM FinePix A310": 5.27,
"FUJIFILM FinePix A330": 5.27,
"FUJIFILM FinePix A600": 7.6,
"FUJIFILM FinePix E500": 5.76,
"FUJIFILM FinePix E510": 5.76,
"FUJIFILM FinePix E550": 7.6,
"FUJIFILM FinePix E900": 7.78,
"FUJIFILM FinePix F10": 7.6,
"FUJIFILM FinePix F30": 7.6,
"FUJIFILM FinePix F450": 5.76,
"FUJIFILM FinePix F601 ZOOM": 7.6,
"FUJIFILM FinePix S3Pro": 23,
"FUJIFILM FinePix S5000": 5.27,
"FUJIFILM FinePix S5200": 5.76,
"FUJIFILM FinePix S5500": 5.27,
"FUJIFILM FinePix S6500fd": 7.6,
"FUJIFILM FinePix S7000": 7.6,
"FUJIFILM FinePix Z2": 5.76,
"Garmin VIRB": 6.17,
"GoPro HD2 U": 5.8,
"Gopro HD3": 5.76,
"GoPro HERO4 Black": 6.17,
"GoPro HERO4 Silver":6.17,
"GoPro HERO4 S":6.17,
"Hewlett-Packard hp 635 Digital Camera": 4.54,
"Hewlett-Packard hp PhotoSmart 43x series": 5.27,
"Hewlett-Packard HP PhotoSmart 618 (V1.1)": 5.27,
"Hewlett-Packard HP PhotoSmart C945 (V01.61)": 7.176,
"Hewlett-Packard HP PhotoSmart R707 (V01.00)": 7.176,
"KONICA MILOLTA DYNAX 5D": 23.5,
"Konica Minolta Camera, Inc. DiMAGE A2": 8.8,
"KONICA MINOLTA CAMERA, Inc. DiMAGE G400": 5.76,
"Konica Minolta Camera, Inc. DiMAGE Z2": 5.76,
"KONICA MINOLTA DiMAGE A200": 8.8,
"KONICA MINOLTA DiMAGE X1": 7.176,
"KONICA MINOLTA DYNAX 5D": 23.5,
"Minolta Co., Ltd. DiMAGE F100": 7.176,
"Minolta Co., Ltd. DiMAGE Xi": 5.27,
"Minolta Co., Ltd. DiMAGE Xt": 5.27,
"Minolta Co., Ltd. DiMAGE Z1": 5.27,
"Mobius Action Cam": 2.1,
"NIKON COOLPIX L3": 5.76,
"NIKON COOLPIX P2": 7.176,
"NIKON COOLPIX P7700": 7.44,
"NIKON COOLPIX S4": 5.76,
"NIKON COOLPIX S7c": 5.76,
"NIKON COOLPIX S8000": 6.17,
"NIKON CORPORATION NIKON 1 J4": 13.2,
"NIKON CORPORATION NIKON D100": 23.7,
"NIKON CORPORATION NIKON D1": 23.7,
"NIKON CORPORATION NIKON D1H": 23.7,
"NIKON CORPORATION NIKON D200": 23.6,
"NIKON CORPORATION NIKON D2H": 23.3,
"NIKON CORPORATION NIKON D2X": 23.7,
"NIKON CORPORATION NIKON D40": 23.7,
"NIKON CORPORATION NIKON D50": 23.7,
"NIKON CORPORATION NIKON D60": 23.6,
"NIKON CORPORATION NIKON D700": 36,
"NIKON CORPORATION NIKON D70": 23.7,
"NIKON CORPORATION NIKON D70s": 23.7,
"NIKON CORPORATION NIKON D80": 23.6,
"NIKON CORPORATION NIKON D5300": 23.5,
"NIKON D5100": 23.6,
"NIKON E2500": 5.27,
"NIKON E3100": 5.27,
"NIKON E3200": 5.27,
"NIKON E3700": 5.27,
"NIKON E4200": 7.176,
"NIKON E4300": 7.18,
"NIKON E4500": 7.176,
"NIKON E4600": 5.76,
"NIKON E5000": 8.8,
"NIKON E5200": 7.176,
"NIKON E5400": 7.176,
"NIKON E5600": 5.76,
"NIKON E5700": 8.8,
"NIKON E5900": 7.176,
"NIKON E7600": 7.176,
"NIKON E775": 5.27,
"NIKON E7900": 7.176,
"NIKON E8800": 8.8,
"NIKON E990": 7.176,
"NIKON E995": 7.176,
"NIKON S1": 5.76,
"Nokia N80": 5.27,
"Nokia N93": 4.536,
"Nokia N95": 5.7,
"OLYMPUS CORPORATION C-5000Z": 7.176,
"OLYMPUS CORPORATION C5060WZ": 7.176,
"OLYMPUS CORPORATION C750UZ": 5.27,
"OLYMPUS CORPORATION C765UZ": 5.76,
"OLYMPUS CORPORATION C8080WZ": 8.8,
"OLYMPUS CORPORATION X250,D560Z,C350Z": 5.76,
"OLYMPUS CORPORATION X-3,C-60Z": 7.176,
"OLYMPUS CORPORATION X400,D580Z,C460Z": 5.27,
"OLYMPUS IMAGING CORP. E-500": 17.3,
"OLYMPUS IMAGING CORP. E-510": 17.3,
"OLYMPUS IMAGING CORP. FE115,X715": 5.76,
"OLYMPUS IMAGING CORP. SP310": 7.176,
"OLYMPUS IMAGING CORP. SP510UZ": 5.75,
"OLYMPUS IMAGING CORP. SP550UZ": 5.76,
"OLYMPUS IMAGING CORP. uD600,S600": 5.75,
"OLYMPUS_IMAGING_CORP. X450,D535Z,C370Z": 5.27,
"OLYMPUS IMAGING CORP. X550,D545Z,C480Z": 5.76,
"Olympus E-M10": 17.3,
"Olympus E-PL5": 17.3,
"Olympus E-PL6": 17.3,
"OLYMPUS OPTICAL CO.,LTD C2040Z": 6.4,
"OLYMPUS OPTICAL CO.,LTD C211Z": 5.27,
"OLYMPUS OPTICAL CO.,LTD C2Z,D520Z,C220Z": 4.54,
"OLYMPUS OPTICAL CO.,LTD C3000Z": 7.176,
"OLYMPUS OPTICAL CO.,LTD C300Z,D550Z": 5.4,
"OLYMPUS OPTICAL CO.,LTD C4100Z,C4000Z": 7.176,
"OLYMPUS OPTICAL CO.,LTD C750UZ": 5.27,
"OLYMPUS OPTICAL CO.,LTD X-2,C-50Z": 7.176,
"OLYMPUS SP550UZ": 5.76,
"OLYMPUS X100,D540Z,C310Z": 5.27,
"Panasonic DMC-GH4": 17.3,
"Panasonic DMC-FX01": 5.76,
"Panasonic DMC-FX07": 5.75,
"Panasonic DMC-FX9": 5.76,
"Panasonic DMC-FZ20": 5.76,
"Panasonic DMC-FZ2": 4.54,
"Panasonic DMC-FZ30": 7.176,
"Panasonic DMC-FZ50": 7.176,
"Panasonic DMC-FZ5": 5.76,
"Panasonic DMC-FZ7": 5.76,
"Panasonic DMC-LC1": 8.8,
"Panasonic DMC-LC33": 5.76,
"Panasonic DMC-LX1": 8.5,
"Panasonic DMC-LZ2": 5.76,
"Panasonic DMC-TS4": 6.08,
"Panasonic DMC-TZ1": 5.75,
"Panasonic DMC-TZ3": 5.68,
"Panasonic DMC-TZ5": 6.12,
"PENTAX Corporation PENTAX *ist DL": 23.5,
"PENTAX Corporation PENTAX *ist DS2": 23.5,
"PENTAX Corporation PENTAX *ist DS": 23.5,
"PENTAX Corporation PENTAX K100D": 23.5,
"PENTAX Corporation PENTAX Optio 450": 7.176,
"PENTAX Corporation PENTAX Optio 550": 7.176,
"PENTAX Corporation PENTAX Optio E10": 5.76,
"PENTAX Corporation PENTAX Optio S40": 5.76,
"PENTAX Corporation PENTAX Optio S4": 5.76,
"PENTAX Corporation PENTAX Optio S50": 5.76,
"PENTAX Corporation PENTAX Optio S5i": 5.76,
"PENTAX Corporation PENTAX Optio S5z": 5.76,
"PENTAX Corporation PENTAX Optio SV": 5.76,
"PENTAX Corporation PENTAX Optio WP": 5.75,
"PHANTOM VISION FC200": 6.17,
"Ricoh GR": 23.7,
"RICOH CaplioG3 modelM": 5.27,
"RICOH Caplio GX": 7.176,
"RICOH Caplio R30": 5.75,
"Samsung Digimax 301": 5.27,
"Samsung Techwin <Digimax i5, Samsung #1>": 5.76,
"Samsung NX1000": 23.5,
"Samsung NX1100": 23.5,
"Samsung NX2000": 23.5,
"Samsung NX3000": 23.5,
"Samsung NX3300": 23.5,
"Samsung NX300": 23.5,
"Samsung NX200": 23.5,
"Samsung NX210": 23.5,
"Samsung NX500": 23.5,
"Samsung NX1": 23.5,
"SAMSUNG TECHWIN Pro 815": 8.8,
"SONY A7": 35.9,
"SONY A7R": 35.9,
"SONY DSC-F828": 8.8,
"SONY DSC-H1": 6.104,
"SONY DSC-H2": 5.744,
"SONY DSC-H3": 5.744,
"SONY DSC-H5": 5.744,
"SONY DSC-H7": 5.744,
"SONY DSC-H9": 5.744,
"SONY DSC-HX5V": 6.104,
"SONY DSC-HX50V": 6.17,
"SONY DSC-N12": 7.176,
"SONY DSC-P100": 7.176,
"SONY DSC-P10": 7.176,
"SONY DSC-P12": 7.176,
"SONY DSC-P150": 7.176,
"SONY DSC-P200": 7.176,
"SONY DSC-P52": 5.27,
"SONY DSC-P72": 5.27,
"SONY DSC-P73": 5.27,
"SONY DSC-P8": 5.27,
"SONY DSC-R1": 21.5,
"SONY DSC-S40": 5.27,
"SONY DSC-S600": 5.76,
"SONY DSC-T9": 7.18,
"SONY DSC-V1": 7.176,
"SONY DSC-W1": 7.176,
"SONY DSC-W30": 5.76,
"SONY DSC-W50": 5.75,
"SONY DSC-W5": 7.176,
"SONY DSC-W7": 7.176,
"SONY DSC-W80": 5.75,
"SONY DSC-WX220": 7.70,
"SONY ILCE-7S": 35.8,
"SONY ILCE-5100": 23.5,
"SONY NEX-5T": 23.4,
"SONY NEX-5R": 23.4,
"SONY NEX-7": 23.5,
"SONY SLT-A55": 23.5,
"SONY SLT-A57": 23.5,
"SONY SLT-A65": 23.5,
"SONY SLT-A77": 23.5,
"SONY SLT-A77 II": 23.5,
"SONY SLT-A77V": 23.5,
"SONY SLT-A99": 35.8,
"Vexcel UltraCam": 28.00,
"Mantis i23": 45.00,
"XIAOYI YDXJ 1": 5.23
}

Wyświetl plik

@ -7,7 +7,6 @@ scripts_path = os.path.abspath(os.path.dirname(__file__))
root_path, _ = os.path.split(scripts_path)
superbuild_path = os.path.join(root_path, 'SuperBuild')
ccd_widths_path = os.path.join(root_path, 'data/ccd_defs.json')
tests_path = os.path.join(root_path, 'tests')
tests_data_path = os.path.join(root_path, 'tests/test_data')
@ -17,6 +16,7 @@ sys.path.append(pyopencv_path)
# define opensfm path
opensfm_path = os.path.join(superbuild_path, "src/opensfm")
ccd_widths_path = os.path.join(opensfm_path, 'opensfm/data/sensor_data.json')
# define pmvs path
cmvs_path = os.path.join(superbuild_path, "install/bin/cmvs")

Wyświetl plik

@ -4,6 +4,7 @@ import json
import datetime
import sys
import subprocess
import string
from opendm import context
from opendm import log
@ -11,9 +12,9 @@ from opendm import log
def get_ccd_widths():
"""Return the CCD Width of the camera listed in the JSON defs file."""
with open(context.ccd_widths_path) as jsonFile:
return json.load(jsonFile)
with open(context.ccd_widths_path) as f:
sensor_data = json.loads(f.read())
return dict(zip(map(string.lower, sensor_data.keys()), sensor_data.values()))
def run(cmd):
"""Run a system command"""

Wyświetl plik

@ -2,6 +2,7 @@ import cv2
import pyexiv2
import re
from fractions import Fraction
from opensfm.exif import sensor_string
import log
import io
@ -26,14 +27,15 @@ class ODM_Photo:
# other attributes
self.camera_make = None
self.camera_model = None
self.make_model = None
# parse values from metadata
self.parse_pyexiv2_values(self.path_file, force_focal, force_ccd)
# compute focal length into pixels
self.update_focal()
# print log message
log.ODM_DEBUG('Loaded %s | dimensions: %s x %s | focal: %s | ccd: %s' %
(self.filename, self.width, self.height, self.focal_length, self.ccd_width))
log.ODM_DEBUG('Loaded %s | camera: %s | dimensions: %s x %s | focal: %s | ccd: %s' %
(self.filename, self.make_model, self.width, self.height, self.focal_length, self.ccd_width))
def update_focal(self):
# compute focal length in pixels
@ -65,29 +67,34 @@ class ODM_Photo:
self.camera_model = val
elif key == 'Exif.Photo.FocalLength':
self.focal_length = float(val)
except Exception, e:
except pyexiv2.ExifValueError, e:
pass
self.make_model = sensor_string(self.camera_make, self.camera_model)
# needed to do that since sometimes metadata contains wrong data
img = cv2.imread(_path_file)
self.width = img.shape[1]
self.height = img.shape[0]
# force focal and ccd_width with user parameter
if _force_focal: self.focal_length = _force_focal
if _force_ccd: self.ccd_width = _force_ccd
if _force_focal:
self.focal_length = _force_focal
if _force_ccd:
self.ccd_width = _force_ccd
# find ccd_width from file if needed
if self.ccd_width is None and self.camera_model is not None:
# load ccd_widths from file
ccd_widths = system.get_ccd_widths()
# search ccd by camera model
key = [x for x in ccd_widths.keys() if self.camera_model in x]
key = [x for x in ccd_widths.keys() if self.make_model in x]
# convert to float if found
if key:
self.ccd_width = float(ccd_widths[key[0]])
# else:
# log.ODM_ERROR('Could not find ccd_width in file')
else:
log.ODM_WARNING('Could not find ccd_width in file. Use --force-ccd or edit the sensor_data.json '
'file to manually input ccd width')
# TODO: finish this class