SINTEF / pyopia

Python Ocean Particle Image Analysis
https://pyopia.readthedocs.io
BSD 3-Clause "New" or "Revised" License
11 stars 6 forks source link

Dark im_corrected if using ".bmp" raw images #324

Closed arsalanmstn closed 1 month ago

arsalanmstn commented 1 month ago

The corrected image of a .bmp has float type values while its range is between 0 and 255. So the pipeline.data['im_corrected'] returns a dark image (overflowed values).

It seems that in SilCamLoad() class, the '.bmp': skimage.io.imread does not rescale the image to float64 in the range of (0,1). Suggestion: modifying the code by defining a lambda function for '.bmp' extension as: '.bmp': lambda f: skimage.io.imread(f).astype(np.float64) / 255}

nepstad commented 1 month ago

This sounds like a good solution, please do implement and create a pull request.