Closed Jiazheng411 closed 3 years ago
You will want to find well saturation maximums and minimum for each photosite plane via numpy.amax
and then normalize. (photosite - photosite_min) / (photosite_max - photosite_min)
should work to normalize to 1.0, for example.
Thanks a lot. \
By the way, I found the images showed using colour.plotting.plot_image(colour.cctf_decoding(IMG))
is darker than the original image.\
for example, this is the original image,\
after I read the image using img = colour.read_image(img_path)
\
this is what colour.plotting.plot_image(colour.cctf_decoding(img))
looks like
And I do a mosaicing followed by demosaicing, the image looks much lighter,\
CFA_BGGR = mosaicing_CFA_Bayer(img, 'BGGR')
reinter_CFA_BGGR = demosaicing_CFA_Bayer_bilinear(CFA_BGGR, 'BGGR')
colour.plotting.plot_image(colour.cctf_encoding(reinter_CFA_BGGR))
is this expected? Or what can I do to eliminate this effects?
Most sensor data is linearly encoded. That is, it is not encoded for display. The subject of preparing colour data for display is likely a wholly other matter.
The linear data then would require some sort of nonlinear curvature to scale and prepare the data for output.
The most simple transform would be to use the display’s inverse EOTF to encode the sensor-linear values for display linear output. For example, using the sRGB inverse EOTF, or more likely, a generic inversion of a 2.2 power function, would prepare linear encoded colour data for projection out of a commodity sRGB-like display.
What you are likely to discover after that unfolds further down the rabbit hole...
Hi, @KelSolaar , thanks a lot for the lib. \ I noticed that the demosaicing function does not return the output in [0,1] range, how can I make it in [0,1] range?