-
Notifications
You must be signed in to change notification settings - Fork 25
Closed
Labels
type: enhancementProposed improvementProposed improvement
Description
Many machine learning programs expect RGB888 image format, wondering if a function that does that could be included in this library
I am loading my images to EdgeImpulse and using this conversion
void r565_to_rgb(uint16_t color, uint8_t *r, uint8_t *g, uint8_t *b) {
*r = (color & 0xF800) >> 8;
*g = (color & 0x07E0) >> 3;
*b = (color & 0x1F) << 3;
}
I get an image like this. Note the image has already been cropped to 48x48 so the it will look grainy.
which becomes slightly better with this conversion
void r565_to_rgb(uint16_t color, uint8_t *r, uint8_t *g, uint8_t *b) {
*r = ((((color >> 3) & 0x1F) * 527) + 23) >> 6;
*g = ((((((color & 0xE0) >> 5) | ((color & 0x03) << 3)) & 0x3F) * 259) + 33) >> 6;
*b = (((color & 0x1F) * 527) + 23) >> 6;
}
Any suggestions on how to better convert the OV7670 RGB565 output?
Metadata
Metadata
Assignees
Labels
type: enhancementProposed improvementProposed improvement