2022-06-02 19:44:11 +00:00
from opendm import log
# Make Model (lowercase) --> readout time (ms)
RS_DATABASE = {
' dji phantom vision fc200 ' : 74 , # Phantom 2
' dji fc300s ' : 33 , # Phantom 3 Advanced
2022-06-13 18:42:32 +00:00
' dji fc300c ' : 33 , # Phantom 3 Standard
2022-06-02 19:44:11 +00:00
' dji fc300x ' : 33 , # Phantom 3 Professional
' dji fc330 ' : 33 , # Phantom 4
' dji fc6310 ' : 33 , # Phantom 4 Professional
2022-06-15 12:40:34 +00:00
' dji fc7203 ' : 20 , # Mavic Mini v1
2022-06-02 19:44:11 +00:00
' dji fc350 ' : 30 , # Inspire 1
2022-06-16 16:47:33 +00:00
' gopro hero4 black ' : 30 , # GoPro Hero 4 Black
' gopro hero8 black ' : 17 # GoPro Hero 8 Black
2022-06-02 19:44:11 +00:00
2022-06-17 19:18:09 +00:00
# Help us add more!
# See: https://github.com/OpenDroneMap/RSCalibration for instructions
2022-06-02 19:44:11 +00:00
}
DEFAULT_RS_READOUT = 30 # Just a guess
def make_model_key ( make , model ) :
return ( " %s %s " % ( make . strip ( ) , model . strip ( ) ) ) . lower ( ) . strip ( )
warn_db_missing = { }
def get_rolling_shutter_readout ( make , model , override_value = 0 ) :
global warn_db_missing
if override_value > 0 :
return override_value
key = make_model_key ( make , model )
if key in RS_DATABASE :
return float ( RS_DATABASE [ key ] )
else :
# Warn once
if not key in warn_db_missing :
2022-06-17 19:18:09 +00:00
log . ODM_WARNING ( " Rolling shutter readout time for \" %s %s \" is not in our database, using default of %s ms which might be incorrect. Use --rolling-shutter-readout to set an actual value (see https://github.com/OpenDroneMap/RSCalibration for instructions on how to calculate this value) " % ( make , model , DEFAULT_RS_READOUT ) )
2022-06-02 19:44:11 +00:00
warn_db_missing [ key ] = True
return float ( DEFAULT_RS_READOUT )