THORLABS DCU223x Operation Manual And Sdk page 426

Cdd and cmos cameras
Hide thumbs Also See for DCU223x:
Table of Contents

Advertisement

DCx Cameras
Example
Conversion of a raw Bayer image to RGB24. The memory is allocated automatically.
INT nRet;
char
* pcSource;
INT nIDSource;
INT nX,nY,nBits,nPitch;
// Create raw Bayer test image
is_AllocImageMem
(hCam, 256, 256, 8, &pcSource, &nIDSource);
is_InquireImageMem
(hCam, pcSource, nIDSource, &nX ,&nY, &nBits, &nPitch);
for (int
j = 0; j<nY; j++)
{
for (int
i = 0; i<nX; i++)
{
pcSource[i + j * nPitch] = i;
}
}
// Define conversion parameters (example)
INT Gamma = 120;
double
rgbGains[3];
rgbGains[0] = 1.0 ;
// Red channel gain
rgbGains[1] = 3.0 ;
// Green channel gain
rgbGains[2] = 1.0 ;
// Blue channel gain
char* pcDest;
// Pointer to the newly allocated image memory
INT nIDDest;
// ID of the newly allocated image memory
// Set conversion parameters
nRet = is_SetConvertParam(hCam, TRUE, IS_SET_BAYER_CV_BETTER, IS_CM_RGB8_PACKED, Gamma, rgbGains);
// Convert image
if
(nRet == IS_SUCCESS)
{
pcDest = NULL;
is_ConvertImage(hCam, pcSource, nIDSource, &pcDest, &nIDDest, 0);
}
// Release allocated image memory
is_FreeImageMem
(hCam, pcSource, nIDSource);
is_FreeImageMem
(hCam, pcDest, nIDDest);
424
© 2013 Thorlabs GmbH

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Dcu224xDcc1240xDcc1545mDcc1645c

Table of Contents