RGB565 to RGB888?

Discussion related to "under the hood" OpenMV topics.
type11969
Posts: 30
Joined: Tue Aug 14, 2018 1:03 pm

RGB565 to RGB888?

Postby type11969 » Tue Aug 28, 2018 9:54 pm

Greetings, question regarding color resolution. The sensor is RGB565, but the graphical stats provided in the IDE are RGB888. How are these RGB888 numbers calculated? How is that extra 8b of information estimated? If there is a good article discussing this, please send it my way.

Related question, I see that get_stats() reports in terms of LAB, is there a way to (easily) get the same information direct in RGB? Or do I need to use the LAB to RGB888 conversion function for each statistic of interest? Of course the same question as above applies.

Last question, has a 24b color sensor been tested on any of the openmv platforms?

Thanks for the help!

-Chris
User avatar
kwagyeman
Posts: 2462
Joined: Sun May 24, 2015 2:10 pm

Re: RGB565 to RGB888?

Postby kwagyeman » Tue Aug 28, 2018 10:24 pm

Hi, our color conversion stuff is lacking.

Anyway, the conversation is done using a LUT. See the util scripts in the OpenMV GitHub for the code that generates the LUTs. It's on the top level of the OpenMV GitHub repo under util scripts.
Nyamekye,
type11969
Posts: 30
Joined: Tue Aug 14, 2018 1:03 pm

Re: RGB565 to RGB888?

Postby type11969 » Wed Aug 29, 2018 8:29 am

Thanks. If I use the get_pixel() command with a bayer format, is a 10b value returned? My understanding is that the sensor has 10ADCs per pixel, but after interpolation, RGB565 results.

Ultimately I don't care too much about absolute color conversion - I'll be using a LUT developed from known colors imaged with the OpenMV platform - but I want to be sure that I get the most resolution possible, and that any conversions (to LAB or otherwise) aren't adding noise.

Do you know if a 24b color sensor has ever been tested using the openmv platform?
User avatar
kwagyeman
Posts: 2462
Joined: Sun May 24, 2015 2:10 pm

Re: RGB565 to RGB888?

Postby kwagyeman » Wed Aug 29, 2018 11:36 am

If you want 10b per pixel RAW you'll need to mess with the cameras register settings. It can output that. However, once you do this the byte size of the image will be different from what our code expects so you'll need to modify the C code.

Um, the OmniVision cameras don't output 24 bits per pixel for RGB. The only way to get that is to work on the RAW Bayer image. The normal Bayer output we support is 8 bits per pixel.
Nyamekye,
User avatar
iabdalkader
Posts: 629
Joined: Sun May 24, 2015 3:53 pm

Re: RGB565 to RGB888?

Postby iabdalkader » Wed Aug 29, 2018 11:50 am

type11969 wrote:
Wed Aug 29, 2018 8:29 am
Thanks. If I use the get_pixel() command with a bayer format, is a 10b value returned?
No you get 8 bits per pixel (R, G or B depending on the pixel position and the CFA).
type11969 wrote:
Wed Aug 29, 2018 8:29 am
Do you know if a 24b color sensor has ever been tested using the openmv platform?
Not as far as we know.
type11969
Posts: 30
Joined: Tue Aug 14, 2018 1:03 pm

Re: RGB565 to RGB888?

Postby type11969 » Wed Aug 29, 2018 11:56 am

Thanks guys

Return to “Technical Discussion”

Who is online

Users browsing this forum: pcls1026 and 8 guests