Log in or register to post comments

Camera feed matching native feed

October 12, 2015 - 3:22am #1
CameraDevice.Instance.SetFocusMode(CameraDevice.FocusMode.FOCUS_MODE_CONTINUOUSAUTO);
CameraDevice.VideoModeData vm = CameraDevice.Instance.GetVideoMode(CameraDevice.CameraDeviceMode.MODE_OPTIMIZE_QUALITY);
QCARRenderer.VideoBGCfgData vbc = new QCARRenderer.VideoBGCfgData();
vbc.enabled = 1;
vbc.synchronous = 1;
vbc.position = new QCARRenderer.Vec2I(0,0);
int xSize = 0, ySize = 0;
int mScreenWidth = Screen.width;
int mScreenHeight = Screen.height;
xSize = (int) (vm.height * (mScreenWidth / (float) vm.width));
ySize = mScreenHeight;
		
if (xSize < mScreenWidth)
{
	xSize = mScreenWidth;
	ySize = (int) (mScreenWidth * (vm.width / (float) vm.height));
}
vbc.size = new QCARRenderer.Vec2I(xSize, ySize);
QCARRenderer.Instance.SetVideoBackgroundConfig(vbc);

 

Using the native iOS camera app, you can see that the Photo feed is larger than the Video feed. The Video is a cropped version of the Photo (Photo also adds UI on top and bottom).

With the code above, on iPhone, I can get Vuforia camera feed to match the Photo feed, so I have a larger FOV. But the same code does not do the same on iPad. I get larger than the Video feed but smaller than the Photo feed. Actually, I get a match with TimeLapse settings.

Is there a way to make the Vuforia camera to match the largest feed? Am I using the code above wrong (tho it works for iPhone)? Is iPad having extra restriction that cannot be passed?

Camera feed matching native feed

October 12, 2015 - 5:16pm #2

The Vuforia video background camera feed dimensions are independent of the native pixel dimensions of the device. Vuforia supports up to 720p (1280x720) on mobile devices which have HD resolution and a quad-core GPU. If the screen aspect ratios between the background feed and native device differ, the video background feed will be zoomed in to fill the screen.

Log in or register to post comments