MBImage

Objective-C


@interface MBImage : NSObject

Swift

class MBImage : NSObject

Object which represents an image.

  • UIImage of wrapped image. If this MBImage wasn’t created with UIImage, UIImage will be created with first access of this property.

    Declaration

    Objective-C

    @property (nonatomic, readonly, nullable) UIImage *image;

    Swift

    var image: UIImage? { get }
  • roi

    Region of the image used for scanning, where the whole image is specified with CGRectMake(0.0, 0.0, 1.0, 1.0).

    Declaration

    Objective-C

    @property (nonatomic) CGRect roi;

    Swift

    var roi: CGRect { get set }
  • Processing orientation of image. This is used in OCR where you can specify character orientation.

    Default: MBProcessingOrientationUp

    Declaration

    Objective-C

    @property (nonatomic) MBProcessingOrientation orientation;

    Swift

    var orientation: MBProcessingOrientation { get set }
  • Tells whether camera input images should be mirrored horizontally before processing

    Default: NO

    Declaration

    Objective-C

    @property (nonatomic) BOOL mirroredHorizontally;

    Swift

    var mirroredHorizontally: Bool { get set }
  • Tells whether camera input images should be mirrored vertically before processing

    Default: NO

    Declaration

    Objective-C

    @property (nonatomic) BOOL mirroredVertically;

    Swift

    var mirroredVertically: Bool { get set }
  • If YES, the image will prior to processing go through frame quality estimation phase, which might discard the frame

    Default: NO.

    Declaration

    Objective-C

    @property (nonatomic) BOOL estimateFrameQuality;

    Swift

    var estimateFrameQuality: Bool { get set }
  • Property which tells if this frame is a camera or a single photo frame. This is important for image processing.

    Default: YES if created with CMSampleBuffer, NO if created with UIImage

    Declaration

    Objective-C

    @property (nonatomic) BOOL cameraFrame;

    Swift

    var cameraFrame: Bool { get set }
  • Connection orientation. Default: MBVideoRotationAngleLandscapeRight - landscape right.

    Declaration

    Objective-C

    @property (nonatomic) MBVideoRotationAngle videoRotationAngle;

    Swift

    var videoRotationAngle: MBVideoRotationAngle { get set }
  • Creates MBImage around UIImage.

    Declaration

    Objective-C

    + (nonnull instancetype)imageWithUIImage:(nonnull UIImage *)image;

    Swift

    convenience init(uiImage image: UIImage)
  • Creates MBImage around CVImageBufferRef.

    Declaration

    Objective-C

    + (nonnull instancetype)imageWithCmSampleBuffer:
        (nonnull CMSampleBufferRef)buffer;

    Swift

    convenience init(cmSampleBuffer buffer: CMSampleBuffer)
  • Creates MBImage around CVPixelBufferRef.

    Declaration

    Objective-C

    + (nonnull instancetype)imageWithCvPixelBuffer:(nonnull CVPixelBufferRef)buffer
                                       orientation:(UIImageOrientation)orientation;

    Swift

    convenience init(cvPixelBuffer buffer: CVPixelBuffer, orientation: UIImage.Orientation)