Platforms to show: All Mac Windows Linux Cross-Platform

VNDetectDocumentSegmentationRequestMBS class

Super class: VNImageBasedRequestMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
class Vision MBS MacFrameworks Plugin 24.5 ✅ Yes ❌ No ❌ No ✅ Yes All
An object that detects rectangular regions that contain text in the input image.
Example
// we like to find a document in a photo
Var request As New VNDetectDocumentSegmentationRequestMBS
Var requests() As VNRequestMBS = Array(request)

Var file As FolderItem = SpecialFolder.Desktop.Child("IMG_4302.jpeg")
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 VNRectangleObservationMBS Then
Var hresult As VNRectangleObservationMBS = VNRectangleObservationMBS(result)
Var boundingBox As CGRectMBS = hresult.boundingBox

MessageBox _
boundingBox.Origin.X.ToString+"/"+_
boundingBox.Origin.Y.ToString+" "+_
boundingBox.Size.Width.ToString+"x"+_
boundingBox.Size.Height.ToString

End If
End If

Perform this request to detect a document in an image. The result that the request generates contains the four corner points of a document’s quadrilateral and saliency mask.

Results will contain VNRectangleObservationMBS objects.
Subclass of the VNImageBasedRequestMBS class.

Super class VNImageBasedRequestMBS

Super class VNRequestMBS

This class has no sub classes.

Blog Entries

Release notes

Some examples using this class:

Some related classes:


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


VNDetectBarcodesRequestMBS   -   VNDetectedObjectObservationMBS


The biggest plugin in space...