Platforms to show: All Mac Windows Linux Cross-Platform

VNDetectHumanRectanglesRequestMBS class

Superclass: 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 rectangular regions containing humans in an image.
Example
// we like to find people in the image
Var request As New VNDetectHumanRectanglesRequestMBS
Var requests() As VNRequestMBS = Array(request)

Var file As FolderItem = SpecialFolder.Desktop.Child("image0.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 VNDetectedObjectObservationMBS Then
Var hresult As VNDetectedObjectObservationMBS = VNDetectedObjectObservationMBS(result)
// show first person coordinates (in %)

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

Provides results in VNDetectedObjectObservationMBS objects.
Subclass of the VNImageBasedRequestMBS class.

Superclass VNImageBasedRequestMBS

Superclass VNRequestMBS

This class has no subclasses.

Blog Entries

Release notes

  • Version 26.6
    • Added upperBodyOnly property to VNDetectHumanRectanglesRequestMBS class.

Some examples using this class:

Some related classes:


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


VNDetectHumanHandPoseRequestMBS   -   VNDetectRectanglesRequestMBS


The biggest plugin in space...