FIRVisionImage
@interface FIRVisionImage : NSObjectAn image or image buffer used in vision detection, with optional metadata.
-
Metadata about the image (e.g. image orientation). If metadata is not specified, the default metadata values are used.
Declaration
Objective-C
@property (nonatomic, nullable) FIRVisionImageMetadata *metadata; -
Initializes a
VisionImageobject with the given image.Declaration
Objective-C
- (nonnull instancetype)initWithImage:(nonnull UIImage *)image;Parameters
imageImage to use in vision detection. The given image should be rotated, so its
imageOrientationproperty is set toUIImageOrientationUpvalue. TheUIImagemust have non-NULLCGImageproperty.Return Value
A
VisionImageinstance with the given image. -
Initializes a
VisionImageobject with the given image buffer. To improve performance, it is recommended to minimize the lifespan and number of instances of this class when initializing with aCMSampleBufferRef.Declaration
Objective-C
- (nonnull instancetype)initWithBuffer:(nonnull CMSampleBufferRef)sampleBuffer;Parameters
sampleBufferImage buffer to use in vision detection. The buffer must be based on a pixel buffer (not compressed data), and the pixel format must be one of: -
kCVPixelFormatType_32BGRA-kCVPixelFormatType_420YpCbCr8BiPlanarFullRange-kCVPixelFormatType_420YpCbCr8BiPlanarVideoRangeIn practice: this works with the video output of the phone’s camera, but not other arbitrary sources ofCMSampleBufferRefs.Return Value
A
VisionImageinstance with the given image buffer. -
Unavailable.
Declaration
Objective-C
- (nonnull instancetype)init;