Update session params
This commit is contained in:
parent
96da0eccc2
commit
cdf170eeda
|
|
@ -32,7 +32,7 @@ open class CardReader: BaseReader<Card> {
|
|||
|
||||
private var request: VNRecognizeTextRequest {
|
||||
let request = VNRecognizeTextRequest(completionHandler: recognizeTextHandler)
|
||||
request.recognitionLevel = .accurate
|
||||
request.recognitionLevel = .fast
|
||||
request.usesLanguageCorrection = false
|
||||
|
||||
return request
|
||||
|
|
@ -63,20 +63,12 @@ open class CardReader: BaseReader<Card> {
|
|||
session.addInput(defaultDeviceInput)
|
||||
}
|
||||
|
||||
session.sessionPreset = .hd1920x1080
|
||||
|
||||
videoDataOutput.alwaysDiscardsLateVideoFrames = true
|
||||
videoDataOutput.setSampleBufferDelegate(self, queue: scannerObjectsQueue)
|
||||
videoDataOutput.videoSettings = [kCVPixelBufferPixelFormatTypeKey as String: kCVPixelFormatType_420YpCbCr8BiPlanarFullRange]
|
||||
videoDataOutput.videoSettings = [kCVPixelBufferPixelFormatTypeKey as String: kCVPixelFormatType_32BGRA]
|
||||
|
||||
session.addOutput(videoDataOutput)
|
||||
|
||||
if ((try? defaultDevice?.lockForConfiguration()) != nil) {
|
||||
defaultDevice?.videoZoomFactor = 2
|
||||
defaultDevice?.autoFocusRangeRestriction = .near
|
||||
defaultDevice?.unlockForConfiguration()
|
||||
}
|
||||
|
||||
previewLayer.videoGravity = .resizeAspectFill
|
||||
|
||||
session.commitConfiguration()
|
||||
|
|
|
|||
Loading…
Reference in New Issue