added Asus Xtion QVGA modes to the OpenNI backend (patch #1753)

This commit is contained in:
Vadim Pisarevsky 2012-10-09 22:01:43 +04:00
parent 89de0bebd8
commit a09c88ab16
3 changed files with 34 additions and 11 deletions

View File

@ -475,22 +475,25 @@ enum
{
CV_CAP_OPENNI_VGA_30HZ = 0,
CV_CAP_OPENNI_SXGA_15HZ = 1,
CV_CAP_OPENNI_SXGA_30HZ = 2
CV_CAP_OPENNI_SXGA_30HZ = 2,
CV_CAP_OPENNI_QVGA_30HZ = 3,
CV_CAP_OPENNI_QVGA_60HZ = 4
};
//supported by Android camera output formats
enum
{
CV_CAP_ANDROID_COLOR_FRAME_BGR = 0, //BGR
CV_CAP_ANDROID_COLOR_FRAME = CV_CAP_ANDROID_COLOR_FRAME_BGR,
CV_CAP_ANDROID_GREY_FRAME = 1, //Y
CV_CAP_ANDROID_COLOR_FRAME_RGB = 2,
CV_CAP_ANDROID_COLOR_FRAME_BGRA = 3,
CV_CAP_ANDROID_COLOR_FRAME_RGBA = 4
CV_CAP_ANDROID_COLOR_FRAME_BGR = 0, //BGR
CV_CAP_ANDROID_COLOR_FRAME = CV_CAP_ANDROID_COLOR_FRAME_BGR,
CV_CAP_ANDROID_GREY_FRAME = 1, //Y
CV_CAP_ANDROID_COLOR_FRAME_RGB = 2,
CV_CAP_ANDROID_COLOR_FRAME_BGRA = 3,
CV_CAP_ANDROID_COLOR_FRAME_RGBA = 4
};
// supported Android camera flash modes
enum {
enum
{
CV_CAP_ANDROID_FLASH_MODE_AUTO = 0,
CV_CAP_ANDROID_FLASH_MODE_OFF,
CV_CAP_ANDROID_FLASH_MODE_ON,
@ -499,7 +502,8 @@ enum {
};
// supported Android camera focus modes
enum {
enum
{
CV_CAP_ANDROID_FOCUS_MODE_AUTO = 0,
CV_CAP_ANDROID_FOCUS_MODE_CONTINUOUS_VIDEO,
CV_CAP_ANDROID_FOCUS_MODE_EDOF,
@ -509,7 +513,8 @@ enum {
};
// supported Android camera white balance modes
enum {
enum
{
CV_CAP_ANDROID_WHITE_BALANCE_AUTO = 0,
CV_CAP_ANDROID_WHITE_BALANCE_CLOUDY_DAYLIGHT,
CV_CAP_ANDROID_WHITE_BALANCE_DAYLIGHT,
@ -521,7 +526,8 @@ enum {
};
// supported Android camera antibanding modes
enum {
enum
{
CV_CAP_ANDROID_ANTIBANDING_50HZ = 0,
CV_CAP_ANDROID_ANTIBANDING_60HZ,
CV_CAP_ANDROID_ANTIBANDING_AUTO,

View File

@ -1112,6 +1112,16 @@ bool CvCapture_OpenNI::setImageGeneratorProperty( int propIdx, double propValue
mode.nYRes = XN_SXGA_Y_RES;
mode.nFPS = 30;
break;
case CV_CAP_OPENNI_QVGA_30HZ :
mode.nXRes = XN_QVGA_X_RES;
mode.nYRes = XN_QVGA_Y_RES;
mode.nFPS = 30;
break;
case CV_CAP_OPENNI_QVGA_60HZ :
mode.nXRes = XN_QVGA_X_RES;
mode.nYRes = XN_QVGA_Y_RES;
mode.nFPS = 60;
break;
default :
CV_Error( CV_StsBadArg, "Unsupported image generator output mode.\n");
}

View File

@ -215,6 +215,13 @@ int main( int argc, char* argv[] )
case 2:
modeRes = capture.set( CV_CAP_OPENNI_IMAGE_GENERATOR_OUTPUT_MODE, CV_CAP_OPENNI_SXGA_30HZ );
break;
//The following modes are only supported by the Xtion Pro Live
case 3:
modeRes = capture.set( CV_CAP_OPENNI_IMAGE_GENERATOR_OUTPUT_MODE, CV_CAP_OPENNI_QVGA_30HZ );
break;
case 4:
modeRes = capture.set( CV_CAP_OPENNI_IMAGE_GENERATOR_OUTPUT_MODE, CV_CAP_OPENNI_QVGA_60HZ );
break;
default:
CV_Error( CV_StsBadArg, "Unsupported image mode property.\n");
}