标签: android-vision

在Android Vision API中切换到Camera2

我在android vision api中看到了(示例在这里:https://github.com/googlesamples/android-vision)相机(camera1)现已弃用,建议使用camera2.

你们有没有想过如何重新​​编写CameraSource以在android视觉上使用camera2?

提前致谢,

android android-vision

11
推荐指数
1
解决办法
2021
查看次数

如何在没有谷歌帐户的情况下安装条形码扫描库?

我想在不允许登录Google帐户的设备上安装google play服务的android-vision部分.传统上,android-vision库通过Play商店下载,作为Google Play服务的更新.

根据这个,包名称应该是com.google.android.gms.vision.barcode.我使用adb列出了我的rooted nexus设备上安装的所有软件包,这些软件包下载了条形码扫描库,并且软件包不在列表中.我希望自己拉包,然后分发它.

感谢您的时间和精力.

android barcode barcode-scanner google-play-services android-vision

11
推荐指数
1
解决办法
1609
查看次数

如何在TextureView和Camera中使用移动视觉API

我正在使用移动视觉API扫描条形码.我正在使用它TextureView来渲染相机.我看了这个github线程https://github.com/googlesamples/android-vision/issues/15看来移动视觉不兼容TextureView

我发现这CameraSourceSurfaceView与之不兼容的TextureView,因为没有预览帧的方法TextureView.https://developers.google.com/android/reference/com/google/android/gms/vision/CameraSource.html#start(android.view.SurfaceHolder)

我尝试使用以下方法并检查receiveDetections未被调用.有谁知道如何将移动视觉API与TextureView和集成Camera.

MainActivity.java

@RuntimePermissions
public class ScanBarcodeActivity extends BaseActivity {

    private TextureView textureView;

    private BarcodeDetector barcodeDetector;

    private Camera camera;

    private String TAG = LogUtils.makeLogTag(ScanBarcodeActivity.class);

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        ActivityScanBarcodeBinding activityScanBarcodeBinding = setContentView(this, R.layout.activity_scan_barcode);

        textureView = activityScanBarcodeBinding.textureView;

        barcodeDetector = new BarcodeDetector.Builder(this).build();

        ScanBarcodeActivityPermissionsDispatcher.requestCameraPermissionWithCheck(this);

    }

    @Override
    public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
        super.onRequestPermissionsResult(requestCode, permissions, …
Run Code Online (Sandbox Code Playgroud)

android android-textureview google-vision android-vision

11
推荐指数
1
解决办法
2508
查看次数

如何从灰度字节缓冲区图像创建位图?

我正在尝试使用新的Android脸部检测移动视觉API来处理帧图像.

所以我创建了自定义检测器以获取Frame并尝试调用getBitmap()方法,但它为null,因此我访问了帧的灰度数据.有没有办法从它创建位图或类似的图像持有者类?

public class CustomFaceDetector extends Detector<Face> {
private Detector<Face> mDelegate;

public CustomFaceDetector(Detector<Face> delegate) {
    mDelegate = delegate;
}

public SparseArray<Face> detect(Frame frame) {
    ByteBuffer byteBuffer = frame.getGrayscaleImageData();
    byte[] bytes = byteBuffer.array();
    int w = frame.getMetadata().getWidth();
    int h = frame.getMetadata().getHeight();
    // Byte array to Bitmap here
    return mDelegate.detect(frame);
}

public boolean isOperational() {
    return mDelegate.isOperational();
}

public boolean setFocus(int id) {
    return mDelegate.setFocus(id);
}}
Run Code Online (Sandbox Code Playgroud)

android bitmap grayscale google-vision android-vision

9
推荐指数
1
解决办法
3746
查看次数

使用谷歌条码扫描器(Vision)编码的数据矩阵的未知编码

我正在尝试使用Vision Barcode Scanner的实现扫描一些Data Matrix条形码,但我在编码的条码扫描器上遇到了问题.

我正在使用:

int codesDetected = Barcode.ALL_FORMATS;
Run Code Online (Sandbox Code Playgroud)

但它仍会返回那些的未知编码.

另一方面,Google Goggles应用程序正确扫描它们,对于使用zxing的其他一些条形码阅读器也是如此.

条形码示例:

在此输入图像描述 在此输入图像描述

如果能解决这个问题,我愿意转移到Zxing,但我想知道我的实现中是否缺少某些东西(我采用了Vision示例应用程序)这些类型的条形码(数据矩阵编码).

谢谢

android barcode datamatrix android-vision

9
推荐指数
0
解决办法
1347
查看次数

Android Vision条形码API - 使用二进制数据读取自定义QR码

我用com.google.android.gms.vision.barcode.BarcodeDetector它来读取QR码.问题是这些代码携带原始二进制数据; 没有电话号码,没有URL,没有地理位置......我无法更改这些QR码,因为它们是在不同的应用程序中生成的.

当我使用Android Barcode API扫描这些QR码时,生成的Barcode对象不允许我访问原始数据,尽管它必须知道它!

我得到的只是"Unknown encoding"信息rawValuedisplayValue属性.

拥有byte[]属性而不是两个String属性会更有意义,因为QR码可以携带一般数据.

我没有看到隐藏开发人员的原始数据字节数组的意义.我可以以某种方式扩展BarcodeDetector课程或Barcode课程以获得我需要的东西吗?

编辑:

这是一个绝对有效的QR码,虽然它带有1024字节的数据,但Vision API无法读取它:

在此输入图像描述


QR码 - 原始二进制数据是相关的,但它不能解决我的问题.

java android qr-code barcode android-vision

9
推荐指数
1
解决办法
1836
查看次数

如何禁用多个条形码检测android Vision API

我正试图禁用多次Barcode检测.如何禁用MultiProcessor使用Google Vision API,我无法找到官方网站的任何解决方案在这里

我从这里下载了样品

BarcodeDetector barcodeDetector = new BarcodeDetector.Builder(context).build();
    BarcodeTrackerFactory barcodeFactory = new BarcodeTrackerFactory(mGraphicOverlay);
    barcodeDetector.setProcessor(
            new MultiProcessor.Builder<>(barcodeFactory).build());
Run Code Online (Sandbox Code Playgroud)

即使删除线下,我根本无法检测到.

 barcodeDetector.setProcessor(
        new MultiProcessor.Builder<>(barcodeFactory).build());
Run Code Online (Sandbox Code Playgroud)

android barcode-scanner android-vision

9
推荐指数
1
解决办法
3923
查看次数

Google Mobile Vision库未下载

我正在尝试将Google Mobile Vision TextRecogniser API实施到我的应用中,以便从给定的图像中读取文本.当我尝试使用该功能时,我收到此错误:

W/DynamiteModule: Local module descriptor class for com.google.android.gms.vision.dynamite not found.
I/DynamiteModule: Considering local module com.google.android.gms.vision.dynamite:0 and remote module com.google.android.gms.vision.dynamite:801
I/DynamiteModule: Selected remote version of com.google.android.gms.vision.dynamite, version >= 801
W/System: ClassLoader referenced unknown path: /data/user_de/0/com.google.android.gms/app_chimera/m/00000005/n/arm64-v8a
D/ApplicationLoaders: ignored Vulkan layer search path /data/app/com.google.android.gms-1/lib/arm64:/system/fake-libs64:/data/app/com.google.android.gms-1/base.apk!/lib/arm64-v8a for namespace 0x7a2e8c60f0
I/Vision: Loading libocr library
I/Vision: libocr load status: false
I/TextRecognizerCreatorImpl: Requesting download for native text recognizer
W/TextNativeHandle: Native handle not yet available. Reverting to no-op handle.
Run Code Online (Sandbox Code Playgroud)

我相信,这意味着图书馆没有下载到手机上.

我已针对常见错误来源进行了问题排查,包括缺少互联网连接,内存不足,缺少依赖关系,重新启动手机,更新Google Play服务,等待一段时间等等.Google存储库和Play服务也在Android工作室中更新.

然而,即使在不同的设备上尝试我的应用程序,我仍然会得到相同的错误.

ocr android text-recognition android-vision

9
推荐指数
3
解决办法
1万
查看次数

使用Google的Mobile Vision识别静态图像中的文字?

我正在尝试使用谷歌的Mobile Vision API编写一个基本的ocr安卓应用程序,但我实际上很难让应用程序识别静态图像中的文本.我查看了codelabs教程,其他人的问题,即每个带有android-vision标签的stackoverflow问题,以及文档,但我仍然没有运气.我知道其他人问过类似的问题但是那里发布的答案不起作用.

这是我的代码的摘录

Bitmap photo = (Bitmap) extras.get("data");
        pictureOcrView.setImageBitmap(photo);
        Context context = getApplicationContext();
        TextRecognizer ocrFrame = new TextRecognizer.Builder(context).build();
        Frame frame = new Frame.Builder().setBitmap(photo).build();
        if (ocrFrame.isOperational()){
            Log.e(TAG, "Textrecognizer is operational");
        }
        SparseArray<TextBlock> textBlocks = ocrFrame.detect(frame);

        for (int i = 0; i < textBlocks.size(); i++) {
            TextBlock textBlock = textBlocks.get(textBlocks.keyAt(i));

            Log.e(TAG, "something is happening");
            }
Run Code Online (Sandbox Code Playgroud)

我不明白这是什么问题.这不像是我的文字乱码,我根本就没有收到任何文字.当我使用为codelab教程运行的文本图片测试此应用程序时,我什么都没得到.似乎textBlock数组甚至没有被创建,但我不知道为什么.我知道我已经创建了框架,因为我仍然可以成功运行getHeight等其他框架方法,并且isOperational()已经返回true.

关于我做错的任何建议?

android android-vision

8
推荐指数
1
解决办法
3307
查看次数

Android(手机)视觉相机亮度非常低

我在我的项目中集成了google vision,如下面的帖子所示:http: //code.tutsplus.com/tutorials/reading-qr-codes-using-the-mobile-vision-api--cms-24680

除了相机视图亮度外,一切看起来都很好.与我的实际Android相机应用程序相比,这里的相机视图非常暗.

如果我可以增加相机的亮度并打开任何低光设置,请告诉我.谢谢 .

图片: 相机图片 , App相机查看图片

camera android android-camera android-vision

7
推荐指数
1
解决办法
1100
查看次数