This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Converting RAW10 to RGB888 and RGB888 to RAW10

Hi,

If we visit MIPI compliance CSI-2 specifications, we got to know that the raw10 frame will have 4 pixel 5 bytes. this means that the P1[9:2] will be the content for the first byte.
My question is what this pixel value(P1) represents. how we can have the rgb values with that 
Is the P1 here represents the Value of Blue color, P2 will be green, p3 with red something like that or this is different concept.
Also, is there any way to convert RGB back to RAW10. Please help. 
PFA the ss taken from raw10 packet image from MIPI Compliance CSi-2 specifications.   

  • I am checking to see what information I can find on this. 

    --Paul 

  • My question is what this pixel value(P1) represents. how we can have the rgb values with that 
    Is the P1 here represents the Value of Blue color, P2 will be green, p3 with red something like that or this is different concept.

    Px represents the 8-bit packet of image data.  

    The 4 10-bit color data is encoded into five 8-bit packets as shown in figure 97 above.   The first four packets contain the 8 msb of each, with the last packet containing the remaining 2 lsb of each.  The content of the four 10-bit values would be defined by the encoding of the image.

    From the spec:

    1136 The intent is that Raw image data is unprocessed image data for example Raw Bayer data or
    1137 complementary color data, but RAW image data is not limited to these data types.

    Also, is there any way to convert RGB back to RAW10. Please help. 

    Using the Imaging SubSystem? 

    --Paul 

  • Hi if we see the process of capturing the data. First, sensor array will capture every pixel data, since in filter array only one color information is there hence every pixel has only one color information after that it converts it into 10 bit value using normalization. Then image sensor will send this data (that is raw10).

    1)This is correct or not...?? So by raw10 data we just need to denormalize and demosaic the value to get rgb information..?

    2) Can we do reverse of that conversion...suppose if we have any rgb data packet we can convert it to raw10? If yes then how

    3) for raw10 data if we check the first packet and the fifth packet we can get pixel 1 information is this the normalized value of one color which was filtered using color filter array or some more calculations or changing it to Luminance value or something is required..
    Thanks and Regards

  • Hello Sarthak,

    Your questions have two aspects. One is related to MIPI CSI-2 spec, and Paul has answered that well. The other one is about digital imaging which actually doesn't belong to this forum, but I can provide a quick answer to your questions,

    1)This is correct or not...?? So by raw10 data we just need to denormalize and demosaic the value to get rgb information..?

    RAW10 means each pixel value from the sensor is in 10-bit. The pixels are arranged in a Bayer pattern and need to be demosaiced to produce RGB or YUV format. 

    2) Can we do reverse of that conversion...suppose if we have any rgb data packet we can convert it to raw10? If yes then how

    No.

    3) for raw10 data if we check the first packet and the fifth packet we can get pixel 1 information is this the normalized value of one color which was filtered using color filter array or some more calculations or changing it to Luminance value or something is required..

    This pixel 1 value should be the value of that pixel after color filter array. For example, if the Bayer pattern is RGGB, this pixel would be the red value, and next pixel would be green, and so on. Please refer to https://en.wikipedia.org/wiki/Bayer_filter

    Regards,

    Jianzhong

  • Hi, thank you so much for the information.
    I have only one question now. In the last question you answered Pixel 1 value is the value given by BGA array but BGA array will give some 8 bit value which will be the color information of suppose one color that is red. Then how this value is converted into 10 bit value. Any specific changes is done here or just the normalization.
    Regards 

  • To have better dynamic range, many modern cameras read from sensors at more than 8 bits, e.g. 10-bit, 12-bit, 16-bit, etc. For RAW10, the pixel value is represented in the complete 10 bits, and there is no need for conversion/normalization. The ISP will take care of the demosaicing properly.