Bayer output for OV7725

Hi Guys
Whats the difference between the Bayer RAW and Bayer processed RAW on the OV7725 sensor? For getting a 640x480 image, you guys mentioned in a previous discussion that because the SRAM is too small to store the RGB, you use the Bayer RAW output from the sensor and then de-bayer it.
So have a bunch of questions here

  1. So do you work with Bayer RAW or processed Bayer RAW?
  2. Is de-bayer the same as demosiac’ing?
  3. How many FPS would be possible if we did this is the F7 processor, if the final goal is to store a jpeg image in the SD card?
  4. What c file do you guys have your de-bayer code in?

I would appreciate any feedback :slight_smile:

  1. So do you work with Bayer RAW or processed Bayer RAW?

Processed Bayer

  1. Is de-bayer the same as demosiac’ing?

Yes Demosaicing - Wikipedia

  1. How many FPS would be possible if we did this is the F7 processor, if the final goal is to store a jpeg image in the SD card?

Debayer, compress and write to SD VGA frames will be slow, definitely less than 10FPS

  1. What c file do you guys have your de-bayer code in?

omv/img/imlib.c

Thank a ton for the quick reply! :slight_smile:

Hi Ibrahim
Quick follow up question. Do you have a link for the algorithm you use for the conversion of Bayer to RGB/YUV image? Im trying to learn the theory of the conversion and then work with the code. Right now the code is a bit overwhelming for me.
-Thanks

Yeah: https://github.com/openmv/openmv/blob/master/src/omv/img/imlib.h#L309

wow! holy cow! thanks for the lightning fast reply!!!

have a follow up question here. When we de-mosiac a 640x480 bayer image (size of 307KB) to RGB565 or RGB888 or YUV, its size would increase to more than 512KB (size of SRAM). So I feel it does not seem to be possible to do this de-mosiacing within the F7 itself. Am I wrong here.
How do you guys do it? Or do you just transfer the raw image over USB to the computer and perform the processing in your openMV software?

We turn it into a jpg image while doing the operation. So, the full image never is stored in RAM.

hmmm… so you guys are going from raw bayer to jpg directly? When you de-mosiac, you are adding the all three RGB values to each pixel. So 24bit/pixel

So are you just converting each 8x8 macro blocks to jpeg before moving on to the next macro block? Am I in the right direction here?

Yup, that’s exactly what we are doing.