Platforms to show: All Mac Windows Linux Cross-Platform

VNDetectBarcodesRequestMBS class

Super class: VNImageBasedRequestMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
class Vision MBS MacFrameworks Plugin 19.4 ✅ Yes ❌ No ❌ No ✅ Yes All
An image analysis request that finds and recognizes barcodes in an image.
Example
// we like to find barcodes on the image
Var request As New VNDetectBarcodesRequestMBS
Var requests() As VNRequestMBS = Array(request)

Var file As FolderItem = SpecialFolder.Desktop.Child("test.png")
Var imageRequestHandler As VNImageRequestHandlerMBS = VNImageRequestHandlerMBS.RequestWithFile(file)

// perform request synchronously. Asynchronously with callback is also possible
Var error As NSErrorMBS
Var r As Boolean = imageRequestHandler.performRequests(requests, error)

If r Then

Var results() As VNObservationMBS = request.results
Var result As VNObservationMBS = results(0)
If result IsA VNBarcodeObservationMBS Then
Var hresult As VNBarcodeObservationMBS = VNBarcodeObservationMBS(result)
MessageBox "Barcode text: "+hresult.payloadStringValue
End If
End If

By default, a barcode request first locates all barcodes in the input image, then analyzes each to decode payload. To specify or limit the types of barcodes sought in the request, set the symbologies property to an array of barcode types you would like to support.

This request returns an array of VNBarcodeObservationMBS objects, one for each barcode it detects.

See also ZBarMBS class and ZxingBarcodeMBS module for cross platform projects.
Subclass of the VNImageBasedRequestMBS class.

Super class VNImageBasedRequestMBS

Super class VNRequestMBS

This class has no sub classes.

Blog Entries

Xojo Developer Magazine

Release notes

Some examples using this class:

Some related classes:


The items on this page are in the following plugins: MBS MacFrameworks Plugin.


VNCoreMLRequestMBS   -   VNDetectDocumentSegmentationRequestMBS


The biggest plugin in space...