VNImageRequestHandler.Perform(VNRequest[], NSError) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Asynchronously executes vision recognition for the specified requests
.
[Foundation.Export("performRequests:error:")]
public virtual bool Perform (Vision.VNRequest[] requests, out Foundation.NSError error);
abstract member Perform : Vision.VNRequest[] * -> bool
override this.Perform : Vision.VNRequest[] * -> bool
Parameters
- error
- NSError
Returns
- Attributes
Remarks
Image processing can take several seconds and developers should use a background thread to call this method.
System.Threading.Tasks.Task.Run(() =>
{
using (var requestHandler = new VNImageRequestHandler(img, new NSDictionary()))
{
var findFacesRequest = new VNDetectFaceRectanglesRequest(faceDetectionHandler);
requestHandler.Perform(new[] { findFacesRequest }, out var error);
if (error != null)
{
HandleError(error);
}
}
});