Mixed 8bit RGB/ 16 bit tiff radiometric calibration working

pull/1512/head
Piero Toffanin 2022-07-26 14:59:21 -04:00
rodzic 2b92f6ccf2
commit 4272cd9d76
5 zmienionych plików z 17 dodań i 7 usunięć

Wyświetl plik

@ -52,7 +52,7 @@ ExternalProject_Add(${_proj_name}
#--Download step--------------
DOWNLOAD_DIR ${SB_DOWNLOAD_DIR}
GIT_REPOSITORY https://github.com/OpenDroneMap/openMVS
GIT_TAG 287
GIT_TAG 288
#--Update/Patch step----------
UPDATE_COMMAND ""
#--Configure step-------------

Wyświetl plik

@ -19,7 +19,7 @@ ExternalProject_Add(${_proj_name}
#--Download step--------------
DOWNLOAD_DIR ${SB_DOWNLOAD_DIR}
GIT_REPOSITORY https://github.com/OpenDroneMap/OpenSfM/
GIT_TAG 287
GIT_TAG 288
#--Update/Patch step----------
UPDATE_COMMAND git submodule update --init --recursive
#--Configure step-------------

Wyświetl plik

@ -56,6 +56,8 @@ def dn_to_radiance(photo, image):
bit_depth_max = photo.get_bit_depth_max()
if bit_depth_max:
image /= bit_depth_max
else:
log.ODM_WARNING("Cannot normalize DN for %s, bit depth is missing" % photo.filename)
if V is not None:
# vignette correction

Wyświetl plik

@ -257,9 +257,9 @@ class ODM_Photo:
elif 'EXIF ISOSpeedRatings' in tags:
self.iso_speed = self.int_value(tags['EXIF ISOSpeedRatings'])
if 'Image BitsPerSample' in tags:
self.bits_per_sample = self.int_value(tags['Image BitsPerSample'])
if 'EXIF DateTimeOriginal' in tags:
str_time = tags['EXIF DateTimeOriginal'].values
utc_time = datetime.strptime(str_time, "%Y:%m:%d %H:%M:%S")
@ -695,6 +695,11 @@ class ODM_Photo:
def get_bit_depth_max(self):
if self.bits_per_sample:
return float(2 ** self.bits_per_sample)
else:
# If it's a JPEG, this must be 256
_, ext = os.path.splitext(self.filename)
if ext.lower() in [".jpeg", ".jpg"]:
return 256.0
return None
@ -732,6 +737,9 @@ class ODM_Photo:
return True
return self.band_name.upper() in ["LWIR"] # TODO: more?
def is_rgb(self):
return self.band_name.upper() in ["RGB", "REDGREENBLUE"]
def camera_id(self):
return " ".join(
[

Wyświetl plik

@ -48,7 +48,7 @@ def get_rolling_shutter_readout(photo, override_value=0):
key = make_model_key(make, model)
if key in RS_DATABASE:
rsd = RS_DATABASE[key]
val = 0.0
val = DEFAULT_RS_READOUT
if isinstance(rsd, int) or isinstance(rsd, float):
val = float(rsd)