Closed jiawen closed 6 years ago
Hi @jiawen,
I could not reproduce the issue:
import colour
import colour_demosaicing
RGB = colour_demosaicing.demosaicing_CFA_Bayer_Menon2007(
colour.read_image('mandi.tif'), 'BGGR')
colour.write_image(RGB, 'mandi_Menon2007.jpg')
Malvar (2004)
Menon (2007)
How are you invoking the function(s)?
My apologies for the delay as I got distracted by other stuff at work. Maybe it's because I'm reading the input using skimage.io.imread() instead of colour.read_image()?
Anyway, here's the IPython notebook I was using, and this is the output from Malvar.
I'm using colour-demosaicing 0.1.2 installed from pip on Python 3.6.
I'm not using colour.read_image() mainly because I have no idea how to easily install OpenImageIO into Anaconda without installing it system-wide.
@jiawen : I will try to look at that over the weekend, by the mean time can you try converting the array you get from skimage.io.imread
to float and maybe divide it by 255 or 65535 before passing it to demosaicing_CFA_Bayer_Menon2007
?
Cheers,
Thomas
Hi @jiawen,
I'm closing this for now, feel free to continue the discussion though.
Cheers,
Thomas
My apologies ahead of time for not posting images as I am uncertain whether I have the appropriate rights.
I just tried demosaicing_CFA_Bayer_Malvar2004() and demosaicing_CFA_Bayer_Menon2007() on the standard MATLAB test image "mandi.tif" (see https://www.mathworks.com/help/images/ref/demosaic.html).
With the Malvar method, I see distinctive speckles of pure red and blue in the output near highlights. Besides that, the results are basically identical to that of MATLAB.
With the Menon method, there are pure red, green, and blue everywhere.
I suspect these are some bugs in the way overflow and underflow are handled.