


Determine the CFA positions of an image sensor
[CFAletters,CFAnumbers,mp] = sensorDetermineCFA(ISA)
The CFA positions are calculated from the image sensors array (ISA) information.
CFAletters specifies the pixel colors as a character array
CFAnumbers specifies the pixel colors as a numerical (integer) array.
mp specifies the color map associated with the color pixels.
These values are determined from the color order field in the sensor,
which is in turn determined by the filterNames and the pattern fields
in the cfa field.
The set of valid letter names for color filters (and their numerical
order) is set in the function sensorColorOrder. At the time of this
writing, this function returns the cell array:
{'r' 'g' 'b' 'c' 'y' 'm' 'w' 'x' 'y' 'z' 'o'}
The CFAnumbers would contain the value 4 at all positions with a cyan
(c) filter. The filters in every ISA must have distinct first
letters.
Examples:
[cfa,cfaN] = sensorDetermineCFA(ISA);
[cfa,cfaN,mp] = sensorDetermineCFA; image(cfaN); colormap(mp);
Programming notes:
The color filter names and CFAletters mainly serve as a hint to the
color appearance. The CFAnumbers numbers refer to the column in the
ISA.color.filterSpectra. The coded uses both letters and numbers to
define each of these filters to guide the plots and sensor image
representations. But there are really 3 different functions corresponding
to filterNames, filterSpectra, filterColorHint. We use filterNames as
filterColorHints also, and this makes things more confusing than they
should be.
Copyright ImagEval Consultants, LLC, 2005.