User`s guide
FUNCTIONS
SDK SECTION 11
Page 94
DemosaicImage
unsigned int WINAPI DemosaicImage(WORD* grey, WORD* red, WORD* green, WORD* blue,
ColorDemosaicInfo* info)
Description For colour sensors only
Demosaics an image taken with a CYMG CCD into RGB using the parameters stored in
info. Below is the ColorDemosaicInfo structure definition and a description of its
members:
typedef struct COLORDEMOSAICINFO {
int iX; // Number of X pixels. Must be >2.
int iY; // Number of Y pixels. Must be >2.
int iAlgorithm; // Algorithm to demosaic image.
int iXPhase; // First pixel in data (Cyan or Yellow/Magenta or Green).
int iYPhase; // First pixel in data (Cyan or Yellow/Magenta or Green).
int iBackground; // Background to remove from raw data when demosaicing.
} ColorDemosaicInfo;
• iX and iY are the image dimensions. The number of elements in the input red,
green and blue arrays is iX x iY.
• iAlgorithm sets the algorithm to use: 0 for a 2x2 matrix demosaic algorithm or 1
for a 3x3 one.
The CYMG CCD pattern can be broken into cells of 2x4 pixels, e.g.:
• iXPhase and iYPhase store what colour is the bottom-left pixel.
• iBackground sets the numerical value to be removed from every pixel in the
input image before demosaicing is done.
Parameters
WORD* grey: pointer to image to demosaic
WORD* red: pointer to the red plane storage allocated by the user.
WORD* green: pointer to the green plane storage allocated by the user.
WORD* blue: pointer to the blue plane storage allocated by the user.
ColorDemosaicInfo* info: pointer to demosaic information structure.
Return
unsigned int
DRV_SUCCESS
DRV_P1INVALID
DRV_P2INVALID
DRV_P3INVALID
DRV_P4INVALID
DRV_P5INVALID
Image demosaiced
Invalid pointer (i.e. NULL).
Invalid pointer (i.e. NULL).
Invalid pointer (i.e. NULL).
Invalid pointer (i.e. NULL).
One or more parameters in info is out of range
See also
GetMostRecentColorImage16, WhiteBalance