从vision api预览条形码扫描器的大小 [英] Preview size for barcode scanner from vision api

查看:197
本文介绍了从vision api预览条形码扫描器的大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用Google的Android Vision API中的条形码阅读器示例。
预览尺寸似乎并未填满整个可用空间(我使用的是Nexus 4,预览右侧有一个白色未使用的空间,约为宽度的1/3)。 p>

我希望能够在各种设备上运行此示例,并始终填充整个可用空间。



所以我一直在玩的是:

  CameraSource.Builder builder = new CameraSource.Builder(getApplicationContext(),barcodeDetector).setFacing(CameraSource.CAMERA_FACING_BACK).setRequestedPreviewSize(?,?)。setRequestedFps(15.0f); 

有什么想法?

谢谢! / p>

解决方案

您可以看看这个主题: https://github.com/googlesamples/android-vision/issues/23


I'm using the barcode-reader example from Google's Android Vision API. The preview size doesn't seem to fill up the whole space available (I'm using a Nexus 4 and there is a white unused space to the right of preview, about 1/3 of the width).

I would like to be able to run this example on various devices and always have it fill up the whole space available.

So the bit I've been playing with is:

CameraSource.Builder builder = new CameraSource.Builder(getApplicationContext(), barcodeDetector).setFacing(CameraSource.CAMERA_FACING_BACK).setRequestedPreviewSize(?, ?).setRequestedFps(15.0f);

Any ideas?

Thanks!

解决方案

You might take a look at this thread: https://github.com/googlesamples/android-vision/issues/23

这篇关于从vision api预览条形码扫描器的大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