Closed tututu05 closed 3 years ago
Hi, thanks for your interest in our work.
Inverting the bilinear demosaicing process can be quite easy. You just need to keep the pixels at the positions of bayer pattern. For example, the following sample codes may work:
def invert_bilinear_demosaic(bilinear_raw):
H,W,_ = bilinear_raw.shape
raw = np.zeros((H,W))
raw[0:H:2, 0:W:2] = bilinear_raw[0:H:2, 0:W:2, 0] # R
raw[0:H:2, 1:W:2] = bilinear_raw[0:H:2, 1:W:2, 1] # G
raw[1:H:2, 0:W:2] = bilinear_raw[1:H:2, 0:W:2, 1] # G
raw[1:H:2, 1:W:2] = bilinear_raw[1:H:2, 1:W:2, 2] # B
return raw
Thanks!
A great work! In your works, the predicted raws are results of demosaicing with 3 channels, right? How can I get raw before demosaicing?