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) ...
-
c = no interpolation, take the center of the neighborhood (CenterInterpolator)
-
s = interpolate points at four main directions (StraightInterpolator)
-
d = interpolate points at four diagonals (DiagonalInterpolator)
-
v = interpolate two points vertically (VerticalInterpolator)
-
h = interpolate two points horizontally (HorizontalInterpolator)
Add a note
Not a single note added yet. Be the first, add yours.