Vuforia SDK Version: 5.5.9 -Hi, If I understand correctly the function "configureVideoBackground" is supposed to do a ratio-stretch, that is, figuring out the maximum size that the camera feed will fit on screen while retaining its original aspect ratio.If this is indeed the goal of this function, then it appears to be broken for cases where the aspect ratio of the screen is superior (more landscapey) than the camera feed. For example on ODG R-7 the screen can be 1280x720 while the camera returns something like 672x380. Both are landscape, but the screen has an even greater aspect ratio than the camera. In this case the function sets the video background to 1280x723. This is larger than the screen. If the screen is 2560x720, the function sets the background to 2560x1447. I'm using the following replacement function which I think is more correct and simpler.
float screenAspectRatio = displaySize.x / (float)displaySize.y;
float cameraAspectRatio = vm.getWidth() / (float)vm.getHeight();
if (cameraAspectRatio < screenAspectRatio)
{
ySize = displaySize.y;
xSize = (int)(ySize * cameraAspectRatio);
}
else
{
xSize = displaySize.x;
ySize = (int)(xSize / cameraAspectRatio);
}
This gives me the expected 1273x720. -Development OS (Mac OS X, Windows, Linux): Linux -Mobile OS and Version: Android 4.4.2 -Mobile Device Manufacturer and Model name: ODG R7-W -Do the Vuforia Sample Applications show the same behavior?: Yes.
Yes, the function I posted does ratio-stretch, so you get black bands on the side or above and below, but the entire camera feed is seen and at the correct aspect ratio.
Isn't it more desirable to see the entire camera feed rather than only part of it, even if it's at the expense of black bands?