Why I gave up on the OV2640's raw mode
The OV2640 has a “raw” RGB565 mode that skips its internal color correction. On paper it’s the fast path — no JPEG decode, fewer cycles. I tried it. The colors came out wrong in a way I couldn’t fix: a green cast in the reds, purple in the blues.
Back to JPEG
So I went back to JPEG capture at 24 MHz and decode to a BGR888 buffer in PSRAM.
camera_fb_t *fb = esp_camera_fb_get();
fmt2rgb888(fb->buf, fb->len, fb->format, bgr);
sample_into_led_bins(bgr, led_buf);
esp_camera_fb_return(fb);
It’s a little slower, but the decode runs while the next frame is being captured, and the JPEG path keeps the sensor’s color-correction matrix — which is a real pain to replicate by hand.
The lesson: if you’re tempted to skip the sensor’s correction “for speed,” check your colors first. A 30% slower pipeline that’s correct beats a fast one you’ll be hand-tuning forever.
Comments
Comments load via GitHub Discussions once Giscus is configured — see
.env.example and CUSTOMIZING.md.