deep_demosaick icon indicating copy to clipboard operation
deep_demosaick copied to clipboard

Some questions about input raw image size

Open GuoShi28 opened this issue 4 years ago • 0 comments

Hi, this work is very interesting. When I testing the performance on my own captured image, I'm confused about the input shape of MMNet.

p = Demosaic(image_patch.float(), M_patch.float())
p.cuda_()
xcur = mmnet.forward_all_iter(p, max_iter=args.max_iter, init=args.init, noise_estimation=args.noise_estimation)

(1) In my testing, the size of image patch is (H, W) with rggb bayer pattern. The largest number of image patch should be 255. (2) However, when I see the code in data_loader.py, the size of input seems to have size of H, W, 3.

image_mosaic = np.zeros(image_gt.shape).astype(np.int32)
image_mosaic[:, :, 0] = mask[..., 0] * image_input
image_mosaic[:, :, 1] = mask[..., 1] * image_input
image_mosaic[:, :, 2] = mask[..., 2] * image_input
#print(image_mosaic.dtype)
 image_input = np.sum(image_mosaic, axis=2, dtype='uint16')
# perform bilinear interpolation for bayer_rggb images
if self.apply_bilinear:
image_mosaic = self.preprocess(self.pattern, image_input)

image_gt = img_as_ubyte(image_gt)
image_input = image_mosaic.astype(np.float32)/65535*255

What's the right understanding of this question. Looking forward for your reply. Thank you.

GuoShi28 avatar Jan 07 '20 12:01 GuoShi28