Into

Modules

Documentation

classPiiCamera::BayerDecoder

#include <PiiBayerConverter.h>

A structure used for handling different Bayer encoding schemes with bayerToRgb().

Description

Normally, the Bayer pattern is like this (RGGB):

RGRGRGRG
GBGBGBGB
RGRGRGRG
GBGBGBGB

The name of the pattern is composed of the names of color channels forming a 2-by-2 square of pixels. For example, GRBG means that the pixel at (0,0) is the green color channel and the pixel to its right red. The first pixel on the second row is blue, and the pixel to its right is green again.

Let us take the second pixel on the second row (B) as an example. The value for the red color channel is obtained by calculating the average of the diagonal neighbor pixels. The value for the green channel is the average of the other four neighbors, and B needs no interpolation. That's what (d,s,c) in the following comes from.

The sequence of (r,g,b) triplets goes like this:

(c,s,d),(h,c,v),(c,s,d),(h,c,v) ... (v,c,h),(d,s,c),(v,c,h),(d,s,c) ... (c,s,d),(h,c,v),(c,s,d),(h,c,v) ...

The encoder structure is composed of interpolators for three color channels in a 2-by-2 neighborhood. Thus, there must be 3*4=12 interpolators in total. Each interpolator handles one of the possible interpolation options (no interpolation, diagonal neighbors, straight neighbors, vertical neighbors, or horizontal neighbors).
Notes (0)

Add a note

Not a single note added yet. Be the first, add yours.