Skip to content

Commit e59739b

Browse files
added v11.4.8
1 parent 1e21748 commit e59739b

File tree

73 files changed

+289
-155
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

73 files changed

+289
-155
lines changed

AcuantCamera/AcuantCamera/Camera/Document/DocumentCameraController.swift

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ import AcuantCommon
4242
private var holdSteadyTimer: Timer!
4343

4444
private let captureTime = 1
45-
private let documentMovementThreshold = 45
46-
private let previewBoundsThreshold: CGFloat = 25
45+
private let documentMovementThreshold = 25
46+
private let previewBoundsThreshold: CGFloat = -5
4747

4848
private var currentStateCount = 0
4949
private var nextState = FrameResult.NO_DOCUMENT
@@ -131,7 +131,7 @@ import AcuantCommon
131131
self.captureSession = DocumentCaptureSession.getDocumentCaptureSession(delegate: self, frameDelegate: self, autoCaptureDelegate: self, captureDevice: captureDevice)
132132
self.captureSession.start()
133133
self.videoPreviewLayer = AVCaptureVideoPreviewLayer(session: self.captureSession)
134-
self.videoPreviewLayer.videoGravity = AVLayerVideoGravity.resizeAspectFill
134+
self.videoPreviewLayer.videoGravity = AVLayerVideoGravity.resizeAspect
135135
self.videoPreviewLayer.frame = self.view.layer.bounds
136136
self.videoPreviewLayer.connection?.videoOrientation = .portrait
137137

@@ -158,8 +158,9 @@ import AcuantCommon
158158
}
159159

160160
public func documentCaptured(image: UIImage, barcodeString: String?) {
161-
let result = Image()
162-
result.image = rotateImage(image: image)
161+
let result = AcuantImagePreparation.createCameraImage(image: rotateImage(image: image), data: AcuantCameraMetaData().setCaptureType(captureType: autoCapture ? "AUTO" : "TAP"))
162+
//result.image = rotateImage(image: image)
163+
//result.captureType = autoCapture ? "AUTO" : "TAP"
163164
self.navigationController?.popViewController(animated: true)
164165
self.cameraCaptureDelegate?.setCapturedImage(image: result, barcodeString: barcodeString)
165166
}

AcuantCamera/AcuantCamera/Camera/Document/DocumentCaptureSession.swift

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,13 @@ import AcuantImagePreparation
3939
private var devicePreviewResolutionLongerSide = CaptureConstants.CAMERA_PREVIEW_LONGER_SIDE_STANDARD
4040
weak private var frameDelegate:FrameAnalysisDelegate? = nil
4141

42+
public override init() {
43+
super.init()
44+
if #available(iOS 13.0, *) {
45+
stillImageOutput.maxPhotoQualityPrioritization = .quality
46+
}
47+
}
48+
4249
public class func getDocumentCaptureSession(delegate:DocumentCaptureDelegate?, frameDelegate: FrameAnalysisDelegate, autoCaptureDelegate:AutoCaptureDelegate, captureDevice:AVCaptureDevice?)-> DocumentCaptureSession{
4350
return DocumentCaptureSession().getDocumentCaptureSession(delegate: delegate!, frameDelegate: frameDelegate, autoCaptureDelegate: autoCaptureDelegate, captureDevice: captureDevice)
4451
}
@@ -259,15 +266,18 @@ import AcuantImagePreparation
259266

260267
func capturePhoto() {
261268
let photoSetting = AVCapturePhotoSettings.init(format: [AVVideoCodecKey: AVVideoCodecType.jpeg])
262-
photoSetting.isAutoStillImageStabilizationEnabled = true
269+
if #available(iOS 13.0, *) {
270+
photoSetting.photoQualityPrioritization = .quality
271+
} else {
272+
photoSetting.isAutoStillImageStabilizationEnabled = true
273+
}
263274
self.stillImageOutput.capturePhoto(with: photoSetting, delegate: self)
264275
}
265276

266277
func detectImage(image:UIImage)->Image?{
267-
let croppingData = CroppingData()
268-
croppingData.image = image
278+
let detectData = DetectData.newInstance(image: image)
269279

270-
let croppedImage = AcuantImagePreparation.detect(data: croppingData)
280+
let croppedImage = AcuantImagePreparation.detect(detectData: detectData)
271281
return croppedImage
272282
}
273283
}

AcuantCamera/AcuantCamera/Camera/Mrz/AcuantMrzCaptureSession.swift

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -185,10 +185,9 @@ import AcuantImagePreparation
185185
}
186186

187187
func detectImage(image:UIImage)->Image?{
188-
let croppingData = CroppingData()
189-
croppingData.image = image
188+
let detectData = DetectData.newInstance(image: image)
190189

191-
let croppedImage = AcuantImagePreparation.cropMrz(data: croppingData)
190+
let croppedImage = AcuantImagePreparation.cropMrz(detectData: detectData)
192191
return croppedImage
193192
}
194193
}

