You are here : matlabImage Processingdemosaic

demosaic() - Image Processing

RGB = demosaic(I,sensorAlignment) converts
the Bayer pattern encoded image, I, to the truecolor
image, RGB, using gradient-corrected linear interpolation. sensorAlignment specifies
the Bayer pattern.A Bayer filter mosaic, or color filter array, refers to the
arrangement of color filters that let each sensor in a single-sensor
digital camera record only red, green, or blue data. The patterns
emphasize the number of green sensors to mimic the human eye's greater
sensitivity to green light. The demosaic function
uses interpolation to convert the two-dimensional Bayer-encoded image
into the truecolor image.Code Generation support:
Yes.MATLAB Function Block support:
Yes.


Syntax

RGB = demosaic(I,sensorAlignment) example


Example

Convert a Bayer Pattern Encoded Image To an RGB ImageOpen This ExampleConvert a Bayer pattern encoded image that was photographed by a camera with a sensor alignment of 'bggr' .I = imread('mandi.tif');
J = demosaic(I,'bggr');
imshow(I);
figure, imshow(J);


Output / Return Value


Limitations


Alternatives / See Also


Reference