I have used libdc1394 on Mac OS for several years, and recently started working with the Windows version (thanks, everyone, for this). I am working with an AVT Stingray F145B camera and trying to set the look up table (LUT) for implementing gamma. (These cameras do not support the IIDC gamma feature in the usual way.) I have found that any LUT I load through Windows appears odd—the captured images become very noisy. Even filling the LUT with a constant value does not produce a constant-valued image, so it appears the entire LUT is not written to. The same code behaves as expected on Mac OS, however.
Has anyone had any luck using AVT cameras with libdc1394 on Windows and dealing with the LUTs? Any help would be appreciated.
Windows 7 Professional 64-bit
CMU 1394 camera driver version 184.108.40.206
Libdc1394 version 2.2.0 compiled with MSVS 2008
AVT Stingray F145B camera
Here is a simple example of how I create LUT; the AVT LUTs map 12-bit input to 10-bit output, so here I’m just truncating values. The LUT size is 8192 bytes (4096 two-byte entries).
// create a LUT buffer and a way to access it in 16-bit increments
uint8_t* pbuffer8 = new uint8_t[lutSize];
uint16_t* pbuffer16 = (uint16_t*) pbuffer8;
// fill in values in the table
uint16_t lutIndex, lutValue;
for (lutIndex = 0; lutIndex < entryCount; lutIndex++)
// truncate to 10 bits
lutValue = lutIndex >> 2;
pbuffer16[lutIndex] = lutValue;
// copy LUT to camera through GPdata buffer;
// note that libdc takes care of writing in blocks
dc1394_avt_set_lut_mem_ctrl(this->m_pCamera, DC1394_TRUE, 0, 0);
dc1394_avt_write_gpdata(this->m_pCamera, pbuffer8, lutSize);
dc1394_avt_set_lut_mem_ctrl(this->m_pCamera, DC1394_FALSE, 0, 0);
dc1394_avt_set_lut(this->m_pCamera, DC1394_TRUE, 0);
// delete the buffer