Barcode Scanner vs Object Output

Understanding the differences between the Barcode Scanner (cross-platform, MLKit) and the Object Output (iOS only, native)

Both the Barcode Scanner and the Object Output allow scanning codes in the Camera. While they are similar, there are a few subtle differences between the two.

Implementation detail

The Object Output is a native Camera feature built into iOS via AVCaptureMetadataOutput, which has very little overhead and is used throughout the OS - even in the stock Camera app. Since Android does not have a native Object Output, the Object Output is iOS only.

The Barcode Scanner on the other hand is a custom Frame Processing pipeline using MLKit, which is a third-party dependency and contains the ~2.4MB ML Model - see MLKit: Barcode scanning for more information. It works on both iOS and Android.

Platform Agnostic

Since the Barcode Scanner uses the same MLKit implementation on iOS and Android, the scanned codes are platform-agnostic. In previous versions of VisionCamera, there were some codes readable on iOS but not on Android (like 'upc-a' vs 'ean-13') - this is solved by using the Barcode Scanner on iOS too.

Different Object/Code Types

The Object Output supports scanning more than just Barcodes - it allows detecting Faces ('face'), Bodies ('human-body', 'dog-body' or 'cat-body') and more.

The Barcode Scanner is optimized for machine-readable codes like 'qr-code' or 'code-128'.

Custom Decoding

The Barcode Scanner allows reading the code's value both as a raw string as well as a raw ArrayBuffer. Additionally, it provides a human-friendly display value, useful for codes that are not human-friendly like 'wifi'.

Usage in a Frame Processor

The Barcode Scanner can be imperatively called inside a Frame Processor (see "The Frame Output"), which offers more flexibility for customization.