kopia lustrzana https://github.com/OpenDroneMap/ODM
Porównaj commity
2 Commity
0603f6fd14
...
8ece0e8457
Autor | SHA1 | Data |
---|---|---|
Piero Toffanin | 8ece0e8457 | |
Piero Toffanin | c7ada3668c |
|
@ -2,6 +2,7 @@ import json
|
|||
import os
|
||||
import tempfile
|
||||
import base64
|
||||
import numpy as np
|
||||
from rasterio.io import MemoryFile
|
||||
from opendm.system import run
|
||||
from opendm import log
|
||||
|
@ -36,6 +37,11 @@ def extract_raw_thermal_image_data(image_path):
|
|||
img = img[0][:,:,None]
|
||||
|
||||
del j["RawThermalImage"]
|
||||
elif "ThermalData" in j:
|
||||
thermal_data = base64.b64decode(j["ThermalData"][len("base64:"):])
|
||||
thermal_buf = np.frombuffer(thermal_data, dtype=np.int16)
|
||||
# TODO: how to interpret these?
|
||||
# https://exiftool.org/forum/index.php?topic=11401.45
|
||||
|
||||
return extract_temperature_params_from(j), img
|
||||
else:
|
||||
|
@ -68,6 +74,7 @@ def unit(unit):
|
|||
|
||||
def extract_temperature_params_from(tags):
|
||||
# Defaults
|
||||
|
||||
meta = {
|
||||
"Emissivity": float,
|
||||
"ObjectDistance": unit("m"),
|
||||
|
|
|
@ -482,6 +482,12 @@ class ODM_Photo:
|
|||
self.capture_uuid = matches.group(1)
|
||||
self.band_name = band_aliases.get(matches.group(2), matches.group(2))
|
||||
|
||||
# Some DJI models do not have a band name but have an image source field
|
||||
if self.camera_make.lower() == 'dji':
|
||||
image_source = self.get_xmp_tag(xtags, '@drone-dji:ImageSource')
|
||||
if self.band_name == 'RGB' and isinstance(image_source, str) and image_source.lower() == "infraredcamera":
|
||||
self.band_name = 'LWIR'
|
||||
|
||||
# Sanitize band name since we use it in folder paths
|
||||
self.band_name = re.sub('[^A-Za-z0-9]+', '', self.band_name)
|
||||
|
||||
|
|
Ładowanie…
Reference in New Issue