This is the main entry point that allows you to use the SDK.
Introduction
The Capture SDK is targeted to developers who want to use the IDEMIA biometric technologies within their mobile apps.
The main features are:
- Biometric captures
- Biometric coding
- Biometric authentication and identification
- Identity documents reading
Please refer to Release Notes to see the list of improvements and fixed issues.
Prerequisites
Skills Required
The integration tasks shall be done by developers with knowledge of:
- Xcode
- Objective-C/Swift
- iOS (min version is 15.0)
- (optional) cocoapods
Resources Required
Integration should be performed on a Mac.
The tools required are:
- Xcode that support iOS 15
- iOS device (simulator is not supported)
Licenses Required
Depending of which declination of the library is used the licenses required are:
-
Biometry + Document:
- MORPHOFACS
- VERIF
- IDENT
- MIMA
- MSC_CORE
- MSC_LIVENESS
-
Biometry:
- MORPHOFACS
- VERIF
- IDENT
- MIMA
- MSC_CORE
- MSC_LIVENESS
-
Document:
- MIMA
- MSC_CORE
Note: To enable the feature for video dump you will need also:
- MSC_DUMP
Sample Project
The sample project is provided along with this documentation.
Getting Started
Components
The SDK is composed of six different components:
- LicenseManager: Object responsible for handling the license.
- FaceCaptureHandler: Handles the capture of the face biometrics through the camera of the device.
- FingerCaptureHandler: Handles the capture of the finger biometrics through the camera of the device.
- BioMatcherHandler: Handles the biometric coding and matching.
- BioStoreDB: Repository to store biometric templates (This component is optional, just in case you don’t want to implement your own database).
- DocumentCaptureHandler: Handles the document reading features (Like reading MRZ documents).
- ImageUtils: Handle the images format conversion, in case the integrator needs to change the image format or import an image.
SDK Variants
The SDK comes in six different variants.
-
Full SDK: It contains all the features of the SDK. Includes components: LicenseManager, FaceCaptureHandler, FingerCaptureHandler, BioMatcherHandler, BioStoreDB, DocumentCaptureHandler, ImageUtils. You can integrate it into your project by specifying it in your Podfile:
pod 'BiometricSDK'
. -
Biometry variant: It contains all biometric features including face and finger capture and also biometric coding and matching used for liveness checking. Includes components: LicenseManager, FaceCaptureHandler, FingerCaptureHandler, BioMatcherHandler, BioStoreDB, ImageUtils. You can integrate it into your project by specifying it in your Podfile:
pod 'BiometricSDK-biometry'
. -
Document variant: It contains only document capture features. Includes components: LicenseManager, DocumentCaptureHandler, ImageUtils. You can integrate it into your project by specifying it in your Podfile:
pod 'BiometricSDK-document'
. -
Finger variant: It contains only finger capture features including biometric coding and matching used for finger liveness checking. Includes components: LicenseManager, FingerCaptureHandler, BioMatcherHandler, BioStoreDB, ImageUtils. You can integrate it into your project by specifying it in your Podfile:
pod 'BiometricSDK-finger'
. -
Face variant: It contains only face capture features without biometric coding and matching, so for liveness checking you need to use external server. Offline liveness checking is not available. Includes components: LicenseManager, FaceCaptureHandler, BioStoreDB, ImageUtils. You can integrate it into your project by specifying it in your Podfile:
pod 'BiometricSDK-face'
. -
Face+document variant: It contains only face capture features without biometric coding and matching, so for liveness checking you need to use external server. Offline liveness checking is not available. Additionally it contains also document capture features. Includes components: LicenseManager, FaceCaptureHandler, BioStoreDB, DocumentCaptureHandler, ImageUtils. You can integrate it into your project by specifying it in your Podfile:
pod 'BiometricSDK-face_document'
.
Analytics
Capture SDK offers a logging mechanism that collects analytics data about SDK usage and sends this data to IDEMIA's server in the EU. This data helps IDEMIA to improve Capture SDK and the likelihood of integrator success within the app. It is strongly recommended to use the analytics mechanism.
- Sending analytics data is enabled by default.
- You can enable or disable sending analytics data.
- You can choose to send analytics data only when you are connected to a Wi-Fi network, so as not to not use your cellular connection.
- Analytics data that IDEMIA collects contains only technical data.
- No sensitive personal data is collected.
- IDEMIA does not collect any images.
Analytics data that we collect include following information:
- Application name, bundle id, version
- Capture SDK and RemoteLogger libraries versions
- Capture SDK plugins versions
- Device model and operating system version
- Technical information about performed face, finger, and document capture (such as: used capture mode; timestamp; reason of error; time needed to perform a capture; quality of captured image; and light condition)
- Technical information about performed authentication and identification events (such as: used threshold, duration, and obtained score)
- Other technical information (such as: image compression, occurred errors, and SDK performance) that does not contain personal data
You can disable analytics reporting using the appropriate SDK method.
Analytics are enabled by default and data is sent through Wi-Fi and cellular connections to IDEMIA's server in Europe. You can switch to the server in US by calling:
Objective-C1[[BIORemoteLogger sharedInstance] setConfiguration:[BIORemoteLoggerConfiguration defaultUS]];
You can switch to Wi-Fi only mode with:
Objective-C1[BIORemoteLogger sharedInstance].wifiOnly = YES;
You can disable analytics as with:
Objective-C1[BIORemoteLogger sharedInstance].loggerDisabled = YES;
You should perform above calls before using the SDK, for example, in your app delegate.
Project Configuration
Before using our SDK you need to add Privacy - Camera Usage Description (NSCameraUsageDescriptionkey) to the Info.plist of your application as it will need to use the camera.
Adding the Biometric Capture SDK Framework
We serve our artifacts with the artifactory. As an integrator you can choose one the methods of adding our framework to your project:
- using CocoaPods
- manually
Use CocoaPods (along with cocoapods-artplugin)
If you don't already have the CocoaPods with the Artifactory tool, install it by running the following command:
Bash1gem install cocoapods-art
- The plugin uses authentication as specified in a standard .netrc file.
Swift1machine mi-artifactory.otlabs.fr2login ##USERNAME##3password ##PASSWORD##
- Once set, add our repo to your CocoaPod's dependency management system:
Bash1pod repo-art add smartsdk "https://mi-artifactory.otlabs.fr/artifactory/api/pods/smartsdk-ios-local"
- At the top of your project
Podfile
add:
Ruby1plugin 'cocoapods-art', :sources => [2 'master', # so it could resolve dependencies from master repo (the main one), for newer CocoaPods (1.10+) versions it may not be needed anymore3 'smartsdk' # so it could resolve BiometricSDK depdendency4]
- Add the Capture SDK in your
Podfile
in one of its pod's version:
Ruby1pod 'BiometricSDK' # Full version of the SDK, contains biometrics & documents features2pod 'BiometricSDK-biometry' # Contains only biometrics (finger+face) features34pod 'BiometricSDK-finger' # Contains only finger features56pod 'BiometricSDK-face' # Contains only face features without internal liveness checking mechanism7pod 'BiometricSDK-document' # Contains only document features8pod 'BiometricSDK-face_document' # Contains only face features without internal liveness checking mechanism & documents features
Above configuration installs iOS frameworks. For XCFramework, 'XCFramework' subspec can be used for face, face_document and document variants. Eg.
Ruby1pod 'BiometricSDK-face_document/XCFramework'
- Then you can use
install
:
Bash1pod install
Note: If you are already using our repo, and you cannot resolve some dependency, try to update the specs:
Bash1pod repo-art update smartsdk
Manually
- Download the artifact manually from the artifactory:
SDK variant | SDK link |
---|---|
Face+Document+Fingerprint | BiometricSDK-biometry_document.tar.gz |
Face+Fingerprint | BiometricSDK-biometry.tar.gz |
Document | BiometricSDK-document.tar.gz |
Face | BiometricSDK-face.tar.gz |
Document+Face | BiometricSDK-face_document.tar.gz |
Fingerprint | BiometricSDK-finger.tar.gz |
Algorithms | BiometricSDK-algorithms.tar.gz |
Plugins | BiometricSDK-plugins.tar.gz |
-
In the project editor, select the target to which you want to add a library or framework.
-
Click Build Phases at the top of the project editor.
-
Open the Embedded Binaries.
-
Click the Add button (+).
-
Click the Add Other button below the list.
-
Add the following items:
BiometricSDK.framework
- (optionally for face capture)
BiometricSDKFaceCapturePluginNormal.framework
(or other face capturing plugin) - (optionally for face capture)
BiometricSDKAlgorithmPlugin_F6_5_LOW70.framework
(or other matching algorithm plugin) - (optionally for finger capture new API)
FingerCaptureSDK.framework
- (optionally for finger capture new API)
BiometricSDKUIFinger.framework
Note: XCFrameworks are supported with face, face_document and document variants. XCFrameworks are not yet supported with biometry, biometry_document, fingerprint variants.
SDK Size
SDK variant | SDK size |
---|---|
Face+Document+Fingerprint (offline liveness + matching) | 48.58 MB |
Face+Document+Fingerprint (offline liveness) | 40.35 MB |
Face+Document+Fingerprint (backend) | 36.28 MB |
Face+Fingerprint (offline liveness + matching) | 35.53 MB |
Face+Fingerprint (offline liveness) | 27.30 MB |
Face+Fingerprint (backend) | 23.23 MB |
Face (offline liveness + matching) | 32.65 MB |
Face (offline liveness) | 24.42 MB |
Document | 11.11 MB |
Face (backend) | 20.35 MB |
Document+Face (offline liveness + matching) | 45.72 MB |
Document+Face (offline liveness) | 37.49 MB |
Document+Face (backend) | 33.42 MB |
Fingerprint | 07.70 MB |
All sizes are estimated download sizes from App Store on arm64 devices. Note that universal IPA file size containing the SDK might be visibly different in case it's built also for other architectures and/or includes bitcode.
Sizes are total sizes for the whole packages which includes:
- an appropriate SDK variant
- capture plugins
- algorithms plugins
- UIExtension library
- UIExtension's additional resources like tutorials and animations
Different packages variants contains:
- offline liveness + matching: an appropriate SDK, Face Normal plugin, F5_4_LOW75 algorithm, UIExtensions, face capturing tutorials
- offline liveness: SDK, Face Normal plugin, F6_0_IDD80 algorithm, UI
- backend: SDK, Face Lite plugin, no algorithm, UI
License Manager
Remember: A valid license is required before using any feature of the SDK.
To have a valid license:
- Obtain an instance of
LicenseManager
viaprovideLicenseManager()
method. - Call
activate()
method on it.
Before Starting
Note: If you use the debug LKMS server without a SSL connection, you should add permission for the arbitrary loads in the transport security section in your Info.plist file. But it's highly recommended NOT to set this permission without the reason.
XML1<key>NSAppTransportSecurity</key>2 <dict>3 <key>NSAllowsArbitraryLoads</key>4 <true/>5 </dict>
New license manager
The License manager is the main entry point to use the SDK. You can manage licenses through LicenseManager
.
Note: A valid license is required before using any feature of the SDK.
provideLicenseManager
This static method provides an instance of LicenseManager
with a predefined LKMS profile. Any interaction with LicenseManager
must be executed before starting capture.
Swift1let manager = LicenseManager.provideLicenseManager(profileId: LkmsProfileId, apiKey: LkmsApiKey, serverUrl: lkmsUrl)
Activating license
This method fetches the license if it's not locally stored and activates it. Additionally, in cases where the license has expired, the function retrieves a new license. This process is crucial and must occur each time the application starts.
Callback solution:
Swift1manager.activate { (error: LicenseActivationError) in2 if let error {3 // Failed to fetch or activate the license.4 } else {5 // License fetched and activated with success.6 }7 }
Async solution:
Swift1let result: Result<Void, LicenseActivationError> = await manager.activate()2 switch result {3 case .success:4 // License fetched and activated with success.5 case .failure(let error):6 // Failed to fetch or activate the license.7 }
LicenseActivationError
This is the information about why the license can not be activated.
Attribute | Description |
---|---|
type ActivationErrorType | The type of error that occurred during the license activation. |
message String | The reason for the activation failure. |
ActivationErrorType
Attribute | Description |
---|---|
profileExpired | The profile has expired, all licenses won’t work anymore. (Contact with support) |
activationCountExceeded | No more licenses can be consumed. (Contact with support) |
authenticationIssue | The credentials and/or profile are wrong. |
connectionIssue | Connection issue. (Check internet connection and server url) |
unknown | Unknown issue. |
Development issues
This issue occurs before 4.45.0
The LKMS license on your device may become invalidated when switching between debug and App Store (also TestFlight) builds of your app. To have a valid license, uninstall the app first and then switch to debug / App Store build. There is no need to uninstall the app when updating the app from the same source (debug build replaced with debug build or App Store build replaced with App Store build). In the SDK there is dedicated error for this: licenseSignatureVerificationFailed
.
Now
If there is a switch between app builds (Debug or App Store) build, the LicenseManager
will automatically resolve the license issue by reactivating it.
Document capture - remote (recommended)
Introduction
In order to make integration easier and more intuitive - new API has been delivered. It is based on use cases that are self-explaining which provide specific information depending on given use case. This allows to focus on working with data provided by SDK rather than on SDK configuration. What is more, some use cases allows to capture whole document (front and back sides) in single capture session - camera opens only once.
Integration
Integration with new API is simple and consists of three steps.
-
License activation and camera permission. In order to use SDK proper license has to be activated. Getting started section shows how to handle license and permissions.
-
Add
DocumentCaptureView
to the layout. This will be not only capture preview but also entry point to the SDK.
1@property (weak, nonatomic) IBOutlet DocumentCaptureView *captureView;
This view implements DocumentCapture protocol which might be called to manage capture. It contains three methods: configure(with captureUseCase: CaptureUseCase), start(), stop().
Setting up is described below. Methods start and stop are similar to old API's methods to manage capture.
- Use case creation. In order to start capture, specific use case instance needs to be created. Each use case have sessionInfo property that contains session configuration and delegate that will be used to handle callback methods.
Once these three steps are satisfied, configure
method on DocumentCaptureView might be called, passing use case instance as paramerer.
Delegate attached to the use case will receive data from the capture.
Use cases
Capture settings of DocumentCaptureSDK are done by using proper, predefined configuration designed for specific use case. In this way capture configuration is more intuitive and less confusing.
RemoteUseCase
This use case performs document capture with backend communication in order to allow manual verification of the document captured. In order to provide correct flow, RemoteCaptureDelegate, FeedbackDelegate and sessionInfo must be provided during RemoteUseCase initialization. FeedbackDelegate is mandatory to instruct user to properly place device during capture and also when to flip document if both sides are required for verification. RemoteCaptureDelegate informs about whole flow result and provides images of document captured. These images have to be approved in order to proceed with the process. sessionInfo provides information about document capture session on IDEMIA Identity and Verification service for SDK needs to continue the flow.
RemoteSessionInfo field | Description |
---|---|
sessionId String | Live capture session id created with: v1/identities/{identityId}/id-documents/live-capture-session |
apiKey String | ApiKey for authorization on DocServer. |
url URL | Url of document server - for example: https://idproofing-api.environment.idemia.io/doc-server/ |
Swift1if let useCase = DocumentCaptureUseCase.useCaseForType(self.useCaseType, sessionInfo: sessionInfo, delegate: self) {2 self.captureView.configure(with: useCase)3 self.captureView.start()4}
Delegates
Delegates available for specific use cases within new API for document capture.
RemoteCaptureDelegate
Delegate dedicated to remote use cases. Two methods needs to be implemented to provide correct flow to the user. Remember that all UI operations should be performed on main thread.
-
func captureInfoReceived(images: [DocumentImage], finalizer: RemoteCaptureFinalizer)
- this method is being called when document has been captured. List of images (front, back or both sides images) is returned. RemoteCaptureFinalizer instance allows to retry capture, cancel whole flow (Failure instance of Result will be returned on onResult method) or approve images which continues remote flow. Notice that RemoteCaptureFinalizer can retry capture which means that whole remote flow (including displaying captured document) must be performed on the same ViewController where DocumentCaptureView is definded. -
func captureDidFinish(remoteResult: RemoteResult)
- returns result of remote flow. No other callback will occur after this method. Result might be type of Success or Failure.
Swift1class DocumentCaptureViewController: UIViewController, RemoteCaptureDelegate {2 func captureInfoReceived(images: [DocumentImage], finalizer: RemoteCaptureFinalizer) {3 //Handle captured document4 }56 func captureDidFinish(remoteResult: RemoteResult) {7 //remoteResult.isSuccessful ?8 //true -> Handle success result9 //false -> Handle error (remoteResult.error)10 }11}
FeedbackDelegate
Returns feedback about current capture. Feedback should be displayed to user.
Only one function to implement: captureInfoReceived(feedback: FaceCaptureFeedback)
, where FaceCaptureFeedback is an enum telling about capture condition like: document is too far/too close to camera. Remember that all UI operations should be performed on main thread.
Swift1class DocumentCaptureViewController: UIViewController, FeedbackDelegate {2 func captureInfoReceived(feedback: FaceCaptureFeedback) {3 //Present feedback to the user4 }5}
Errors
RemoteError object contains a lot of useful information that helps in handling a failed flow.
Parameter | Description |
---|---|
type ErrorType | Type of an error. High level information what goes wrong. Find types description below. |
code Int | Special code dedicated for particular case. Very helpful in L2, L3 troubleshooting. |
message String | Message with error description. |
FailureType
Type | Description |
---|---|
TIMEOUT | Timeout occured during the flow. |
CONNECTION_ISSUE | Remote connection issue. |
AUTHENTICATION | Remote capture authentication issue. |
INVALID_SESSION | Remote session is invalid. |
BAD_CAPTURE | Document capture failed. |
CANCELED | Capture has been cancelled by the end user. |
INVALID_LICENSE | The LKMS license is invalid. |
UNKNOWN | Unknow type of error. Also used as default type for few cases. |
Biometric Capture SDK
Design Considerations
This is the main entry point that will allow you to use the SDK.
Get Info about Biometric Capture SDK
The purpose of this method is allow the integrator to retrieve information about the SDK.
Objective-C1BIOSDKInfo *info = [BIOSDK getInfo];
Returns
An object of the BIOSDKInfo type with the information about the SDK.
BIOVideoRecordingOptions
This is the video recording object used to configure video recording.
Parameter | Description |
---|---|
recordingEnabled | Is video recording enabled |
BIODebugDataSettings
This is an object used for debug purposes. Currently it contains only one parameter which is a file path used for RTV video playback.
Parameter | Description |
---|---|
rtvFilePath | Path to RTV file used for video playback. |
Enums
BIOLogLevel
These are the constants used to configure logs.
Attribute | Description |
---|---|
BIOLogLevelDebug | Display all logs from SDK |
BIOLogLevelInfo | Informative message |
BIOLogLevelWarning | Warning message |
BIOLogLevelError | Error message |
BIOLogLevelNone | Turns logs off |
BIOColorSpace
These are the ColorSpace
constants.
Attribute | Description |
---|---|
BIOColorSpaceY8 | Grayscale 8bpp image |
BIOColorSpaceY16LE | Grayscale 16bpp image (Little Endian) |
BIOColorSpaceBGR24 | Color 24bpp BGR image (BMP like memory layout) |
BIOColorSpaceRGB24 | Color 24bpp RGB image (reversed memory layout compared to RT_COLORSPACE_BGR24) |
BIOLocation
These are the biometric location constants.
Attribute | Description |
---|---|
BIOLocationFaceFrontal | face |
BIOLocationFingerRightIndex | right index |
BIOLocationFingerRightMiddle | right middle |
BIOLocationFingerRightRing | right ring |
BIOLocationFingerRightLittle | right little |
BIOLocationFingerRightThumb | right thumb |
BIOLocationFingerLeftIndex | left index |
BIOLocationFingerLeftMiddle | left middle |
BIOLocationFingerLeftRing | left ring |
BIOLocationFingerLeftLittle | left little |
BIOLocationFingerLeftThumb | left thumb |
BIOLocationFingerUnknown | finger unknown |
BIOLocationHandLeft | hand left |
BIOLocationHandRight | hand right |
BIOLocationHandUnknown | hand unknown |
BIOModality
These are the biometric modality constants.
Attribute | Description |
---|---|
BIOModalityUnknown | unknown |
BIOModalityFace | Face |
BIOModalityFrictionRidge | Friction ridge |
BIOCaptureHandlerError
These are errors that can be thrown when there is an error with the capture handler.
Attribute | Description |
---|---|
BIOCaptureHandlerErrorSuccess | No error occurred |
BIOCaptureHandlerErrorParameters | Wrong Parameters |
BIOCaptureHandlerErrorParameterUnknown | Unknown parameter |
BIOCaptureHandlerErrorMemalloc | Memory allocation error |
BIOCaptureHandlerErrorInit | Initialization error |
BIOCaptureHandlerErrorGraphInitialisationFailed | Graph initialization failed |
BIOCaptureHandlerErrorParameterNotFound | Parameter not found |
BIOCaptureHandlerErrorParameterSize | Parameter size error |
BIOCaptureHandlerErrorTypeMismatch | Type mismatch error |
BIOCaptureHandlerErrorInvalidHandle | Invalid handler |
BIOCaptureHandlerErrorLicense | License is invalid |
BIOCaptureHandlerErrorApplinotavailable | The application is not available |
BIOCaptureHandlerErrorProfileNotAvailable | The profile is not available |
BIOCaptureHandlerErrorSubprofileNotAvailable | The subprofile is not available |
BIOCaptureHandlerErrorUnknown | An unknown error occurred |
BIOCaptureHandlerErrorInvalidOperation | The operation is invalid |
BIOCaptureHandlerErrorIncompatibleApiVersion | The API version is incompatible. Your application must be recompiled. |
BIOCaptureHandlerErrorCameraError | Camera issue has been encountered |
BIOCaptureHandlerErrorParameterWrongType | Parameter is not the right type |
BIOCaptureHandlerErrorParameterNotSet | Parameter is not set in current scope |
BIOCaptureHandlerErrorCaptureIsLocked | Capture is locked |
BIOCapturingError
These are errors that can be thrown when there is an error during or after the capture.
Attribute | Description |
---|---|
BIOCapturingErrorUnknown | Unknown error occurred |
BIOCapturingErrorCaptureTimeout | Capture timeout |
BIOCapturingErrorNotAlive | The capture returned an image with status not alive . |
BIOCapturingErrorWrongBiometricLocation | The wrong biometric location was scanned (eg. looking for face, captured fingers). |
BIOCapturingErrorImageBuffer | Could not read image buffer |
BIOCapturingErrorBadCaptureFingers | Fingers were not captured properly |
BIOCapturingErrorBadCaptureHand | Hand was not captured properly |
BIOCamera
These are the constants used to configure the behavior of BioCapture
.
Attribute | Description |
---|---|
BIOCameraFront | Front Camera |
BIOCameraRear | Rear Camera |
BIOOverlay
This is the enum used to configure the behavior of BioCapture
.
Attribute | Description |
---|---|
BIOOverlayOFF | Overlay off |
BIOOverlayON | Overlay on |
BIOPreviewColorspace
These are the flags used to set the color space for the preview of the camera.
Attribute | Description |
---|---|
BIOPreviewColorspaceColor | Sets colorspace of preview to RGB24 |
BIOPreviewColorspaceColorBlur | Sets colorspace of preview to RGB24 with Blur |
BIOPreviewColorspaceGray | Sets colorspace of preview to Grayscale |
BIOPreviewColorspaceGrayBlur | Sets colorspace of preview to Grayscale with Blur |
BIOPreviewColorspaceGrayBlurBordered | Sets colorspace of preview to Grayscale with Blur and a white border |
DocumentCaptureHandler
Getting Started with DocumentCaptureHandler
- Import the framework header to your view controller.
Objective-C1#import <BiometricSDK/BiometricSDK.h>
- Add at least one UIImageView or subclasses to your layout. It will be used to preview the stream from camera. It is not necessary for the capture to have a preview.
Objective-C1@property (weak, nonatomic) IBOutlet UIImageView *preview;
-
Check your license status here.
-
You also need to have property for
DocumentCaptureHandler
. This object is handling all operations related to capturing.
Objective-C1[BIOSDK createDocumentCaptureHandlerWithOptions:options withCompletionHandler:^(id<DocumentCaptureHandler> captureHandler, NSError* error) {2 self.captureHandler = captureHandler;3 ...4 }];
- Set the delegate for
DocumentCaptureHandler
toself
.self
will have to implement theDocumentCaptureHandlerDelegate
protocol.
Objective-C1[BIOSDK createDocumentCaptureHandlerWithOptions:options withCompletionHandler:^(id<DocumentCaptureHandler> captureHandler, NSError* error) {2 self.captureHandler = captureHandler;3 self.captureHandler.delegate = self;4 ...5 }];6 }
- After
DocumentCaptureHandler
finishes its initialization, the preview view can be set.
Objective-C1[BIOSDK createDocumentCaptureHandlerWithOptions:captureOptions withCompletionHandler:^(id<DocumentCaptureHandler> captureHandler, NSError* error) {2 self.captureHandler = captureHandler;3 self.captureHandler.delegate = self;4 self.captureHandler.preview = self.preview;5 ...6 }];
- Now it can start capturing.
Objective-C1[BIOSDK createDocumentCaptureHandlerWithOptions:options withCompletionHandler:^(id<DocumentCaptureHandler> captureHandler, NSError* error) {2 self.captureHandler = captureHandler;3 self.captureHandler.delegate = self;4 self.captureHandler.preview = self.preview;5 [self.captureHandler startCaptureWithCompletionHandlerError:nil];6 }];
- Whenever the view controller disappears, resources (e.g. camera) need to be released.
Objective-C1- (void)viewDidDisappear:(BOOL)animated{2 [super viewDidDisappear:animated];3 [self.captureHandler destroy];4 }
DocumentCapture Handler Info
Delegate
This sets the listener to receive the biometric information.
Objective-C1handler.delegate = ... //Object that implements `DocumentCaptureHandlerDelegate` protocol
Preview
This sets the camera preview.
Objective-C1handler.preview = ..... //An `UIImageView`
Note: To stop the camera preview, set preview to nil
.
Debug Settings
This sets the camera preview.
Objective-C1BIODebugDataSettings *settings = [[BIODebugDataSettings alloc] init];2 settings.rtvFilePath = ... //A path to RTV video file used for video playback.3 handler.debugSettings = settings;
Start Capture
This starts the biometric capture.
Objective-C1[handler startCaptureWithCompletionHandler:^(NSError \* error) {2 ...3 }];
Parameter | Description |
---|---|
completionHandler void (^)(NSError *) | Object with error code if an error occurred, else nil . |
Stop Capture
This stops the biometric capture.
Objective-C1[handler stopCaptureWithCompletionHandler:^(NSError \* error) {2 ...3 }];
Parameter | Description |
---|---|
completionHandler void (^)(NSError *) | Object with error code if an error occurred, else nil . |
Force Capture
There is possibility to force Biometric Capture SDK to capture a document image. To do so, you need to call the method forceCapture
during the capture. The component will bypass the tracking and launch the full resolution capture.
Objective-C1// Create and save reference to document capture handler2 //Start capture3 [self.documentCapture forceCapture];
Return | Description |
---|---|
NSError | Error with description, if any occurred. |
Switch Camera
This switches between different cameras.
Objective-C1[handler switchCamera:BIOCameraFront withError:&error];2 [handler switchCamera:BIOCameraRear withError:&error];
Parameter | Description |
---|---|
camera BIOCamera | Flag that selects the camera. |
error NSError** | Object with error code if an error occurred, else nil . |
Overlay
This sets the overlay option.
Objective-C1[self setOverlay:BIOOverlayOFF withError:&error];2 [self setOverlay:BIOOverlayON withError:&error];
Parameter | Description |
---|---|
overlay BIOOverlay | Flag that determines if an overlay should be on or off. |
error NSError** | Object with an error code if an error occurred, else nil . |
Orientation
This sets the orientation option.
Objective-C1[self setOrientation:BIOOrientationPortrait withError:&error];2 [self setOrientation:BIOOrientationUpSideDown withError:&error];3 [self setOrientation:BIOOrientationLandscapeLeft withError:&error];4 [self setOrientation:BIOOrientationLandscapeRight withError:&error];
Parameter | Description |
---|---|
orientation BIOOrientation | Specifies the orientation of the preview. |
error NSError** | Object with error code if an error occurred, else nil . |
Options
This retrieves the capture options used in this handler.
Note: Readonly
Objective-C1DocumentCaptureOptions* options = handler.options;
Partial Dump Video
This dumps the last played sequences.
Objective-C1[handler requestPartialDumpVideoWithError:&error];
Note: To dump a partial video, enable partialDumpVideoRecordEnable
before starting a capture. This option should be set in the DocumentCaptureOptions
that are used when creating the DocumentCaptureHandler
.
Parameter | Description |
---|---|
error NSError** | Object with error code if an error occurred, else nil . |
Destroy
This releases all the handler resources.
Objective-C1[handler destroy];
DocumentCaptureHandlerDelegate
documentHandlerGetTrackingInformation:withError:
This method is called when there is new tracking information with the coordinates of the document position.
Callback for modes:
- DocumentCaptureModeMRZImageMedium
- DocumentCaptureModeBarcodeVeryLowID1
- DocumentCaptureModeVeryLowID
- DocumentCaptureModeVeryLowID1
- DocumentCaptureModeMRZMediumVeryLowID
Objective-C1-(void)documentHandlerGetTrackingInformation:(NSArray<BIODocumentTrackingInformation*>* )trackingInfo2 withError:(NSError*)error
Parameter | Description |
---|---|
trackingInfo NSArray<BIODocumentTrackingInformation*>* | Array of BIODocumentTrackingInformation with the tracking information. |
error NSError* | Error if any occurred, otherwise nil . |
documentHandlerReadMRZ:record:withError:
This method that returns the lines of an MRZ if any is found and its MRZRecord
that contains the information read from the MRZ.
Callback for modes:
- DocumentCaptureModeReadMRZ
Objective-C1-(void)documentHandlerReadMRZ:(NSArray<DocumentMRZLine*>* )lines2 record:(MRZRecord*)record3 withError:(NSError*)error;
Parameter | Description |
---|---|
lines NSArray<DocumentMRZLine*>* | Array of document Lines read from document. |
record MRZRecord* | Object that contains the information read from the MRZ. |
error NSError* | Error if any occurred, otherwise nil . |
documentHandlerCapturedDocumentImage:
This method returns the DocumentImage
of the document read.
Callback for modes:
- DocumentCaptureModeMRZImageMedium
- DocumentCaptureModeBarcodeVeryLowID1
- DocumentCaptureModeVeryLowID
- DocumentCaptureModeVeryLowID1
- DocumentCaptureModeMRZMediumVeryLowID
Objective-C1-(void)documentHandlerCapturedDocumentImage:(DocumentImage*)documentImage
Parameter | Description |
---|---|
documentImage DocumentImage* | Image of the document. |
documentHandlerCapturedDocumentRectificationImage:withLabel:
This method will only be called if the rectification
is set to BIORectificationEnabled
. It returns a DocumentImage
of the rectified region (eg. image of the portrait photo in a passport).
Callback for modes:
- DocumentCaptureModeMRZImageMedium
- DocumentCaptureModeBarcodeVeryLowID1
- DocumentCaptureModeVeryLowID
- DocumentCaptureModeVeryLowID1
- DocumentCaptureModeMRZMediumVeryLowID
Objective-C1-(void)documentHandlerCapturedDocumentRectificationImage:(DocumentImage*)rectificationImage2 withLabel:(NSString*)label
Parameter | Description |
---|---|
rectificationImage DocumentImage* | Rectified image. |
label NSString* | Label to identify where the rectified image is from. |
documentHandlerReadBarCode:withError:
This method is only called when using a barcode capture mode. It returns the content of the barcode read as a string.
Callback for modes:
- DocumentCaptureModeBarcode
- DocumentCaptureModeBarcodePDF417
Objective-C1-(void)documentHandlerReadBarCode:(NSArray<NSString*>* )barcodeInformation2 withError:(NSError*)error
Parameter | Description |
---|---|
barcodeInformation NSArray<NSString*>* | Array with the information retrieved from the barcode. |
error NSError* | Error if any occurred, otherwise nil . |
documentHandlerReadBarCodeData:withError:
This method is only called when using a barcode capture mode. It returns the content of the barcode read as binary data.
Callback for modes:
- DocumentCaptureModeBarcode
- DocumentCaptureModeBarcodePDF417
Objective-C1-(void)documentHandlerReadBarCodeData:(NSArray<NSData> )barcodeInformation2withError:(NSError*)error
Parameter | Description |
---|---|
barcodeInformation NSArray<NSData*>* | Array with the information retrieved from the barcode. |
error NSError* | Error if any occurred, otherwise nil . |
documentHandlerReceiveInfo:withError:
This method is called whenever there is information that should be transmitted to the user (eg. BIODocInfoTooFar
to "Document too far").
Callback for modes:
- DocumentCaptureModeMRZImageMedium
- DocumentCaptureModeBarcodeVeryLowID1
- DocumentCaptureModeVeryLowID
- DocumentCaptureModeVeryLowID1
- DocumentCaptureModeMRZMediumVeryLowID
Objective-C1-(void)documentHandlerReceiveInfo:(BIODocInfo)info2 withError:(NSError*)error;
Parameter | Description |
---|---|
info BIODocInfo | Describes the action to the user that needs to be done to finish capturing. |
error NSError* | Error if any occurred, otherwise nil . |
Helper Objects
DocumentCaptureOptions
This object is used to configure the behavior of a document capture.
Attribute | Description |
---|---|
captureMode DocumentCaptureMode | The app enum option to configure the capture. |
rectification BIORectification | Enables/Disables rectification. |
camera BIOCamera | The app's camera option to configure the capture. |
torch BUITorch | OBSOLETE. Sets the torch value. |
overlay BIOOverlay | Enables/Disables Overlay. |
captureTimeout long | Capture timeout in seconds (default value 120 .) |
logLevel BIOLogLevel | Level of logs that are displayed during debug. |
orientation BIOOrientation | This sets the orientation of the preview. |
dumpFileEnable BOOL | If a dump file is enabled, the capture create logs. |
dumpFileFolder NSString* | Folder where the logs will be saved. If nil , it will be saved on the Documents folder. |
videoRecordEnable BOOL | If video recording is enabled, the capture will be recorded. |
videoRecordFolder NSString* | Folder where recorded videos will be saved. |
partialDumpVideoRecordEnable BOOL | If partial dump video recording is enabled, the capture can be afterwards be recorded. |
partialDumpVideoRecordFolder NSString* | Folder where partial dump recorded videos will be saved. |
minDPI NSUInteger | Minimum DPI for a datapage. Its value should be from 1 up to 400 . The default value depends on used capture mode and resolution scanning, also it is used only for modes that return an image. |
acquisitionQualityLevel BIODocumentAcquisitionQualityLevel | The criteria of doc autocapture restrictiveness. The higher it is set, the higher the acquisition time is. |
stillShootEnabled BOOL | If still shoot is enabled, then the capture is based on a still image instead of a video stream and therefore the captured image has a higher resolution (default value is false ). |
videoRecordingOptions BIOVideoRecordingOptions | If still shoot is enabled, then the capture is based on a still image instead of a video stream and therefore the captured image has a higher resolution (default value is false ). |
feedbackSamplingTime NSTimeInterval | Generate document feedback only after given interval, set in seconds. 0 means no filtering. Defaults to 2 seconds. |
DocumentImage
This is an image object of a document. Subclasses BIOImage.
Parameter | Description |
---|---|
location BIODocLocation | Location of the image in the document. |
trackingInfo NSArray<BIODocumentTrackingInformation*>* | The coordinates of the separate regions of the document, if any. |
buffer NSData* | The image. |
stride int | The stride of the biometric. |
width uint32_t | The width of the image. |
height uint32_t | The height of the image. |
colorSpace BIOColorSpace | The ColorSpace of the image. |
resolution float | The resolution of the image. |
alive BOOL | OBSOLETE. True is alive, otherwise false . |
imageQuality int | Image quality. Only available for fingerprint images, so it will always be 0 . |
docLevel BIODocLevel | Status about doclevel . |
codeMode BIOCodedMode | Status about coded mode. |
DocumentMRZLine
This the object that contains information from the MRZ line on document.
Parameter | Description |
---|---|
lineNumber int | The line number of the MRZ read. |
consorank int | The rank number of the MRZ read. |
text NSString* | The MRZ text line. |
docLevel BIODocLevel | Status about doclevel . |
codeMode BIOCodedMode | Status about coded mode. |
BIODocumentInformation
This object contains information about the location of information that is currently scanned from a document e.g. MRZ section.
Parameter | Description |
---|---|
location BIODocLocation | Flag that reveals the type and location of the current data. |
BIODocumentTrackingInformation
This object contains tracking document information or data on the document information, inherited from BIODocumentInformation
.
Parameter | Description |
---|---|
point1 CGPoint | First point of information coordinates. |
point2 CGPoint | Second point of information coordinates. |
point3 CGPoint | Third point of information coordinates. |
point4 CGPoint | Fourth point of information coordinates. |
relativeSize CGSize | Size that the points are related to. |
Enums
DocumentCaptureMode
This enum is used to configure the behavior of DocumentCapture
.
Attribute | Description |
---|---|
DocumentCaptureModeReadMRZ | Reads MRZ lines. |
DocumentCaptureModeMRZImageMedium | Reads MRZ lines and retrieves an image from the document. Capture is based on a video stream. |
DocumentCaptureModeMRZImageStillMedium | (DEPRECATED) Reads MRZ lines and retrieves an image from the document. Capture is based on a still image. |
DocumentCaptureModeBarcode | Reads a barcode. |
DocumentCaptureModeBarcodePDF417 | Reads a barcode in PDF417 standard. |
DocumentCaptureModeBarcodeVeryLowID1 | Captures an image at the device's best video resolution of a ID1 document with PDF417 barcode standard. |
DocumentCaptureModeVeryLowID1 | Captures an image at the device's best video resolution of a ID1 document. |
DocumentCaptureModeVeryLowID | Captures an image at the device's best video resolution of ID1, ID2, and ID3 documents. |
DocumentCaptureModeMRZMediumVeryLowID | Reads MRZ and captures an image at the device's best video resolution of ID1, ID2, and ID3 documents. |
BIOOCR (OBSOLETE)
This enum is used to enable/disable OCR.
Attribute | Description |
---|---|
BIOOCREnable | Enables OCR |
BIOOCRDisable | Disables OCR |
BIODocLevel
These are the constants used to give information concerning the confidence of the information returned.
Attribute | Description |
---|---|
BIODocLevelVeryLow | Doc level very low |
BIODocLevelLow | Doc level low |
BIODocLevelMedium | Doc level medium |
BIODocLevelHigh | Doc level high |
BIOCodedMode
These are the constants used to gives information concerning the confidence of the information returned.
Attribute | Description |
---|---|
BIOCodedModeNominal | All video quality criteria have been fulfilled: best image returned. |
BIOCodedModeForce | Force capture trigger has been used. |
BIOCodedModeTimeout | Best image returned on timeout. |
BIORectification
This enum is used to enable/disable rectification.
Attribute | Description |
---|---|
BIORectificationEnabled | Enables rectification |
BIORectificationDisabled | Disables rectification |
BIODocInfo
These are the constants that are used to give info about capturing a document.
Attribute | Description |
---|---|
BIODocInfoBlur | BLUR detected |
BIODocInfoBadFraming | Bad framing detected |
BIODocInfoStartStill | Start point and shoot capture |
BIODocInfoEndStill | Point and shoot capture done |
BIODocInfoShaking | Shaking detected |
BIODocInfoReflection | Reflection detected |
BIODocInfoHoldStraight | Hold document straight |
BIODocInfoMovementDetected | Movement detected |
BIODocInfoTooFar | Document is too far |
BIODocInfoTooClose | Document is too close |
BIODocInfoLowLight | Not enough light to capture document |
BIODocInfoOK | Everything is OK |
BIODocLocation
This is the flag used to determine where data is being currently scanned.
Attribute | Description |
---|---|
BIODocLocationMRZ | MRZ region |
BIODocLocationDatapage | Datapage region |
BIODocLocationPhoto | Photo region |
BIODocLocationFull | Full document region |
BIODocLocationUnknown | Unknown region |
BIODocumentAcquisitionQualityLevel
This enum describes the criteria of doc autocapture restrictiveness. When the SDK tries to acquire the best possible image, it does it in intervals which fits within a timeout time. Every interval is less restrictive then a previous one.
Attribute | Description |
---|---|
BIODocumentAcquisitionQualityLevelHigh | When set, this tries to get the best image in three intervals. The first interval is the most restrictive. |
BIODocumentAcquisitionQualityLevelMedium | When set, this tries to get the best image in two intervals. The first interval is less restrictive than in the high level. |
BIODocumentAcquisitionQualityLevelLow | When set, this tries to get the best image in the firs two seconds. If a reflection or a low light condition is detected, they are ignored after the first two seconds. |
DocumentImageQualityIndicators
Object provides quality indicators for taken document image
Parameter | Description |
---|---|
badFraming BOOL | The document has been detected partially. |
blur BOOL | The document is not sharp enough. |
glare BOOL | The document has light reflects. |
tooClose BOOL | The document is too close. |
tooFar BOOL | The document is too far. |
notStraight BOOL | The document is not straight. |
lowLight BOOL | The document lighting conditions are too low. |
badConsistency BOOL | Unable to detect enough consecutive good frames. |
mrzBadDecoding DocumentImageQualityIndicator | Unable to decode MRZ on the document. This property defaults to DocumentImageQualityIndicatorNotApplicable , if this field is not mandatory for the capture. |
pdf417BadDecoding DocumentImageQualityIndicator | Unable to decode PDF 417 on the document. This property defaults to DocumentImageQualityIndicatorNotApplicable , if this field is not mandatory for the capture. |
DocumentImageQualityIndicator
This enum provides information about the indicator.
Attribute | Description |
---|---|
DocumentImageQualityIndicatorFalse | Indicator is false. |
DocumentImageQualityIndicatorTrue | Indicator is true. |
DocumentImageQualityIndicatorNotApplicable | Indicator is not applicable for the capture. |
Use Cases
Read MRZ
This is an example of reading an MRZ document. This use case is intended to be used when the integrator wants to read the MRZ area of a document like on passports, but without retrieving an image of the document.
NOTE: This mode works only for MRZ with 2 or 3 lines. To capture document with 1 line MRZ please use
MRZ + Document Image
mode described in the next section.
Read MRZ with Document Image
This reads a MRZ document and also captures an image of the document. This use case is intended to be used when the integrator wants to read the MRZ area of a document like on passports, and also retrieve an image of the document.
Capture a Document Image
This captures an image of the document. This use case is intended to be used when the integrator wants to retrieve an image of the document.
Compression Recommendations
Document images:
- Recommandation is to send non-segmented images.
- Recommended compression is JPEG92.
- Size of image will be about 1 MB.
Objective-C1- (NSData *)compressDocumentImage:(UIImage *)image {2 CGFloat compressionQuality = 0.92;3 return UIImageJPEGRepresentation(image, compressionQuality);4 }
ImageUtils
SDK provides methods to perform various operations on BIOImage such as for example converting BIOImage to various image formats. Those operations are described below.
Compress BIOImage to JPEG
This is the method of the BIOImage
class that converts the BIOImage
object to NSData
object with JPEG file with default compression quality (90% for finger images, 80% for face images, 70% for document images). Created JPEG will contain capture maker note data inside EXIF metadata containing information such as for example SDK version used for capturing the image.
Objective-C1- (NSData *)toJPEG;
Return | Description |
---|---|
NSData* | JPEG file binary data. |
Compress BIOImage to JPEG with custom quality
This is the method of the BIOImage
class that converts the BIOImage
object to NSData
object with JPEG file with given compression quality level. Created JPEG will contain capture maker note data inside EXIF metadata containing information such as for example SDK version used for capturing the image.
Objective-C1- (NSData *)toJPEGWithQuality:(CGFloat)quality;
Parameter | Description |
---|---|
quality CGFloat | Compression quality in range [0, 1]. |
Return | Description |
---|---|
NSData* | JPEG file binary data. |
Get UIImage from BIOImageFromUIImage
This is the method of UIImage
(BIOImage) extension that converts a BIOImage
to a UIImage
.
Objective-C1+ (UIImage*)imageFromBIOImage:(BIOImage*)bioImage
Parameter | Description |
---|---|
image BIOImage* | BIOImage to convert to UIImage. |
Return | Description |
---|---|
BIOImage* | UIImage from BIOImage. |
Get BIOImage from UIImage
This is the method of the BIOImage
(ImageGetters) extension that converts UIImage
to BIOImage
.
Objective-C1+ (BIOImage*)BIOImageFromUIImage:(UIImage*)image;
Parameter | Description |
---|---|
image UIImage* | UIImage to convert to BIOImage. |
Return | Description |
---|---|
BIOImage* | BIOImage from UIImage. |
Create a BIOImage with Different Color Space
This is the method of the BIOImage
(ImageGetters) extension that converts a BIOImage
to another BIOImage
with a different color space.
Objective-C1- (BIOImage*)BIOImageWithColorSpace:(BIOColorSpace)colorSpace;
Parameter | Description |
---|---|
colorSpace BIOColorSpace | Color space wanted for the new BIOImage . |
Return | Description |
---|---|
BIOImage* | BIOImage with the color space provided. |
Compress Image with Quality to NSData
This is a method of BIOImage
(BIOResize) extension that compresses an image to a NSData*
with determined quality.
Objective-C1- (NSData*)dataByCompressingImageWithQuality:(uint32_t)quality
Parameter | Description |
---|---|
quality uint32_t | Quality of the compression (value between 1 and 100 ). |
Return | Description |
---|---|
NSData* | Final data with compression applied. |
Compress Image with Quality to BIOImage
This is the method of the BIOImage
(BIOResize) extension to compresses an image to a BIOImage*
with determined quality.
Objective-C1- (BIOImage*)imageByCompressingImageWithQuality:(uint32_t)quality
Parameter | Description |
---|---|
quality uint32_t | Quality of the compression (value between 1 and 100 .) |
Return | Description |
---|---|
BIOImage* | Final BIOImage with compression applied. |
Compress Image from Size in Kilobytes to NSData
This is the a method of the BIOImage
(BIOResize) extension to compress an image to a NSData*
with a determined final size in kilobytes.
Objective-C1- (NSData*)dataByCompressingImageToSizeInKilobytes:(CGFloat)sizeInKilobytes
Parameter | Description |
---|---|
sizeInKilobytes CGFloat | Final size in kilobytes. |
Return | Description |
---|---|
NSData* | Final data with compression applied. |
Compress Image from Size in Kilobytes to BIOImage
This is a the method of the BIOImage
(BIOResize) extension to compress an image to a BIOImage*
with a determined final size in kilobytes.
Objective-C1- (BIOImage*)imageByCompressingImageToSizeInKilobytes:(CGFloat)sizeInKilobytes
Parameter | Description |
---|---|
sizeInKilobytes CGFloat | Final size in kilobytes. |
Return | Description |
---|---|
BIOImage* | Final BIOImage with compression applied. |
Compress Image from WSQ Ratio to NSData
This is the method of the BIOImage
(BIOResize) extension to compress an image from WSQ to a NSData*
with a determined WSQ ratio. Only fingerprint images should be used in this method.
Objective-C1- (NSData*)dataByCompressingImageToWSQRatio:(CGFloat)ratio withScannerBlack:(Byte)scannerBlack andScannerWhite:(Byte)scannerWhite;
Parameter | Description |
---|---|
ratio CGFloat | WSQ ratio for the compression (value between 1.6 and 8000 , recommended value between 12 and 15 ). |
scannerBlack Byte | Black calibration value (if unknown use 0 ). |
|scannerWhite Byte | White calibration value (if unknown use 255
).
Return | Description |
---|---|
NSData* | Final data with compression applied. |
Compress Image from WSQ Ratio to BIOImage
This is the method of the BIOImage
(BIOResize) extension that compresses an image to a BIOImage*
with a determined WSQ ratio. Only fingerprint images should be used in this method.
Objective-C1- (BIOImage*)imageByCompressingImageToWSQRatio:(CGFloat)ratio withScannerBlack:(Byte)scannerBlack andScannerWhite:(Byte)scannerWhite;
Parameter | Description |
---|---|
ratio CGFloat | WSQ ratio for the compression (value between 1.6 and 8000 , recommended value between 12 and 15 ). |
|scannerBlack Byte | Black calibration value (if unknown use 0
).
|scannerWhite Byte | White calibration value (if unknown use 255
).
Return | Description |
---|---|
BIOImage* | Final BIOImage with compression applied. |
Compress Image from JPEG2000 to NSData
This is the method of the BIOImage
(BIOResize) extension that compresses and image to a NSData*
in JPEG2000 format with a determined maximum size in kilobytes. Only fingerprint images should be used in this method.
Objective-C1- (NSData*)dataByCompressingImageToJPEG2000InKilobytes:(CGFloat)maximumSizeInKilobytes
Parameter | Description |
---|---|
maximumSizeInKilobytes CGFloat | Maximum size in kilobytes. |
Return | Description |
---|---|
NSData* | Final data with compression applied. |
Compress Image from JPEG2000 to BIOImage
This is the method of the BIOImage
(BIOResize) extension that compresses an image to a JPEG2000 in a BIOImage*
format with a determined maximum size in kilobytes. Only fingerprint images should be used in this method.
Objective-C1- (BIOImage*)imageByCompressingImageToJPEG2000InKilobytes:(CGFloat)maximumSizeInKilobytes
Parameter | Description |
---|---|
maximumSizeInKilobytes CGFloat | Maximum size in kilobytes. |
Return | Description |
---|---|
BIOImage* | Final BIOImage with compression applied. |
Crop Image Region (document)
This is the method of the BIOImage
(RegionCropping) extension to crop a BIOImage
to a determined region.
Objective-C1+ (BIOImage*)cropImage:(BIOImage*)bioImage toRegion:(BIODocumentTrackingInformation*)documentTrackingInfo;
Parameter | Description |
---|---|
bioImage BIOImage* | BIOImage to be cropped. |
documentTrackingInfo BIODocumentTrackingInformation* | Region coordinates that the BIOImage will be cropped to. |
Return | Description |
---|---|
BIOImage* | Final BIOImage with the result of the crop, or nil if an error occurred. |
Crop Image Rect
This is the method of the BIOImage
(Cropping) extension to crop a BIOImage
to a determined rectangle.
Objective-C1- (instancetype _Nullable)cropToRect:(CGRect)rect withMargin:(CGFloat)margin;2- (instancetype _Nullable)cropToRect:(CGRect)rect; // margin = 0
Parameter | Description |
---|---|
rect CGRect | Region coordinates that the BIOImage will be cropped to. |
margin CGFloat | Optional cropping margin |
Return | Description |
---|---|
BIOImage* | Final BIOImage with the result of the crop, or nil if an error occurred. |
Crop Image Points
This is the method of the BIOImage
(Cropping) extension to crop a BIOImage
to a determined rectangle determined by points.
Objective-C1- (instancetype _Nullable)cropToRegionWithPoint1:(CGPoint)point1 point2:(CGPoint)point2 point3: (CGPoint)point3 point4:(CGPoint)point4 withMargin:(CGFloat)margin;2- (instancetype _Nullable)cropToRegionWithPoint1:(CGPoint)point1 point2:(CGPoint)point2 point3: (CGPoint)point3 point4:(CGPoint)point4; // margin = 0
Parameter | Description |
---|---|
point1 CGPoint | First point of the region coordinates that the BIOImage will be cropped to. |
point2 CGPoint | Second point of the region coordinates that the BIOImage will be cropped to. |
point3 CGPoint | Third point of the region coordinates that the BIOImage will be cropped to. |
point4 CGPoint | Fourth point of the region coordinates that the BIOImage will be cropped to. |
margin CGFloat | Optional cropping margin |
Return | Description |
---|---|
BIOImage* | Final BIOImage with the result of the crop, or nil if an error occurred. |