Barcode Capture Session

Defined under the namespace Scandit.Datacapture.Barcode

BarcodeCaptureSession
class BarcodeCaptureSession

Added in version 6.8.0

The capture session is responsible for determining the list of relevant barcodes by filtering out duplicates. This filtering of duplicates is completely time-based and doesn’t use any information about the location of the barcode. By default, all the codes scanned in a frame are always reported. It is possible to filter out codes recently scanned by changing BarcodeCaptureSettings.codeDuplicateFilter.

For location-based tracking over multiple frames, you may be better off using BarcodeTracking.

When the barcode capture mode is disabled, the session’s duplicate filter is reset.

Important

The capture session should only be accessed from within didScan() or didUpdateSession() to which it is provided as an argument. It is not safe to be accessed from anywhere else since it may be concurrently modified.

Specifically no reference to newlyRecognizedBarcodes or newlyLocalizedBarcodes should be kept and traversed outside of didScan() or didUpdateSession(). Instead a copy of the lists should be made to avoid concurrent modification. The individual barcodes can be referenced without copying as they are not further modified.

newlyRecognizedBarcodes
get newlyRecognizedBarcodes(): Barcode[]

Added in version 6.8.0

List of codes that were newly recognized in the last processed frame.

Deprecated since version 6.26.0: Prefer use of newlyRecognizedBarcode instead.

newlyRecognizedBarcode
get newlyRecognizedBarcode(): Barcode | null

Added in version 6.26.0

Last newly recognized barcode in the last processed frame.

newlyLocalizedBarcodes
get newlyLocalizedBarcodes(): LocalizedOnlyBarcode[]

Added in version 6.8.0

List of codes that were newly localized (but not recognized) in the last processed frame.

reset()
reset(): Promise<void>

Added in version 6.12.0

Resets the barcode capture session, effectively clearing the history of scanned codes. This affects duplicate filtering: when calling reset() every frame has the same effect as setting the BarcodeCaptureSettings.codeDuplicateFilter to 0. This function should only be called inside the listeners’ callback.

frameSequenceID
get frameSequenceID(): number

Added in version 6.8.0

The identifier of the current frame sequence.

Important

As long as there is no interruptions of frames coming from the camera, the frameSequenceID will stay the same.