static appdata app;
+enum {
+ STEREO_FORMAT_NONE = 0,
+ STEREO_FORMAT_SIDE_BY_SIDE,
+ STEREO_FORMAT_TOP_AND_BOTTOM
+};
+
// MediaVision
mv_engine_config_h engine_config;
// Vision source handle
static bool isAsync;
static int camWidth;
static int camHeight;
+static int stereoFormat;
static int minDisp;
static int maxDisp;
static int display_xpos;
display_ypos = atoi(argv[5]);
camWidth = atoi(argv[6]);
camHeight = atoi(argv[7]);
- stereoConfigFile = argv[8];
- dispResultFile = argv[9];
- isRemote = (atoi(argv[10])!=0);
- if (isRemote) remoteUrl = argv[11];
+ stereoFormat = atoi(argv[8]);
+ stereoConfigFile = argv[9];
+ dispResultFile = argv[10];
+ isRemote = (atoi(argv[11])!=0);
+ if (isRemote) remoteUrl = argv[12];
}
#ifdef MV_3D_POINTCLOUD_IS_AVAILABLE
utility::SetVerbosityLevel(utility::VerbosityLevel::Debug);
vision_source_format_s format {
.pixel_format = VISION_SOURCE_PIXEL_FORMAT_NV12,
- .resolution = { camWidth << 1, camHeight },
+ .resolution = { camWidth, camHeight },
.fps = 10,
.quality = 0,
.bitrate = 0
};
+ switch (stereoFormat) {
+ case STEREO_FORMAT_SIDE_BY_SIDE:
+ format.resolution.width <<= 1;
+ break;
+ case STEREO_FORMAT_TOP_AND_BOTTOM:
+ format.resolution.height <<= 1;
+ break;
+ default:
+ break;
+ }
+
// mediavision
// engine_config
ret = mv_create_engine_config(&engine_config);
goto _err;
}
- app.imgWidth = camWidth << 1;
- app.imgHeight = camHeight;
+ app.imgWidth = format.resolution.width;
+ app.imgHeight = format.resolution.height;
app.stopWatch.resetTime();
try {
app.buffer = new unsigned char [app.imgWidth * app.imgHeight];