AcuantFaceCapture/AcuantFaceCapture/AcuantFaceCaptureSession.swift

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -126,19 +126,25 @@ import AVFoundation
126126
}
127127

128128
func isGoodSizeFace(face: CIFaceFeature, previewLayerSize:CGSize)-> AcuantFaceState{
129-
let scale_min:CGFloat = 0.12
130-
let scale_max:CGFloat = 0.5
131-
let faceArea = face.bounds.width * face.bounds.height
132-
let totalArea = previewLayerSize.width * previewLayerSize.height
129+
let bounds = UIScreen.main.bounds
130+
let width = bounds.size.width
131+
let height = bounds.size.height
132+
let screenRatio = max(width, height) / min(width, height)
133+
let cameraRatio = max(previewLayerSize.width, previewLayerSize.height) / min(previewLayerSize.width, previewLayerSize.height)
133134

134-
if(faceArea < scale_min * totalArea){
135-
return AcuantFaceState.FACE_TOO_FAR
135+
let TOO_CLOSE_THRESH: CGFloat = 0.235 * screenRatio / cameraRatio
136+
let TOO_FAR_THRESH: CGFloat = 0.385 * screenRatio / cameraRatio
137+
let ratioToEdges = 1 - face.bounds.height/previewLayerSize.height
138+
139+
140+
if (isFaceInBound(facePosition : face.bounds, previewLayerSize:previewLayerSize)){
141+
return AcuantFaceState.FACE_NOT_IN_FRAME
136142
}
137-
else if (faceArea > scale_max * totalArea){
143+
else if (ratioToEdges < TOO_CLOSE_THRESH){
138144
return AcuantFaceState.FACE_TOO_CLOSE
139145
}
140-
else if (isFaceInBound(facePosition : face.bounds, previewLayerSize:previewLayerSize)){
141-
return AcuantFaceState.FACE_NOT_IN_FRAME
146+
else if(ratioToEdges > TOO_FAR_THRESH){
147+
return AcuantFaceState.FACE_TOO_FAR
142148
}
143149
else if (doesFaceHaveAngle(hasAnglePosition: face.hasFaceAngle, faceAngle: face.faceAngle)){
144150
return AcuantFaceState.FACE_HAS_ANGLE

AcuantiOSSDKV11.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Pod::Spec.new do |s|
33
s.swift_versions = ['5.3.2']
44
s.ios.deployment_target = '11.0'
55
s.name = "AcuantiOSSDKV11"
6-
s.version = "11.4.7"
6+
s.version = "11.4.8"
77
s.summary = "Acuant's latest SDK with most advanced image capture technology and optimized user workflow "
88
s.description = "Acuant's latest SDK with most advanced image capture technology and optimized user workflow.
99
-18.8 KB
Binary file not shown.

EmbeddedFrameworks/AcuantCommon.framework/Headers/AcuantCommon-Swift.h

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -362,15 +362,6 @@ SWIFT_CLASS("_TtC12AcuantCommon10Credential")
362362
+ (void)setEndpointsWithEndpoints:(Endpoints * _Nonnull)endpoints;
363363
@end
364364

365-
@class UIImage;
366-
367-
SWIFT_CLASS("_TtC12AcuantCommon12CroppingData")
368-
@interface CroppingData : NSObject
369-
@property (nonatomic, strong) UIImage * _Nullable image;
370-
+ (CroppingData * _Nonnull)newInstance SWIFT_WARN_UNUSED_RESULT;
371-
- (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER;
372-
@end
373-
374365
typedef SWIFT_ENUM(NSInteger, DeleteType, open) {
375366
DeleteTypeID = 0,
376367
DeleteTypeMedicalCard = 1,
@@ -399,17 +390,21 @@ SWIFT_CLASS("_TtC12AcuantCommon9Endpoints")
399390
- (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER;
400391
@end
401392

393+
@class UIImage;
394+
@class NSMutableData;
402395

403396
SWIFT_CLASS("_TtC12AcuantCommon5Image")
404397
@interface Image : NSObject
405398
@property (nonatomic, strong) UIImage * _Nullable image;
399+
@property (nonatomic, strong) NSMutableData * _Nullable data;
406400
@property (nonatomic) NSInteger dpi;
407401
@property (nonatomic, strong) AcuantError * _Nullable error;
408402
@property (nonatomic) BOOL isCorrectAspectRatio;
409403
@property (nonatomic) float aspectRatio;
410404
@property (nonatomic, copy) NSArray<NSValue *> * _Nonnull points;
411405
@property (nonatomic) BOOL isPassport;
412406
+ (Image * _Nonnull)newInstance SWIFT_WARN_UNUSED_RESULT;
407+
+ (Image * _Nonnull)newInstanceWithImage:(UIImage * _Nonnull)image data:(NSMutableData * _Nullable)data SWIFT_WARN_UNUSED_RESULT;
413408
- (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER;
414409
@end
415410

0 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)