Method DetectAsync
DetectAsync(ImageBuffer, CancellationToken)
Finds the faces in an image, on a worker thread.
public Task<IReadOnlyList<DetectedFace>> DetectAsync(ImageBuffer image, CancellationToken cancellationToken = default)
Parameters
imageImageBufferThe image. Any pixel format; it is read as RGB.
cancellationTokenCancellationTokenA token to cancel the detection.
Returns
- Task<IReadOnlyList<DetectedFace>>
The faces found, the most confident first, in the image's pixels.
Exceptions
- ArgumentNullException
imageis null.- OperationCanceledException
The detection was cancelled.