I'm trying to read and demosaic raw images in Python using the RawPy module. Unfortunately the module does not provide simple demosaic method, but a complete postprocess function which is not suitable for my case since I want to keep the floating point images, instead of using 8bit uint. I also do not want to get gamma applied, or any other postprocessing, so I end up demosaicing them manually. When I use the raw_pattern method of RawPy object where I have loaded the dng image I get this:
In[23] : raw_image.raw_pattern
Out[23]: array([[0, 1],
[3, 2]], dtype=uint8)
But Adobe's DNG documentation says
Digital Negative Specification
September 2012
CFAPlaneColor
...
Value
See below
Default
0, 1, 2 (red, green, blue)
And I get confused where does that 3 come from? If there is another way to demosaic raw image It's also suitable, since it's easy for me to replace this part of the project.
Thanks is advance!