swz30/CycleISP

rgb2raw branch mosaic problem

oneTaken opened this issue · 0 comments

In the Rgb2Raw branch,the feature map before Mosaic is HxWx3,and you use this code to generate final raw output:

def mosaic(images):
  shape = images.shape
  red = images[:, 0, 0::2, 0::2]
  green_red = images[:, 1, 0::2, 1::2]
  green_blue = images[:, 1, 1::2, 0::2]
  blue = images[:, 2, 1::2, 1::2]
  images = torch.stack((red, green_red, green_blue, blue), dim=1)
  # images = tf.reshape(images, (shape[0] // 2, shape[1] // 2, 4))
  return images

this just use litter data of images to generate raw, I find some details in your paper in Section3.1,

the Bayer sampling function f_Bayer is applied

So why just output a feature map with shape HxWx1 to full use the data?