EasyManua.ls Logo

THORLABS DCC1645C - Page 426

THORLABS DCC1645C
530 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
© 2013 Thorlabs GmbH424
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);

Table of Contents

Other manuals for THORLABS DCC1645C

Related product manuals