Cannot set 1280x1024 resolution using Asus Xtion Pro Live. (Bug #1412)
Description
When trying to set the resolution of the color imager to 1280x1024 using the CV_CAP_OPENNI_SXGA_15HZ parameter the call will fail with XN_STATUS_BAD_PARAM. This is due to the fact that the Xtion does not support a 15Hz frame rate at 1280x1024 only a 30Hz frame rate.
Associated revisions
Merge pull request #1412 from jet47:gpu-match-template-nocuda
History
Updated by Gustav Karlsson over 13 years ago
I would attach patch files but my previous fixes are not part of the repository yet.
The changes below in italics allow you to set the 1280x1025x30 resolution.
highgui_c.h
// Supported output modes of OpenNI image generator
enum
{
CV_CAP_OPENNI_VGA_30HZ = 0,
CV_CAP_OPENNI_SXGA_15HZ = 1,
CV_CAP_OPENNI_SXGA_30HZ = 2
};
cap_openni.cpp
switch( cvRound(propValue) )
{
case CV_CAP_OPENNI_VGA_30HZ :
newImageOutputMode.nXRes = XN_VGA_X_RES;
newImageOutputMode.nYRes = XN_VGA_Y_RES;
newImageOutputMode.nFPS = 30;
break;
case CV_CAP_OPENNI_SXGA_15HZ :
newImageOutputMode.nXRes = XN_SXGA_X_RES;
newImageOutputMode.nYRes = XN_SXGA_Y_RES;
newImageOutputMode.nFPS = 15;
break;
case CV_CAP_OPENNI_SXGA_30HZ :
newImageOutputMode.nXRes = XN_SXGA_X_RES;
newImageOutputMode.nYRes = XN_SXGA_Y_RES;
newImageOutputMode.nFPS = 30;
break;
default :
CV_Error( CV_StsBadArg, "Unsupported image generator output mode.\n");
}
Updated by Alexander Shishkov almost 14 years ago
Many thanks to the Patch! It was applied in r7478.
- Status changed from Open to Done
- Target version set to 2.4.0
Updated by Andrey Kamaev over 12 years ago
- Category changed from highgui-images to highgui-camera