Porównaj commity

...

4 Commity

Autor SHA1 Wiadomość Data
Piero Toffanin 0603f6fd14
Merge c7ada3668c into 424d9e28a0 2024-04-22 09:24:49 -04:00
Piero Toffanin 424d9e28a0
Merge pull request #1756 from andrewharvey/patch-1
Fix PoissonRecon failed with n threads log message
2024-04-18 11:53:46 -04:00
Andrew Harvey a0fbd71d41
Fix PoissonRecon failed with n threads log message
The message was reporting failure with n threads and retrying with n // 2, however a few lines up threads was already set to n // 2 representing the next thread count to try.
2024-04-18 15:35:53 +10:00
Piero Toffanin c7ada3668c Start adding thermal support for DJI M3T 2023-06-29 14:10:53 +02:00
3 zmienionych plików z 15 dodań i 2 usunięć

Wyświetl plik

@ -2,6 +2,7 @@ import json
import os import os
import tempfile import tempfile
import base64 import base64
import numpy as np
from rasterio.io import MemoryFile from rasterio.io import MemoryFile
from opendm.system import run from opendm.system import run
from opendm import log from opendm import log
@ -36,7 +37,12 @@ def extract_raw_thermal_image_data(image_path):
img = img[0][:,:,None] img = img[0][:,:,None]
del j["RawThermalImage"] 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 return extract_temperature_params_from(j), img
else: else:
raise Exception("Invalid JSON (not a list)") raise Exception("Invalid JSON (not a list)")
@ -68,6 +74,7 @@ def unit(unit):
def extract_temperature_params_from(tags): def extract_temperature_params_from(tags):
# Defaults # Defaults
meta = { meta = {
"Emissivity": float, "Emissivity": float,
"ObjectDistance": unit("m"), "ObjectDistance": unit("m"),

Wyświetl plik

@ -187,7 +187,7 @@ def screened_poisson_reconstruction(inPointCloud, outMesh, depth = 8, samples =
if threads < 1: if threads < 1:
break break
else: else:
log.ODM_WARNING("PoissonRecon failed with %s threads, let's retry with %s..." % (threads, threads // 2)) log.ODM_WARNING("PoissonRecon failed with %s threads, let's retry with %s..." % (threads * 2, threads))
# Cleanup and reduce vertex count if necessary # Cleanup and reduce vertex count if necessary

Wyświetl plik

@ -482,6 +482,12 @@ class ODM_Photo:
self.capture_uuid = matches.group(1) self.capture_uuid = matches.group(1)
self.band_name = band_aliases.get(matches.group(2), matches.group(2)) 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 # Sanitize band name since we use it in folder paths
self.band_name = re.sub('[^A-Za-z0-9]+', '', self.band_name) self.band_name = re.sub('[^A-Za-z0-9]+', '', self.band_name)