Label Capture

Defined in framework ScanditLabelCapture

LabelCapture
open class LabelCapture : NSObject, DataCaptureMode

Added in version 6.0.0

Smart Label Capture enables simultaneous scanning of multiple barcodes and printed text on labels, streamlining data entry and reducing errors. This data capture mode combines barcode recognition with OCR to extract contextually relevant data fields from labels with structured layouts.

Smart Label Capture intelligently identifies label information using multiple recognition approaches:

  • Content analysis of texts and barcodes for validation

  • Barcode symbology detection for field identification

  • Relative field positioning within the label layout

  • Textual context to understand field relationships

Primary use cases include:

  • Retail product scanning with price verification

  • Smart device label scanning for IMEI and serial numbers

  • Shelf price label verification for retail operations

  • Vehicle identification number (VIN) capture from automotive labels

Unlike BarcodeCapture which focuses on individual barcodes, Smart Label Capture provides contextual intelligence to extract multiple data types simultaneously and supports flexible field definitions for diverse label layouts.

The key components of Label Capture are:

  • Label Definitions: Define the structure and expected fields of labels

  • Field Definitions: - Define individual data fields (barcodes, text, dates, etc.)

  • Captured Labels: - Represent successfully scanned labels with all their field data

Label Capture can track labels across multiple frames, allowing for progressive scanning where fields are captured over time until the complete label is assembled.

It cannot be used together with other capture modes that require the same capabilities, e.g. BarcodeCapture or BarcodeBatch.

init
convenience init(context: DataCaptureContext?, settings: LabelCaptureSettings)

Added in version 6.0.0

Construct a new label capture mode with the provided context and settings. When the context is not null, the capture mode is automatically added to the context.

The settings must contain at least one LabelDefinition that defines the structure and fields of labels to be captured. The label definitions specify what types of data (barcodes, text, dates, etc.) are expected.

init
convenience init(fromJSONString JSONString: String, context: DataCaptureContext) throws

Added in version 6.4.0

Construct a new label capture mode with the provided JSON serialization. The capture mode is automatically added to the context.

isEnabled
open var isEnabled: Bool { get, set }

Added in version 6.0.0

Implemented from DataCaptureMode. See DataCaptureMode.isEnabled.

apply
open func apply(_ settings: LabelCaptureSettings, completionHandler: (@Sendable () -> Void)? = nil) -> Void

Added in version 6.0.0

Asynchronously apply the new settings to label capture. This allows you to modify label definitions, change field configurations, or update recognition parameters at runtime.

When not in validation flow, if label capture is currently running, the task will complete when the next frame is processed, and will use the new settings for that frame. If label capture is currently not running, the task will complete as soon as the settings have been stored and won’t wait until the next frame is going to be processed.

When in validation flow, calls to this method will be ignored.

apply
open func apply(_ settings: LabelCaptureSettings) async -> Void

Added in version 6.0.0

Asynchronously apply the new settings to label capture. This allows you to modify label definitions, change field configurations, or update recognition parameters at runtime.

When not in validation flow, if label capture is currently running, the task will complete when the next frame is processed, and will use the new settings for that frame. If label capture is currently not running, the task will complete as soon as the settings have been stored and won’t wait until the next frame is going to be processed.

When in validation flow, calls to this method will be ignored.

addListener
open func addListener(_ listener: any LabelCaptureListener) -> Void

Added in version 6.0.0

Adds the listener to this label capture instance to observe the label capture mode and get notified when a label or some of its fields got scanned.

In case the same listener is already observing this instance, calling this method will not add the listener again.

removeListener
open func removeListener(_ listener: any LabelCaptureListener) -> Void

Added in version 6.0.0

Removes a previously added listener from this label capture instance.

In case the listener is not currently observing this instance, calling this method has no effect.

recommendedCameraSettings
open class var recommendedCameraSettings: CameraSettings { get }

Added in version 6.1.0

Gets the recommended camera settings to use with this mode.

context
open var context: DataCaptureContext? { get }

Added in version 6.0.0

Implemented from DataCaptureMode. See DataCaptureMode.context.

feedback
open var feedback: LabelCaptureFeedback { get, set }

Added in version 7.6.0

Instance of LabelCaptureFeedback that is used to configure the vibration and sound to be used when a label is captured.

The default feedback will have both sound and vibration enabled. The default beep sound will be used for the sound feedback.

update
open func update(fromJSONString JSONString: String) throws -> Void

Added in version 6.4.0

Updates the mode according to a JSON serialization.