Label Definition

Defined in namespace Scandit.DataCapture.Label

LabelDefinition
class LabelDefinition : IDisposable

Added in version 8.1.0

A configuration that defines labels and their relevant fields for Smart Label Capture to recognize and extract during scans. Label definitions provide flexible data extraction from specific label layouts without custom coding, enabling structured data extraction from diverse label types.

Label definitions support two primary approaches:

  • Pre-built Labels - Includes predefined configurations for common label types (price labels, VIN labels, 7-segment displays)

  • Custom Labels - Allows creating unique label definitions using custom barcode and text fields

Key configuration options for custom fields:

  • valueRegexes - Regular expressions to identify target strings

  • anchorRegexes - Context-identifying keywords for field recognition

  • symbologies - Specific barcode types to match

  • isOptional - Determines field requirement status

Pre-built field categories include:

  • Barcode Fields - Serial number, part number, IMEI

  • Price/Weight Fields - Unit price, total price, weight

  • Date/Text Fields - Packing date, expiry date

You can create label definitions in three ways:

Create()
static LabelDefinition Create(string name, IList<LabelFieldDefinition> fields)

Added in version 8.1.0

Create a new label definition with the given name and fields.

Name
string Name { get; }

Added in version 8.1.0

The name of the label definition.

Fields
IList<LabelFieldDefinition> Fields { get; }

Added in version 8.1.0

The fields of the label definition.

HiddenProperties
IDictionary<string, object> HiddenProperties { get;set; }

Added in version 8.1.0

Set properties to the label definition.

AdaptiveRecognitionMode
AdaptiveRecognitionMode AdaptiveRecognitionMode { get;set; }

Added in version 8.1.0

Controls whether the Adaptive Recognition Engine is enabled for this label definition. The Adaptive Recognition Engine helps making Smart Label Capture more robust and scalable thanks to its larger, more capable model hosted in the cloud. Whenever Smart Label Capture’s on-device model fails to capture data, the SDK will automatically trigger the Adaptive Recognition Engine to capture complex, unforeseen data capture and process it with high accuracy and reliability. See AdaptiveRecognitionMode for available options. Defaults to AdaptiveRecognitionMode.Off.