Welcome to our community

Be a part of something great, join today!

  • Hey all, just changed over the backend after 15 years I figured time to give it a bit of an update, its probably gonna be a bit weird for most of you and i am sure there is a few bugs to work out but it should kinda work the same as before... hopefully :)

Bayer Filter

DS Williams

Well-known member
Joined
Mar 4, 2009
Messages
80
Reaction score
0
Points
0
I would love for someone to please explain to me just exactly how a Bayer Filter works.

The system itself has been of great confusion to be, as many blame the Red for not being "true 4k" because of said filter.

I have never truly understood that. The RED looks extremely sharp to me.

How does a Bayer filter take 4k of luminance samples and provide each one with chroma information as well, when each one is filtered for a different primary color?


I understand that there are 2 green sensitive photosites for every red and blue sensitive one, and this is due to the humans hightened perception to green.

What exactly happens, in laymens terms, when you De-mosaic or De-Bayer the RAW data?
 
Resolution vs. pixels

Resolution vs. pixels

What exactly happens, in laymens terms, when you De-mosaic or De-Bayer the RAW data?

Each line in the Bayer filter has a red and green filter or a blue and green filter.

But the filters are not strong and only filter out about 25% to 50% of the red, green, or blue light.

So you get a strong monochrome signal from all the pixels. The Luma is taken from mostly the green pixels and a little from the red and blue pixels.

Because the pixels are interpolated before being combined for the Luma you get some image details that are close to what you would get in a monochrome camera with the same number of pixels.

The main problem is getting clean chroma information since when you matrix the colors out since the signal is weak because the filters are weak you get a high noise level in individual pixels, to overcome that the chroma is averaged using the nearby pixels.

If the lens is sharp enough to just shine an image detail on one pixel than you can get false chroma for a small group of pixels since in order to get white balance a group of 4 pixels must see the same color light, no mater what color that may be. To overcome this chroma moire problem a OLPF filter is used to blur the light going to the sensor so that groups of four pixles, one red, one blue, and two green see more or less the same brightness and color of light.

As part of the de-Bayer - de-Moasic process the image is sharpened to counter balance the blur from the interpolation and the OLPF filter, this sharpen adds noise, chroma moire, aliasing, and so some low pass filtering is also needed to keep those issues low enough while at the same time letting enough sharpen take place to get a resolution reading that is close to the monochrome sensor value.

The Bayer sensor is just a monochrome sensor with a set of color filters over it.

In some cases like with Quad-HD sensors, you do not "need" to de-moasic if you just output 1/4 size images that is Quad-HD to HD since in that case you just pick a group of four pixels and use that to find the color of one output pixel. That is much faster than doing a full de-Moasic, but can show more aliasing and other artifacts then if you do a full de-moasic then down-size using 100% of the processed pixel data.

Things may get a little more complex in the RED ONE since the raw sensor data may be converted to color plane images that are compressed using wavelet compression, so in the de-Moasic process you might need to resize the color planes and blur the wavelet artifacts as well as do the other steps that would be used on true raw data, it seems.

The resolution comes from all the pixels, the green pixels see details in the red and blue subjects and so forth, so you cannot say that the red and blue resolution is in fact as low as the 1/4 pixel count would lead you to think, but the chroma resolution is not equal to the luma information, so the end result is not quite the same as a RGB camera using 3 chips, but at 4K it would be hard to register a 3 chip camera, so in the end the Bayer filter images are about what you can get with any camera and cost less since it is just one chip.
 
Back
Top