Hi Bene,
Thank you for your answer!
I managed to get it working in the meantime and it all makes sense
now, let me explain:
I found in the driver this series of checks in the file "Source/
XnDeviceSensorV2/XnSensorImageStream.cpp" around line 180:
-------------------------
// check output format
if (nOutputFormat == XN_OUTPUT_FORMAT_GRAYSCALE8 && nInputFormat !=
XN_IO_IMAGE_FORMAT_BAYER)
{
XN_LOG_WARNING_RETURN(XN_STATUS_DEVICE_BAD_PARAM,
XN_MASK_DEVICE_SENSOR, "Grayscale8 output requires BAYER input!");
}
else if (nOutputFormat == XN_OUTPUT_FORMAT_YUV422 && nInputFormat !=
XN_IO_IMAGE_FORMAT_YUV422 && nInputFormat !=
XN_IO_IMAGE_FORMAT_UNCOMPRESSED_YUV422)
{
XN_LOG_WARNING_RETURN(XN_STATUS_DEVICE_BAD_PARAM,
XN_MASK_DEVICE_SENSOR, "YUV output requires YUV input!");
}
// check input format
if (nInputFormat == XN_IO_IMAGE_FORMAT_BAYER && nResolution !=
XN_RESOLUTION_UXGA && nResolution != XN_RESOLUTION_SXGA)
{
XN_LOG_WARNING_RETURN(XN_STATUS_DEVICE_BAD_PARAM,
XN_MASK_DEVICE_SENSOR, "BAYER input requires SXGA/UXGA resolution!");
}
else if (nInputFormat == XN_IO_IMAGE_FORMAT_JPEG && nOutputFormat !=
XN_OUTPUT_FORMAT_RGB24)
{
XN_LOG_WARNING_RETURN(XN_STATUS_DEVICE_BAD_PARAM,
XN_MASK_DEVICE_SENSOR, "Jpeg input is only supported for RGB24
output!");
}
-------------------------
Those were probably meant for Primesense's devices and do not
correspond to the possibilites of the Kinect device, as Avins' removal
of the resolution check can attest. I commented them out and
recompiled the driver, then I it worked (in 640x480 at 30 fps).
Apparently, by setting the color camera to
XN_PIXEL_FORMAT_GRAYSCALE_16_BIT in the initialization phase you were
able to bypass the security checks and then switch to
XN_PIXEL_FORMAT_GRAYSCALE_8_BIT later. A clever trick ;-)
I still have an annoying speed issue, as if the de-bayered image was
updated only every 4 frames or so... I'll try to fix that as well.
Cheers,
Raphael