Jump to top

VisionBarcode

interface

A representation of a barcode detected in an image.

Example
const [barcode, ...otherBarcodes] = await firebase.vision().barcodeDetectorProcessImage(filePath);
console.log(barcode);

Properties

boundingBox

</>

Returns the bounding rectangle of the detected barcode.

calendarEvent

</>

Gets parsed calendar event (set if valueType is VisionBarcodeValueType.CALENDAR_EVENT).

contactInfo

</>

Gets parsed contact details (set if valueType is VisionBarcodeValueType.CONTACT_INFO).

cornerPoints

</>

Gets the four corner points in clockwise direction starting with top-left. Due to the possible perspective distortions, this is not necessarily a rectangle. Parts of the region could be outside of the image.

displayValue

</>

Returns barcode value in a user-friendly format.

displayValue: string | null;

driverLicense

</>

Gets parsed drivers license details (set if valueType is VisionBarcodeValueType.DRIVER_LICENSE).

email

</>

Gets parsed email details (set if valueType is VisionBarcodeValueType.EMAIL).

format

</>

Returns the barcode format, for example VisionBarcodeFormat.QR_CODE

format: number;

geoPoint

</>

Gets parsed Geo Point details (set if valueType is VisionBarcodeValueType.GEO).

phone

</>

Gets parsed phone details (set if valueType is VisionBarcodeValueType.PHONE).

rawValue

</>

Returns barcode value as it was encoded in the barcode.

rawValue: string | null;

sms

</>

Gets parsed sms details (set if valueType is VisionBarcodeValueType.SMS).

url

</>

Gets parsed url details (set if valueType is VisionBarcodeValueType.URL).

valueType

</>

Returns type of the barcode value, for example VisionBarcodeValueType.EMAIL.

valueType: number;

wifi

</>

Gets parsed wifi details (set if valueType is VisionBarcodeValueType.WIFI).