0

I have worked this problem for some days now, checked multiple programs and libraries, to no avail. I work on a Windows 10 x64 PC. Heads up: this problem seems to have been solved by someone on a Linux distro, and my colleague is looking into that, but so far without success.

I have a video camera with a 12-bit RCCB sensor. Attached to it is a de-serializer, which has USB output that is plugged into my computer. The hardware supplier also gave access to some software for showing the camera output. However, the data is wrapped to YUY2 (aka YUV422) (as far as I understand, without doing anything else to it; it is still the mosaiced 12-bit RCCB camera frame). The frame consequently is interpreted as 12-bit YUY2 (i.e., 24 bits per 2 pixels) by the supplier's software, which leads to a green, mosaic image. Other programs also automatically apply the YUY2 decoding (after all, the camera tells them to), which, as far as I have analyzed, leads to irreversible loss of data.

The resulting image is not just monochrome appearing green, even if dear editor Scott inserted that here (sincere thanks for the editing work!). It has low red and blue components, but that is beyond the point. An example image is shown below:

example green image

My hypothesis about why data is lost is twofold: First of all the decoder expects a de-mosaiced RGGB image, which leads to an "overflow" in the green part (of an RGB representation of the YUV image), and secondly the programs get their information about the image size from the camera, where the sizes when de-mosaiced are entered. That fact, together with the fact that the original data has more bits/pixel than the output image has, leads me to believe in the loss of information.

Naturally, after failing to recreate the raw images from the green ones, I looked into ways to access the information before the YUY2 decoding is applied, but also without success. My attempts involved openCV, which I am familiar with, ffdshow, VLC, FWink and RawTherapee.

Currently I am looking into grabbing the USB data stream via libusb, but I have read multiple times that that will not be trivial either. So I am grateful for any information and suggestions concerning what else I could try.

If I have some hex or binary file output from the stream, with or without the YUY2 wrapper around it, that would be good enough for me; I can work with that.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.