"OSError: Grayscale not implemented" when processing historical aerial images

Hello. I am trying to create an orthophoto from a dataset of historical aerial images, for which GPS data is not available.
My dataset is composed of .tif grayscale images. I am using a set of image masks as explained in https://docs.opendronemap.org/masks/ to leave out the border of the images.

During the undistorting stage I get OSError: Grayscale not implemented.
The original images are made of 1 band of uint8 values. The masks are black and white values (0 and 255 respectively). I have tried converting the images and/or the masks to RGB but I get the same error.

I am running WebODM 2.0.0 on Ubuntuu 20.04.
I am pasting the traceback below. I uploaded the full log on Google Drive at https://drive.google.com/file/d/1dmdHt-jAbk69JHTgXN0lxHfYHbHzezxG/view?usp=sharing
Any help or suggestion is appreciated.

Traceback (most recent call last):
File "/code/run.py", line 59, in <module>
retcode = app.execute()
File "/code/stages/odm_app.py", line 117, in execute
raise e
File "/code/stages/odm_app.py", line 81, in execute
self.first_stage.run()
File "/code/opendm/types.py", line 398, in run
self.next_stage.run(outputs)
File "/code/opendm/types.py", line 398, in run
self.next_stage.run(outputs)
File "/code/opendm/types.py", line 398, in run
self.next_stage.run(outputs)
File "/code/opendm/types.py", line 377, in run
self.process(self.args, outputs)
File "/code/stages/run_opensfm.py", line 181, in process
octx.convert_and_undistort(self.rerun(), undistort_callback, image_list_override)
File "/code/opendm/osfm.py", line 464, in convert_and_undistort
undistort.run_dataset(ds, "reconstruction.json",
File "/code/SuperBuild/install/bin/opensfm/opensfm/actions/undistort.py", line 39, in run_dataset
undistort.undistort_reconstruction_with_images(
File "/code/SuperBuild/install/bin/opensfm/opensfm/undistort.py", line 117, in undistort_reconstruction_with_images
parallel_map(undistort_image_and_masks, arguments, processes)
File "/code/SuperBuild/install/bin/opensfm/opensfm/context.py", line 59, in parallel_map
res = Parallel(batch_size=batch_size)(delayed(func)(arg) for arg in args)
File "/usr/local/lib/python3.9/dist-packages/joblib/parallel.py", line 1056, in __call__
self.retrieve()
File "/usr/local/lib/python3.9/dist-packages/joblib/parallel.py", line 935, in retrieve
self._output.extend(job.get(timeout=self.timeout))
File "/usr/lib/python3.9/multiprocessing/pool.py", line 771, in get
raise self._value
File "/usr/lib/python3.9/multiprocessing/pool.py", line 125, in worker
result = (True, func(*args, **kwds))
File "/usr/local/lib/python3.9/dist-packages/joblib/_parallel_backends.py", line 595, in __call__
return self.func(*args, **kwargs)
File "/usr/local/lib/python3.9/dist-packages/joblib/parallel.py", line 262, in __call__
return [func(*args, **kwargs)
File "/usr/local/lib/python3.9/dist-packages/joblib/parallel.py", line 262, in <listcomp>
return [func(*args, **kwargs)
File "/code/SuperBuild/install/bin/opensfm/opensfm/undistort.py", line 139, in undistort_image_and_masks
mask = data.load_mask(shot.id)
File "/code/SuperBuild/install/bin/opensfm/opensfm/dataset.py", line 134, in load_mask
mask = self.io_handler.imread(mask_path, grayscale=True)
File "/code/SuperBuild/install/bin/opensfm/opensfm/io.py", line 1491, in imread
return imread_rasterio(path, grayscale, unchanged, anydepth)
File "/code/SuperBuild/install/bin/opensfm/opensfm/io.py", line 1268, in imread_rasterio
raise IOError("Grayscale not implemented")
OSError: Grayscale not implemented
1 Like

Welcome!

Are you able to share the dataset?