Disable bg/sky removal with DNGs

pull/1833/head
Piero Toffanin 2025-02-23 20:29:38 +00:00
rodzic 2190a5dfa0
commit f5869777ed
2 zmienionych plików z 2 dodań i 3 usunięć

Wyświetl plik

@ -14,7 +14,6 @@ def get_image_size(file_path, fallback_on_error=True):
if file_path[-4:].lower() in [".dng", ".raw", ".nef"]:
with rawpy.imread(file_path) as img:
s = img.sizes
width, height = s.raw_width, s.raw_height
else:
with Image.open(file_path) as img:

Wyświetl plik

@ -216,7 +216,7 @@ class ODMLoadDatasetStage(types.ODM_Stage):
# Generate list of sky images
sky_images = []
for p in photos:
if p.mask is None and (args.camera_lens in ['fisheye', 'spherical'] or p.pitch is None or (abs(p.pitch) > 20)) and (not " " in p.filename):
if p.mask is None and (args.camera_lens in ['fisheye', 'spherical'] or p.pitch is None or (abs(p.pitch) > 20)) and (not " " in p.filename) and not p.is_raw_format():
sky_images.append({'file': os.path.join(images_dir, p.filename), 'p': p})
if len(sky_images) > 0:
@ -257,7 +257,7 @@ class ODMLoadDatasetStage(types.ODM_Stage):
# Generate list of sky images
bg_images = []
for p in photos:
if p.mask is None and (not " " in p.filename):
if p.mask is None and (not " " in p.filename) and not p.is_raw_format():
bg_images.append({'file': os.path.join(images_dir, p.filename), 'p': p})
if len(bg_images) > 0: