Code:
import numpy as npraw_data = raw_im.raw_imagex1, y1, x2, y2 = 86, 0, 5510, 3648pad_width = ((y1, raw_data.shape[0] - y2), (x1, raw_data.shape[1] - x2))raw_data_filled = np.pad(raw_data, pad_width, mode='edge')shift = 16 - Img.sigbitsc0 = np.left_shift(raw_data_filled[0::2, 0::2].astype(np.int64), shift)c1 = np.left_shift(raw_data_filled[0::2, 1::2].astype(np.int64), shift)c2 = np.left_shift(raw_data_filled[1::2, 0::2].astype(np.int64), shift)c3 = np.left_shift(raw_data_filled[1::2, 1::2].astype(np.int64), shift)Img.channels = [c0, c1, c2, c3]Img.rgb = raw_im.postprocess()
Statistics: Posted by yq3w — Wed Jun 12, 2024 12:49 am