generateMaskedImage(for:imageFrom:croppedToInstancesExtent:)
Creates a high-resolution image with everything except for the instances you specify masked out.
Declaration
func generateMaskedImage(for instances: IndexSet, imageFrom requestHandler: ImageRequestHandler, croppedToInstancesExtent: Bool = false) throws -> CVPixelBufferParameters
- instances:
An indexed set of selected instances, where
0is the background. - requestHandler:
A request handler containing an image to be masked.
- croppedToInstancesExtent:
Crops the image to the smallest rectangle containing all instances. Default is
false.
Return Value
The pixel buffer that contains the image.