How to get frame of detected barcode using Google Vision api for barcode detection

The Google Vision Barcode Detection API works great and gets the result of barcode scanning using Android. But I did not find a way to get the frame from which the barcode was detected. Is there a way to get the exact frame?

+6
source share
1 answer

You can use Detection (Frame) instead of receiveFrame (Frame) .

When using receiveFrame (), you can only get the barcode results returned by the processor:

class BarcodeTrackerFactory implements MultiProcessor.Factory<Barcode> {
    private GraphicOverlay mGraphicOverlay;

    BarcodeTrackerFactory(GraphicOverlay graphicOverlay) {
        mGraphicOverlay = graphicOverlay;
    }

    @Override
    public Tracker<Barcode> create(Barcode barcode) {
        BarcodeGraphic graphic = new BarcodeGraphic(mGraphicOverlay);
        return new GraphicTracker<>(mGraphicOverlay, graphic);
    }
}

, detect() . , .

0

Source: https://habr.com/ru/post/1669500/


All Articles