I would like to access the intensity of individual color pixels within the RGGB-Bayer pattern of my Sony camera. With the rawpy package it seems like I can obtain the raw_image, but it is a 2D-array of the shape (4024, 6048), which is the size of the sensor. Shouldn't the array contain RGGB-data for each pixel, and therefore have the shape (8048, 12096)?
import rawpy
im_raw = rawpy.imread('Test.ARW').raw_image
print(np.shape(im_raw))
Each pixel of a bayer-pattern sensor is either red, green or blue, and there are as many greens as there are reds and blues together. There is not full colour info for every pixel. To make a full RGB image, the three components need to be interpolated to fill out the gaps.