CX3 OV5647 RAW10 data display

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
ScGr_289066
Level 5
Level 5
100 replies posted 50 replies posted 25 replies posted

Hi All,

I'm having a couple of issues this is the second thread to discuss them.

In this thread I will discuss displaying RAW10 data from an OV5647 sensor in 10-bit mode.

We have successfully configured the CX3 to transport RAW10 data from an OV5647 sensor so it is viewable by e-camView and OpenCV applications.  As several posts on this forum suggested, we did this by tricking the CX3 into believing it is receiving YUY2 data from the 5647 sensor, which can only produce RAW10 data, and sending it to the PC applications.  As noted in the posts, the data isn't displayed correctly because the PC also believes it is in YUY2 format, so the images are generally without much detail and green.

Today I created an OpenCV application that reads image data and does a simple memory dump so I could make sense of its format to figure out how to properly convert it to a known, preferably RGB, format.  The results so far have been confusing.  First let me say that I have configured the sensor to generate its bar test pattern (8 vertical bars across the width of the screen or varying colors.

When I examine the data collected by OpenCV, I don't see a stream of 16-bit values but instead I see repeating groups of 3-bytes (24-bit) values.  Each 1920x1080 (1080p) frame contains 3-bytes per pixel (6,220,800 bytes/frame).  Since the test pattern is saturated bars and the middle byte of each group is 255, I figured the data was coming across in UYV or VYU format, so I tried the standard conversion B=1.164*(y-16)+2.018(u-128); G=1.164*(y-16)-0.813*(v-128)-0.391*(u-128) and R=1.164*(y-16)+1.596*(v-128).  However this conversion doesn't give me the colors that match the sensor's test pattern (or even close).

As I understand the 5647's RAW10 output, I am expecting 16-bits of Bayer patterned pixels:

B G B G B G...

G R G R G R...

B G B G B G...

...

G R G R G R ...

Why is the input data in 24-bit format rather than 16-bit as I have specified in the CX3 configuration?  Is the PC driver further jumbling the data it receives from the CX3 or is something else happening?

Thanks,

Scott

0 Likes
8 Replies