Hi there,
I am trying to read data from MAX9296A deserializer which produces RAW12 images. USB controller at the edge of the deserializer is configured as YUV 4:2:2 and sends it as 16 bit pixels and I have no control on it.
I tried to use jetson-utils, but videoSource::Capture() method only supports RGB, RGBA images. What I need is reading 2 meaningful bytes for 1080x1920 pixels.
I can do this with OpenCV but IO backend is really slow compared to jetson-utils.
Just to give an idea I am sharing working OpenCV pipeline.
def demosaicing(raw):
img16 = raw.view(dtype=np.uint16).reshape(1080,1920)
rgb8 = cv2.normalize(img16, dst=None, alpha=0, beta=255, norm_type=cv2.NORM_MINMAX).astype(np.uint8)
rgb8 = cv2.demosaicing(rgb8, cv2.COLOR_BayerGB2BGR)
rgb8_downsized = cv2.resize(rgb8, (0,0),fx=0.5, fy=0.5, interpolation=cv2.INTER_AREA)
return rgb8_downsized
camera = cv2.VideoCapture(2)
camera.set(cv2.CAP_PROP_CONVERT_RGB, False)
while True:
ok,raw = camera.read()
if not(ok):
break
bgr = demosaicing(raw)
key = cv2.waitKey(25)
cv2.imshow('frame', bgr)
if key == 27:
break
Question is how can I get raw data with the Jetson-utils or gstreamer?