├── .gitignore ├── CHANGELOG.md ├── ID-Card-Camera.podspec ├── IDCardCamera.xcodeproj ├── project.pbxproj └── project.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ ├── IDEWorkspaceChecks.plist │ └── swiftpm │ └── Package.resolved ├── LICENCE ├── Package.resolved ├── Package.swift ├── README.md ├── Sources ├── IDCardCamera │ ├── BarcodeDetectionSettings.swift │ ├── BarcodeDetectionViewController.swift │ ├── BarcodeDetectionViewControllerDelegate.swift │ ├── BaseCardDetectionViewController.swift │ ├── Bundle+IDCardCamera.swift │ ├── CMSampleBuffer+CGImage.swift │ ├── CardAndBarcodeDetectionSettings.swift │ ├── CardAndBarcodeDetectionViewController.swift │ ├── CardAndBarcodeDetectionViewControllerDelegate.swift │ ├── CardDetectionSettings.swift │ ├── CardDetectionViewController.swift │ ├── CardDetectionViewControllerDelegate.swift │ ├── DetectionOperations.swift │ ├── IDCardCamera.docc │ │ └── IDCardCamera.md │ ├── IDCardCamera.h │ ├── ObjectDetectionSessionHandler.swift │ ├── ObjectDetectionViewController.swift │ ├── Resources │ │ ├── BarcodeDetectionViewController.xib │ │ ├── Base.xcconfig │ │ ├── CardDetectionViewController.xib │ │ ├── Info.plist │ │ └── Media.xcassets │ │ │ ├── Contents.json │ │ │ ├── torch_off.imageset │ │ │ ├── Contents.json │ │ │ ├── torch_off.png │ │ │ ├── torch_off@2x.png │ │ │ └── torch_off@3x.png │ │ │ └── torch_on.imageset │ │ │ ├── Contents.json │ │ │ ├── torch_on.png │ │ │ ├── torch_on@2x.png │ │ │ └── torch_on@3x.png │ └── TorchSettings.swift ├── IDCardCameraResources │ └── Info.plist └── TestApp │ ├── AppDelegate.swift │ ├── Resources │ ├── Assets.xcassets │ │ ├── AppIcon.appiconset │ │ │ └── Contents.json │ │ └── Contents.json │ ├── Base.lproj │ │ ├── LaunchScreen.storyboard │ │ └── Main.storyboard │ └── Info.plist │ ├── ResultViewController.swift │ └── ViewController.swift ├── build-docs.sh └── docs ├── css └── site.css ├── documentation └── idcardcamera │ ├── barcodedetectionsettings │ ├── index.html │ └── torchlevel.html │ ├── barcodedetectionsettingserror │ ├── !=(_:_:).html │ ├── equatable-implementations.html │ ├── error-implementations.html │ ├── hashvalue.html │ ├── index.html │ ├── localizeddescription.html │ ├── rawrepresentable-implementations.html │ └── unsupportedbarcodesymbology.html │ ├── barcodedetectionviewcontroller │ ├── delegate.html │ ├── index.html │ ├── init(settings:).html │ ├── presentationcontrollerdiddismiss(_:).html │ ├── settings.html │ └── viewdidload().html │ ├── barcodedetectionviewcontrollerdelegate │ ├── barcodedetectionviewcontroller(_:diddetectbarcodes:).html │ ├── barcodedetectionviewcontrollerdidcancel(_:).html │ └── index.html │ ├── basebarcodedetectionsettings │ ├── barcodesymbologies.html │ ├── index.html │ └── init(barcodesymbologies:).html │ ├── basecarddetectionsettings │ ├── imagepoolsize.html │ ├── index.html │ ├── init().html │ ├── init(width:height:).html │ ├── orientation-swift.enum │ │ ├── !=(_:_:).html │ │ ├── equatable-implementations.html │ │ ├── hash(into:).html │ │ ├── hashvalue.html │ │ ├── index.html │ │ ├── landscape.html │ │ ├── portrait.html │ │ └── rawrepresentable-implementations.html │ ├── orientation-swift.property.html │ └── size.html │ ├── basecarddetectionviewcontroller │ ├── index.html │ ├── init().html │ ├── observevalue(forkeypath:of:change:context:).html │ ├── presentationcontrollerdiddismiss(_:).html │ └── viewdidload().html │ ├── cardandbarcodedetectionsettings │ ├── barcodedetectionsettings.html │ ├── carddetectionsettings.html │ ├── index.html │ ├── init().html │ ├── init(width:height:barcodesymbologies:).html │ └── torchlevel.html │ ├── cardandbarcodedetectionviewcontroller │ ├── delegate.html │ ├── index.html │ ├── init(settings:).html │ ├── settings.html │ └── viewdidload().html │ ├── cardandbarcodedetectionviewcontrollerdelegate │ ├── cardandbarcodedetectionviewcontroller(_:diddetectcard:andbarcodes:withsettings:).html │ ├── cardandbarcodedetectionviewcontrollerdidcancel(_:).html │ ├── index.html │ └── qualityofimage(_:).html │ ├── carddetectionsettings │ ├── index.html │ └── torchlevel.html │ ├── carddetectionviewcontroller │ ├── delegate.html │ ├── index.html │ ├── init().html │ ├── settings.html │ └── viewdidload().html │ ├── carddetectionviewcontrollerdelegate │ ├── carddetectionviewcontroller(_:diddetectcard:withsettings:).html │ ├── carddetectionviewcontrollerdidcancel(_:).html │ ├── index.html │ └── qualityofimage(_:).html │ ├── index.html │ ├── objectdetectionviewcontroller │ ├── index.html │ ├── prefersstatusbarhidden.html │ ├── presentationcontrollerdiddismiss(_:).html │ ├── viewdidappear(_:).html │ ├── viewdidload().html │ ├── viewwilldisappear(_:).html │ └── viewwilltransition(to:with:).html │ ├── perspectivecorrectionparamsoperation │ ├── index.html │ ├── init(pixelbuffer:orientation:rect:).html │ └── main().html │ └── torchsettings │ ├── index.html │ └── torchlevel.html ├── favicon.ico ├── favicon.svg ├── img ├── added-icon.svg ├── deprecated-icon.svg └── modified-icon.svg └── index.html /.gitignore: -------------------------------------------------------------------------------- 1 | IDCardCamera.xcodeproj/project.xcworkspace/xcuserdata 2 | IDCardCamera.xcodeproj/xcuserdata 3 | build 4 | build-docs-log.txt 5 | .swiftpm 6 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Change log 2 | 3 | ## 1.4.2 4 | - Framework now available as Swift Package 5 | - Added documentation catalogue 6 | - Bug fixes 7 | 8 | ## 1.4.1 9 | - More reliable interface orientation detection 10 | - Framework now available in app extensions 11 | - Bug fixes 12 | 13 | ## 1.4.0 14 | - Added scanning of barcodes on the back of the ID card 15 | 16 | ## 1.3.1 17 | - Fixed a bug where the whole unstraightened image was being passed to the delegate for quality detection 18 | 19 | ## 1.3.0 20 | - Added optional delegate method to allow the delegate to determine the quality of the detected images 21 | 22 | ## 1.2.1 23 | - Make the size of the corners of the card template consistent in landscape and portrait orientations 24 | - Ensure card template isn't cut off when the device is in landscape orientation 25 | 26 | ## 1.2.0 27 | - Added torch level setting (default is too strong for scanning cards at close range) 28 | 29 | ## 1.1.0 30 | - Collect a pool of images instead of just one and return the best (sharpest) image 31 | 32 | ## 1.0.1 33 | - Added sample app target in the Xcode project -------------------------------------------------------------------------------- /ID-Card-Camera.podspec: -------------------------------------------------------------------------------- 1 | Pod::Spec.new do |s| 2 | s.name = 'ID-Card-Camera' 3 | s.module_name = 'IDCardCamera' 4 | s.version = '1.4.2' 5 | s.summary = 'Detects an ID card in a camera view and returns the de-warped image of the ID card.' 6 | s.homepage = 'https://github.com/AppliedRecognition' 7 | s.license = { :type => 'MIT', :file => 'LICENCE' } 8 | s.author = { 'jakubdolejs' => 'jakubdolejs@gmail.com' } 9 | s.source = { :git => 'https://github.com/AppliedRecognition/ID-Card-Camera.git', :tag => "v#{s.version}" } 10 | s.platform = :ios, '11.0' 11 | s.swift_version = '5' 12 | s.source_files = 'Sources/IDCardCamera/*.swift' 13 | s.resource_bundle = { 'IDCardCameraResources' => 'Sources/IDCardCamera/Resources/*.{xcassets,xib}' } 14 | s.frameworks = 'UIKit', 'Vision', 'Accelerate', 'CoreMedia', 'AVFoundation' 15 | s.app_spec do |app| 16 | app.source_files = 'Sources/TestApp/*.swift' 17 | app.resource = 'Sources/TestApp/**/*.{xib,xcassets}' 18 | end 19 | end 20 | -------------------------------------------------------------------------------- /IDCardCamera.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /IDCardCamera.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /IDCardCamera.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved: -------------------------------------------------------------------------------- 1 | { 2 | "object": { 3 | "pins": [ 4 | { 5 | "package": "AAMVABarcodeParser", 6 | "repositoryURL": "https://github.com/AppliedRecognition/AAMVA-Barcode-Parser-Apple.git", 7 | "state": { 8 | "branch": null, 9 | "revision": "f7e7a12e52b55b2cd24447926ada3de7cf9080d5", 10 | "version": "1.4.1" 11 | } 12 | } 13 | ] 14 | }, 15 | "version": 1 16 | } 17 | -------------------------------------------------------------------------------- /LICENCE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2019 jakubdolejs 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /Package.resolved: -------------------------------------------------------------------------------- 1 | { 2 | "object": { 3 | "pins": [ 4 | { 5 | "package": "AAMVABarcodeParser", 6 | "repositoryURL": "https://github.com/AppliedRecognition/AAMVA-Barcode-Parser-Apple.git", 7 | "state": { 8 | "branch": null, 9 | "revision": "f7e7a12e52b55b2cd24447926ada3de7cf9080d5", 10 | "version": "1.4.1" 11 | } 12 | } 13 | ] 14 | }, 15 | "version": 1 16 | } 17 | -------------------------------------------------------------------------------- /Package.swift: -------------------------------------------------------------------------------- 1 | // swift-tools-version: 5.5 2 | import PackageDescription 3 | 4 | let package = Package( 5 | name: "IDCardCamera", 6 | defaultLocalization: "en", 7 | platforms: [ 8 | .iOS(.v11) 9 | ], 10 | products: [ 11 | .library( 12 | name: "IDCardCamera", 13 | targets: ["IDCardCamera"] 14 | ) 15 | ], 16 | dependencies: [ 17 | .package(name: "AAMVABarcodeParser", url: "https://github.com/AppliedRecognition/AAMVA-Barcode-Parser-Apple.git", from: "1.4.1") 18 | ], 19 | targets: [ 20 | .target( 21 | name: "IDCardCamera", 22 | exclude: ["Bundle+IDCardCamera.swift", "Resources/Info.plist", "Resources/Base.xcconfig"] 23 | ), 24 | .target( 25 | name: "TestApp", 26 | dependencies: [ 27 | "IDCardCamera", 28 | "AAMVABarcodeParser" 29 | ], 30 | exclude: ["Resources/Info.plist"] 31 | ) 32 | ] 33 | ) 34 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ![Cocoapods](https://img.shields.io/cocoapods/v/ID-Card-Camera.svg) 2 | 3 | # ID Card Camera 4 | 5 | - Detects an ID card in a camera view and returns the de-warped image of the ID card. 6 | - Scans PDF417 barcode on the back side of an ID card. 7 | 8 | ## Installation 9 | 10 | ### Using [CocoaPods](https://cocoapods.org/) 11 | 12 | Add the following pod in your **Podfile** and run `pod install`. 13 | 14 | ```ruby 15 | pod 'ID-Card-Camera', '~> 1.0' 16 | ``` 17 | 18 | ### Using [Swift Package Manager](https://www.swift.org/package-manager/) 19 | 20 | - In Xcode select **File -> Add Packages ...** from the top menu. 21 | - Enter `https://github.com/AppliedRecognition/ID-Card-Camera.git` in the search bar. 22 | - Click the **Add Package** button. 23 | 24 | ## Usage 25 | 26 | ```swift 27 | import UIKit 28 | import IDCardCamera 29 | 30 | class ViewController: UIViewController, CardDetectionViewControllerDelegate { 31 | 32 | @IBOutlet var imageView: UIImageView! 33 | 34 | func scanIDCard() { 35 | // Set the scan settings 36 | // In this example the aspect ratio is that of a typical credit card 37 | // The width and height units are not important 38 | let settings = CardDetectionSettings(width: 85.6, height: 53.98) 39 | 40 | // Create the view controller 41 | let controller = CardDetectionViewController() 42 | 43 | // Set the delegate that will receive the result 44 | controller.delegate = self 45 | 46 | // Present the card detection view controller 47 | self.present(controller, animated: true, completion: nil) 48 | } 49 | 50 | func cardDetectionViewController(_ viewController: CardDetectionViewController, didDetectCard image: CGImage, withSettings settings: CardDetectionSettings) { 51 | // The card has been scanned 52 | // Display the image in the image view 53 | self.imageView.image = UIImage(cgImage: image) 54 | } 55 | } 56 | ``` 57 | 58 | ## [API documentation](https://appliedrecognition.github.io/ID-Card-Camera/) 59 | 60 | ## [Change log](./CHANGELOG.md) 61 | -------------------------------------------------------------------------------- /Sources/IDCardCamera/BarcodeDetectionSettings.swift: -------------------------------------------------------------------------------- 1 | // 2 | // BarcodeDetectionSettings.swift 3 | // IDCardCamera 4 | // 5 | // Created by Jakub Dolejs on 19/12/2019. 6 | // Copyright © 2019 Applied Recognition Inc. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | import Vision 11 | 12 | /// Barcode detection settings 13 | /// - Since: 1.4.0 14 | @objc public class BarcodeDetectionSettings: BaseBarcodeDetectionSettings, TorchSettings { 15 | 16 | /// Set the torch level when the user turns the torch on 17 | /// 18 | /// Range `0.0` (darkest) – `1` (brightest). Default value is `0.1`. 19 | /// - Since: 1.4.0 20 | @objc public var torchLevel: Float = 0.1 21 | } 22 | 23 | /// Base class for barcode detection settings 24 | /// - Since: 1.4.0 25 | @objc public class BaseBarcodeDetectionSettings: NSObject { 26 | 27 | /// Symbologies of barcodes to detect 28 | /// - Since: 1.4.0 29 | @objc public let barcodeSymbologies: [VNBarcodeSymbology] 30 | 31 | /// Initializer 32 | /// - Parameter barcodeSymbologies: Symbologies of barcodes to detect 33 | /// - Throws: Barcode detection settings error when attempting to initialize the settings with an unsupported barcode symbology 34 | /// - Since: 1.4.0 35 | @objc public init(barcodeSymbologies: [VNBarcodeSymbology]) throws { 36 | self.barcodeSymbologies = try barcodeSymbologies.filter({ 37 | if !VNDetectBarcodesRequest.supportedSymbologies.contains($0) { 38 | throw BarcodeDetectionSettingsError.unsupportedBarcodeSymbology 39 | } 40 | return true 41 | }) 42 | } 43 | } 44 | 45 | /// Barcode detection settings error 46 | /// - Since: 1.4.0 47 | @objc public enum BarcodeDetectionSettingsError: Int, Error { 48 | /// Unsupported barcode symbology error 49 | /// - Since: 1.4.0 50 | case unsupportedBarcodeSymbology 51 | } 52 | -------------------------------------------------------------------------------- /Sources/IDCardCamera/BarcodeDetectionViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // BarcodeDetectionViewController.swift 3 | // VerIDIDCapture 4 | // 5 | // Created by Jakub Dolejs on 02/01/2018. 6 | // Copyright © 2018 Applied Recognition, Inc. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | import AVFoundation 11 | import Vision 12 | 13 | /// Barcode detection view controller 14 | /// - Since: 1.4.0 15 | public class BarcodeDetectionViewController: ObjectDetectionViewController { 16 | 17 | /// Barcode detection view controller delegate 18 | /// - Since: 1.4.0 19 | @objc public weak var delegate: BarcodeDetectionViewControllerDelegate? 20 | 21 | /// Barcode detection settings 22 | /// - Since: 1.4.0 23 | @objc public let settings: BarcodeDetectionSettings 24 | 25 | /// Initializer 26 | /// - Parameter settings: Barcode detection settings 27 | /// - Since: 1.4.0 28 | @objc public init(settings: BarcodeDetectionSettings) { 29 | self.settings = settings 30 | super.init(nibName: "BarcodeDetectionViewController", bundle: Bundle.module) 31 | } 32 | 33 | required init?(coder: NSCoder) { 34 | fatalError("init(coder:) has not been implemented") 35 | } 36 | 37 | public override func viewDidLoad() { 38 | super.viewDidLoad() 39 | self.sessionHandler.torchSettings = self.settings 40 | self.sessionHandler.barcodeDetectionSettings = self.settings 41 | } 42 | 43 | override func sessionHandler(_ handler: ObjectDetectionSessionHandler, didDetectBarcodes barcodes: [VNBarcodeObservation]) { 44 | self.sessionHandler.delegate = nil 45 | DispatchQueue.main.async { 46 | guard self.isViewLoaded else { 47 | return 48 | } 49 | self.dismiss() 50 | self.delegate?.barcodeDetectionViewController(self, didDetectBarcodes: barcodes) 51 | self.delegate = nil 52 | } 53 | } 54 | 55 | override func shouldDetectBarcodeWithSessionHandler(_ handler: ObjectDetectionSessionHandler) -> Bool { 56 | return true 57 | } 58 | 59 | @IBAction override func cancel() { 60 | super.cancel() 61 | self.delegateCancel() 62 | } 63 | 64 | public override func presentationControllerDidDismiss(_ presentationController: UIPresentationController) { 65 | self.delegateCancel() 66 | } 67 | 68 | private func delegateCancel() { 69 | self.delegate?.barcodeDetectionViewControllerDidCancel?(self) 70 | self.delegate = nil 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /Sources/IDCardCamera/BarcodeDetectionViewControllerDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // BarcodeDetectionViewControllerDelegate.swift 3 | // IDCardCamera 4 | // 5 | // Created by Jakub Dolejs on 19/12/2019. 6 | // Copyright © 2019 Applied Recognition Inc. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | import Vision 11 | 12 | /// Barcode detection view controller delegate 13 | /// - Since: 1.4.0 14 | @objc public protocol BarcodeDetectionViewControllerDelegate: AnyObject { 15 | 16 | /// Called when barcode detection succeeds 17 | /// - Parameters: 18 | /// - viewController: View controller that detected the barcode 19 | /// - data: Raw barcode data 20 | /// - Since: 1.4.0 21 | @objc func barcodeDetectionViewController(_ viewController: BarcodeDetectionViewController, didDetectBarcodes barcodes: [VNBarcodeObservation]) 22 | 23 | /// Called when barcode detection is cancelled 24 | /// - Parameter viewController: View controller that was used for barcode detection 25 | /// - Since: 1.4.0 26 | @objc optional func barcodeDetectionViewControllerDidCancel(_ viewController: BarcodeDetectionViewController) 27 | } 28 | -------------------------------------------------------------------------------- /Sources/IDCardCamera/Bundle+IDCardCamera.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Bundle+IDCardCamera.swift 3 | // IDCardCamera 4 | // 5 | // Created by Jakub Dolejs on 15/11/2021. 6 | // Copyright © 2021 Applied Recognition Inc. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | extension Bundle { 12 | static let module: Bundle? = { 13 | guard let url = Bundle(for: BaseCardDetectionViewController.self).url(forResource: "IDCardCameraResources", withExtension: "bundle"), let idCamBundle = Bundle(url: url) else { 14 | return nil 15 | } 16 | return idCamBundle 17 | }() 18 | } 19 | -------------------------------------------------------------------------------- /Sources/IDCardCamera/CardAndBarcodeDetectionSettings.swift: -------------------------------------------------------------------------------- 1 | // 2 | // CardAndBarcodeDetectionSettings.swift 3 | // IDCardCamera 4 | // 5 | // Created by Jakub Dolejs on 19/12/2019. 6 | // Copyright © 2019 Applied Recognition Inc. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | import Vision 11 | 12 | /// Combined card and barcode detection settings 13 | /// - Since: 1.4.0 14 | @objc public class CardAndBarcodeDetectionSettings: NSObject, TorchSettings { 15 | 16 | /// Set the torch level when the user turns the torch on 17 | /// 18 | /// Range `0.0` (darkest) – `1` (brightest). Default value is `0.1`. 19 | /// - Since: 1.4.0 20 | @objc public var torchLevel: Float = 0.1 21 | 22 | /// Card detection settings (for the front side of the card) 23 | /// - Since: 1.4.0 24 | @objc public let cardDetectionSettings: BaseCardDetectionSettings 25 | 26 | /// Barcode detection settings (for the back of the card) 27 | /// - Since: 1.4.0 28 | @objc public let barcodeDetectionSettings: BaseBarcodeDetectionSettings 29 | 30 | /// Initializer 31 | /// - Parameters: 32 | /// - width: Width of the card (units don't matter) 33 | /// - height: Height of the card (units don't matter) 34 | /// - barcodeSymbologies: Barcode symbologies to look for 35 | /// - Since: 1.4.0 36 | @objc public init(width: CGFloat, height: CGFloat, barcodeSymbologies: [VNBarcodeSymbology]) throws { 37 | self.cardDetectionSettings = BaseCardDetectionSettings(width: width, height: height) 38 | self.barcodeDetectionSettings = try BaseBarcodeDetectionSettings(barcodeSymbologies: barcodeSymbologies) 39 | } 40 | 41 | /// Convenience initializer 42 | /// 43 | /// Initializes settings with ISO ID-1 dimensions and PDF417 barcode 44 | /// - Since: 1.4.0 45 | @objc public override init() { 46 | self.cardDetectionSettings = BaseCardDetectionSettings() 47 | self.barcodeDetectionSettings = try! BaseBarcodeDetectionSettings(barcodeSymbologies: VNDetectBarcodesRequest.supportedSymbologies.contains(.pdf417) ? [.pdf417] : []) 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /Sources/IDCardCamera/CardAndBarcodeDetectionViewControllerDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // CardAndBarcodeDetectionViewControllerDelegate.swift 3 | // IDCardCamera 4 | // 5 | // Created by Jakub Dolejs on 19/12/2019. 6 | // Copyright © 2019 Applied Recognition Inc. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | import Vision 11 | 12 | /// Delegate for combined detection of front and back of the card 13 | /// - Since: 1.4.0 14 | @objc public protocol CardAndBarcodeDetectionViewControllerDelegate: AnyObject { 15 | 16 | /// Called when the detection finishes 17 | /// - Parameters: 18 | /// - viewController: View controller that detected the card and barcodes 19 | /// - image: Image of the front of the detected card straightened to fit the rectangle specified in settings 20 | /// - barcodes: Barcodes detected in the session (empty array if user skips the barcode detection) 21 | /// - settings: Settings used for the card and barcode detection 22 | /// - Since: 1.4.0 23 | @objc func cardAndBarcodeDetectionViewController(_ viewController: CardAndBarcodeDetectionViewController, didDetectCard image: CGImage, andBarcodes barcodes: [VNBarcodeObservation], withSettings settings: CardAndBarcodeDetectionSettings) 24 | 25 | /// Called when the detection is cancelled 26 | /// - Parameter viewController: View controller that was used for detection 27 | /// - Since: 1.4.0 28 | @objc optional func cardAndBarcodeDetectionViewControllerDidCancel(_ viewController: CardAndBarcodeDetectionViewController) 29 | 30 | /// Called when an image is straightened 31 | /// 32 | /// Implement in your delegate to determine the image quality. By default the quality is determined by 33 | /// the sharpness of the image. However, sharpness detection is only available on iOS 13 and newer. 34 | /// If you wish to keep the sharpness detection and implement your own image quality scoring for iOS 12 35 | /// and older return `nil` on iOS 13 and your score on iOS 12 and older. 36 | /// - Parameter image: Image 37 | /// - Returns: Score representing the quality of the image (higher score is better than lower) 38 | /// - Since: 1.4.0 39 | @objc optional func qualityOfImage(_ image: CGImage) -> NSNumber? 40 | } 41 | -------------------------------------------------------------------------------- /Sources/IDCardCamera/CardDetectionSettings.swift: -------------------------------------------------------------------------------- 1 | // 2 | // CardDetectionSettings.swift 3 | // IDCardCamera 4 | // 5 | // Created by Jakub Dolejs on 11/12/2019. 6 | // Copyright © 2019 Applied Recognition Inc. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | /// Card detection session settings 12 | /// - Since: 1.0.0 13 | @objc public class CardDetectionSettings: BaseCardDetectionSettings, TorchSettings { 14 | 15 | /// Set the torch level when the user turns the torch on 16 | /// 17 | /// Range `0.0` (darkest) – `1` (brightest). Default value is `0.1`. 18 | /// - Since: 1.2.0 19 | @objc public var torchLevel: Float = 0.1 20 | } 21 | 22 | /// Base card detection settings 23 | /// - Since: 1.4.0 24 | @objc public class BaseCardDetectionSettings: NSObject { 25 | 26 | /// Card orientation 27 | /// - Since: 1.0.0 28 | @objc public enum Orientation: Int { 29 | /// Landscape (height < width) 30 | case landscape 31 | /// Portrait (width < height) 32 | case portrait 33 | } 34 | 35 | /// Size of the card to detect 36 | /// 37 | /// Only the aspect ratio is considered by the app. The units are inconsequential. 38 | /// - Since: 1.0.0 39 | @objc public var size: CGSize 40 | 41 | /// Orientation of the card to be detected 42 | /// 43 | /// The orientation is determined by the size. Setting the orientation to the other available value will flip the width and height of the size. 44 | /// - Since: 1.0.0 45 | @objc public var orientation: Orientation { 46 | get { 47 | return size.width > size.height ? .landscape : .portrait 48 | } 49 | set { 50 | if newValue == .landscape && size.width < size.height { 51 | let w = size.width 52 | size.width = size.height 53 | size.height = w 54 | } else if newValue == .portrait && size.height < size.width { 55 | let h = size.height 56 | size.height = size.width 57 | size.width = h 58 | } 59 | } 60 | } 61 | /// Number of image samples the camera should collect 62 | /// 63 | /// The samples in the pool are compared for sharpness and the sharpest one is de-warped and returned. 64 | /// - Since: 1.1.0 65 | @objc public var imagePoolSize: Int = 5 66 | 67 | /// Initializer 68 | /// - Parameters: 69 | /// - width: Width of the card (units don't matter) 70 | /// - height: Height of the card (units don't matter) 71 | /// - Since: 1.0.0 72 | @objc public init(width: CGFloat, height: CGFloat) { 73 | self.size = CGSize(width: width, height: height) 74 | } 75 | 76 | /// Convenience initializer 77 | /// 78 | /// Initializes settings with ISO ID-1 dimensions 79 | /// - Since: 1.4.0 80 | @objc public convenience override init() { 81 | self.init(width: 85.6, height: 53.98) 82 | } 83 | } 84 | -------------------------------------------------------------------------------- /Sources/IDCardCamera/CardDetectionViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // CardDetectionViewController.swift 3 | // VerIDIDCapture 4 | // 5 | // Created by Jakub Dolejs on 03/01/2018. 6 | // Copyright © 2018 Applied Recognition, Inc. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | import AVFoundation 11 | import Vision 12 | 13 | /// View controller used to run a camera session that collects an image of an card with a given aspect ratio and returns an image with corrected perspective 14 | /// - Since: 1.0.0 15 | @objc public class CardDetectionViewController: BaseCardDetectionViewController { 16 | 17 | /// Card detection delegate 18 | /// - Since: 1.0.0 19 | @objc public weak var delegate: CardDetectionViewControllerDelegate? 20 | /// Card detection settings 21 | /// - Since: 1.0.0 22 | @objc public var settings = CardDetectionSettings() 23 | 24 | /// Initializer 25 | /// - Since: 1.0.0 26 | @objc public override init() { 27 | super.init() 28 | } 29 | 30 | required init?(coder: NSCoder) { 31 | fatalError("init(coder:) has not been implemented") 32 | } 33 | 34 | override var cardAspectRatio: CGFloat { 35 | return self.settings.size.width / self.settings.size.height 36 | } 37 | 38 | override var imagePoolSize: Int { 39 | return self.settings.imagePoolSize 40 | } 41 | 42 | override func delegateCancel() { 43 | if !self.backgroundOperationQueue.isSuspended { 44 | self.backgroundOperationQueue.addOperation { 45 | if let delegate = self.delegate { 46 | DispatchQueue.main.async { 47 | delegate.cardDetectionViewControllerDidCancel?(self) 48 | } 49 | self.delegate = nil 50 | } 51 | } 52 | } else { 53 | self.delegate?.cardDetectionViewControllerDidCancel?(self) 54 | self.delegate = nil 55 | } 56 | } 57 | 58 | override func qualityOfImage(_ image: CGImage) -> Float? { 59 | return self.delegate?.qualityOfImage?(image)?.floatValue 60 | } 61 | 62 | override func didCropImageToImage(_ image: CGImage) { 63 | guard let delegate = self.delegate else { 64 | DispatchQueue.main.async { 65 | self.dismiss() 66 | } 67 | return 68 | } 69 | self.delegate = nil 70 | DispatchQueue.main.async { 71 | self.dismiss() 72 | delegate.cardDetectionViewController(self, didDetectCard: image, withSettings: self.settings) 73 | } 74 | } 75 | 76 | override func flipCardOrientation() { 77 | if self.settings.orientation == .landscape { 78 | self.settings.orientation = .portrait 79 | } else { 80 | self.settings.orientation = .landscape 81 | } 82 | } 83 | 84 | override public func viewDidLoad() { 85 | super.viewDidLoad() 86 | self.sessionHandler.torchSettings = self.settings 87 | self.sessionHandler.cardDetectionSettings = self.settings 88 | } 89 | } 90 | -------------------------------------------------------------------------------- /Sources/IDCardCamera/CardDetectionViewControllerDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // IDCardCameraDelegate.swift 3 | // IDCardCamera 4 | // 5 | // Created by Jakub Dolejs on 11/12/2019. 6 | // Copyright © 2019 Applied Recognition Inc. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | /// Card detection view controller delegate 12 | /// - Since: 1.0.0 13 | @objc public protocol CardDetectionViewControllerDelegate: AnyObject { 14 | 15 | /// Called when card detection succeeds 16 | /// - Parameters: 17 | /// - viewController: View controller that detected the card 18 | /// - image: Image of the detected card straightened to fit the rectangle specified in settings 19 | /// - settings: Card detection settings 20 | /// - Since: 1.0.0 21 | @objc func cardDetectionViewController(_ viewController: CardDetectionViewController, didDetectCard image: CGImage, withSettings settings: CardDetectionSettings) 22 | 23 | /// Called when card detection is cancelled 24 | /// - Parameter viewController: View controller that was used for card detection 25 | /// - Since: 1.0.0 26 | @objc optional func cardDetectionViewControllerDidCancel(_ viewController: CardDetectionViewController) 27 | 28 | /// Called when an image is straightened 29 | /// 30 | /// Implement in your delegate to determine the image quality. By default the quality is determined by 31 | /// the sharpness of the image. However, sharpness detection is only available on iOS 13 and newer. 32 | /// If you wish to keep the sharpness detection and implement your own image quality scoring for iOS 12 33 | /// and older return `nil` on iOS 13 and your score on iOS 12 and older. 34 | /// - Parameter image: Image 35 | /// - Returns: Score representing the quality of the image (higher score is better than lower) 36 | /// - Since: 1.3.0 37 | @objc optional func qualityOfImage(_ image: CGImage) -> NSNumber? 38 | } 39 | -------------------------------------------------------------------------------- /Sources/IDCardCamera/DetectionOperations.swift: -------------------------------------------------------------------------------- 1 | // 2 | // DetectionOperations.swift 3 | // VerIDCredentials 4 | // 5 | // Created by Jakub Dolejs on 12/01/2018. 6 | // Copyright © 2018 Applied Recognition, Inc. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | import Vision 11 | 12 | @available(iOS 11.0, *) 13 | public class PerspectiveCorrectionParamsOperation: Operation { 14 | 15 | let orientation: CGImagePropertyOrientation 16 | let pixelBuffer: CVImageBuffer 17 | let rect: VNRectangleObservation 18 | 19 | var perspectiveCorrectionParams: [String:CIVector]? 20 | var corners: (topLeft: CGPoint, topRight: CGPoint, bottomRight: CGPoint, bottomLeft: CGPoint)? 21 | var cgImage: CGImage? 22 | var sharpness: Float? 23 | 24 | public init(pixelBuffer: CVImageBuffer, orientation: CGImagePropertyOrientation, rect: VNRectangleObservation) { 25 | self.pixelBuffer = pixelBuffer 26 | self.orientation = orientation 27 | self.rect = rect 28 | } 29 | 30 | public override func main() { 31 | if #available(iOS 13.0, *) { 32 | self.sharpness = pixelBuffer.sharpness() 33 | } 34 | guard let cgImage = pixelBuffer.cgImage(withOrientation: orientation) else { 35 | return 36 | } 37 | let imageSize = CGSize(width: cgImage.width, height: cgImage.height) 38 | let transform = CGAffineTransform(scaleX: imageSize.width, y: imageSize.height) 39 | 40 | let corners: (topLeft: CGPoint, topRight: CGPoint, bottomRight: CGPoint, bottomLeft: CGPoint) 41 | let flipTransform: CGAffineTransform 42 | switch orientation { 43 | case .left, .right: 44 | corners = (topLeft: rect.topLeft.applying(transform), topRight: rect.topRight.applying(transform), bottomRight: rect.bottomRight.applying(transform), bottomLeft: rect.bottomLeft.applying(transform)) 45 | flipTransform = CGAffineTransform(scaleX: 1, y: -1).concatenating(CGAffineTransform(translationX: 0, y: imageSize.height)) 46 | default: 47 | corners = (topLeft: rect.bottomRight.applying(transform), topRight: rect.bottomLeft.applying(transform), bottomRight: rect.topLeft.applying(transform), bottomLeft: rect.topRight.applying(transform)) 48 | flipTransform = CGAffineTransform(scaleX: -1, y: 1).concatenating(CGAffineTransform(translationX: imageSize.width, y: 0)) 49 | } 50 | let params = [ 51 | "inputTopLeft": CIVector(cgPoint: corners.topLeft), 52 | "inputTopRight": CIVector(cgPoint: corners.topRight), 53 | "inputBottomRight": CIVector(cgPoint: corners.bottomRight), 54 | "inputBottomLeft": CIVector(cgPoint: corners.bottomLeft) 55 | ] 56 | 57 | self.cgImage = cgImage 58 | self.corners = (topLeft: corners.topLeft.applying(flipTransform), topRight: corners.topRight.applying(flipTransform), bottomRight: corners.bottomRight.applying(flipTransform), bottomLeft: corners.bottomLeft.applying(flipTransform)) 59 | self.perspectiveCorrectionParams = params 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /Sources/IDCardCamera/IDCardCamera.docc/IDCardCamera.md: -------------------------------------------------------------------------------- 1 | # ``IDCardCamera`` 2 | 3 | Capture photo page and barcode of ID cards on iOS 4 | 5 | ## Overview 6 | 7 | - Detects an ID card in a camera view and returns the de-warped image of the ID card. 8 | - Scans PDF417 barcode on the back side of an ID card. 9 | 10 | ### Example Usage 11 | 12 | ```swift 13 | import UIKit 14 | import IDCardCamera 15 | 16 | class ViewController: UIViewController, CardDetectionViewControllerDelegate { 17 | 18 | @IBOutlet var imageView: UIImageView! 19 | 20 | func scanIDCard() { 21 | // Set the scan settings 22 | // In this example the aspect ratio is that of a typical credit card 23 | // The width and height units are not important 24 | let settings = CardDetectionSettings(width: 85.6, height: 53.98) 25 | 26 | // Create the view controller 27 | let controller = CardDetectionViewController() 28 | 29 | // Set the delegate that will receive the result 30 | controller.delegate = self 31 | 32 | // Present the card detection view controller 33 | self.present(controller, animated: true, completion: nil) 34 | } 35 | 36 | func cardDetectionViewController(_ viewController: CardDetectionViewController, didDetectCard image: CGImage, withSettings settings: CardDetectionSettings) { 37 | // The card has been scanned 38 | // Display the image in the image view 39 | self.imageView.image = UIImage(cgImage: image) 40 | } 41 | } 42 | ``` 43 | 44 | ## Topics 45 | 46 | ### Capturing ID Card Photo Page 47 | 48 | - ``CardDetectionViewController`` 49 | - ``CardDetectionSettings`` 50 | - ``CardDetectionViewControllerDelegate`` 51 | 52 | ### Capturing ID Card Barcode 53 | 54 | - ``BarcodeDetectionViewController`` 55 | - ``BarcodeDetectionSettings`` 56 | - ``BarcodeDetectionViewControllerDelegate`` 57 | - ``BarcodeDetectionSettingsError`` 58 | 59 | ### Capturing Both Sides of ID Card 60 | 61 | - ``CardAndBarcodeDetectionViewController`` 62 | - ``CardAndBarcodeDetectionSettings`` 63 | - ``CardAndBarcodeDetectionViewControllerDelegate`` 64 | -------------------------------------------------------------------------------- /Sources/IDCardCamera/IDCardCamera.h: -------------------------------------------------------------------------------- 1 | // 2 | // IDCardCamera.h 3 | // IDCardCamera 4 | // 5 | // Created by Jakub Dolejs on 11/12/2019. 6 | // Copyright © 2019 Applied Recognition Inc. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | //! Project version number for IDCardCamera. 12 | FOUNDATION_EXPORT double IDCardCameraVersionNumber; 13 | 14 | //! Project version string for IDCardCamera. 15 | FOUNDATION_EXPORT const unsigned char IDCardCameraVersionString[]; 16 | 17 | // In this header, you should import all the public headers of your framework using statements like #import 18 | 19 | 20 | -------------------------------------------------------------------------------- /Sources/IDCardCamera/Resources/Base.xcconfig: -------------------------------------------------------------------------------- 1 | // 2 | // Base.xcconfig 3 | // IDCardCamera 4 | // 5 | // Created by Jakub Dolejs on 12/11/2021. 6 | // Copyright © 2021 Applied Recognition Inc. All rights reserved. 7 | // 8 | 9 | // Configuration settings file format documentation can be found at: 10 | // https://help.apple.com/xcode/#/dev745c5c974 11 | MARKETING_VERSION = 1.4.2 12 | CURRENT_PROJECT_VERSION = 1004002 13 | -------------------------------------------------------------------------------- /Sources/IDCardCamera/Resources/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | $(PRODUCT_BUNDLE_PACKAGE_TYPE) 17 | CFBundleShortVersionString 18 | $(MARKETING_VERSION) 19 | CFBundleVersion 20 | $(CURRENT_PROJECT_VERSION) 21 | 22 | 23 | -------------------------------------------------------------------------------- /Sources/IDCardCamera/Resources/Media.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /Sources/IDCardCamera/Resources/Media.xcassets/torch_off.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "torch_off.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "torch_off@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "torch_off@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /Sources/IDCardCamera/Resources/Media.xcassets/torch_off.imageset/torch_off.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AppliedRecognition/ID-Card-Camera/0db686702a5ed728cd236efb40bc1c3f9ed8fcfd/Sources/IDCardCamera/Resources/Media.xcassets/torch_off.imageset/torch_off.png -------------------------------------------------------------------------------- /Sources/IDCardCamera/Resources/Media.xcassets/torch_off.imageset/torch_off@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AppliedRecognition/ID-Card-Camera/0db686702a5ed728cd236efb40bc1c3f9ed8fcfd/Sources/IDCardCamera/Resources/Media.xcassets/torch_off.imageset/torch_off@2x.png -------------------------------------------------------------------------------- /Sources/IDCardCamera/Resources/Media.xcassets/torch_off.imageset/torch_off@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AppliedRecognition/ID-Card-Camera/0db686702a5ed728cd236efb40bc1c3f9ed8fcfd/Sources/IDCardCamera/Resources/Media.xcassets/torch_off.imageset/torch_off@3x.png -------------------------------------------------------------------------------- /Sources/IDCardCamera/Resources/Media.xcassets/torch_on.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "torch_on.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "torch_on@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "torch_on@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /Sources/IDCardCamera/Resources/Media.xcassets/torch_on.imageset/torch_on.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AppliedRecognition/ID-Card-Camera/0db686702a5ed728cd236efb40bc1c3f9ed8fcfd/Sources/IDCardCamera/Resources/Media.xcassets/torch_on.imageset/torch_on.png -------------------------------------------------------------------------------- /Sources/IDCardCamera/Resources/Media.xcassets/torch_on.imageset/torch_on@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AppliedRecognition/ID-Card-Camera/0db686702a5ed728cd236efb40bc1c3f9ed8fcfd/Sources/IDCardCamera/Resources/Media.xcassets/torch_on.imageset/torch_on@2x.png -------------------------------------------------------------------------------- /Sources/IDCardCamera/Resources/Media.xcassets/torch_on.imageset/torch_on@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AppliedRecognition/ID-Card-Camera/0db686702a5ed728cd236efb40bc1c3f9ed8fcfd/Sources/IDCardCamera/Resources/Media.xcassets/torch_on.imageset/torch_on@3x.png -------------------------------------------------------------------------------- /Sources/IDCardCamera/TorchSettings.swift: -------------------------------------------------------------------------------- 1 | // 2 | // TorchSettings.swift 3 | // IDCardCamera 4 | // 5 | // Created by Jakub Dolejs on 19/12/2019. 6 | // Copyright © 2019 Applied Recognition Inc. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | /// Protocol describing torch settings 12 | /// - Since: 1.4.0 13 | @objc public protocol TorchSettings { 14 | 15 | /// Set the torch level when the user turns the torch on 16 | /// 17 | /// Range `0.0` (darkest) – `1` (brightest). Default value is `0.1`. 18 | /// - Since: 1.4.0 19 | @objc var torchLevel: Float { get } 20 | } 21 | -------------------------------------------------------------------------------- /Sources/IDCardCameraResources/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundlePackageType 6 | BNDL 7 | NSPrincipalClass 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /Sources/TestApp/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // TestApp 4 | // 5 | // Created by Jakub Dolejs on 12/12/2019. 6 | // Copyright © 2019 Applied Recognition Inc. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | @UIApplicationMain 12 | class AppDelegate: UIResponder, UIApplicationDelegate { 13 | 14 | var window: UIWindow? 15 | 16 | func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { 17 | // Override point for customization after application launch. 18 | return true 19 | } 20 | 21 | } 22 | 23 | -------------------------------------------------------------------------------- /Sources/TestApp/Resources/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "20x20", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "20x20", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "29x29", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "29x29", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "40x40", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "40x40", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "idiom" : "iphone", 35 | "size" : "60x60", 36 | "scale" : "2x" 37 | }, 38 | { 39 | "idiom" : "iphone", 40 | "size" : "60x60", 41 | "scale" : "3x" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "size" : "20x20", 46 | "scale" : "1x" 47 | }, 48 | { 49 | "idiom" : "ipad", 50 | "size" : "20x20", 51 | "scale" : "2x" 52 | }, 53 | { 54 | "idiom" : "ipad", 55 | "size" : "29x29", 56 | "scale" : "1x" 57 | }, 58 | { 59 | "idiom" : "ipad", 60 | "size" : "29x29", 61 | "scale" : "2x" 62 | }, 63 | { 64 | "idiom" : "ipad", 65 | "size" : "40x40", 66 | "scale" : "1x" 67 | }, 68 | { 69 | "idiom" : "ipad", 70 | "size" : "40x40", 71 | "scale" : "2x" 72 | }, 73 | { 74 | "idiom" : "ipad", 75 | "size" : "76x76", 76 | "scale" : "1x" 77 | }, 78 | { 79 | "idiom" : "ipad", 80 | "size" : "76x76", 81 | "scale" : "2x" 82 | }, 83 | { 84 | "idiom" : "ipad", 85 | "size" : "83.5x83.5", 86 | "scale" : "2x" 87 | }, 88 | { 89 | "idiom" : "ios-marketing", 90 | "size" : "1024x1024", 91 | "scale" : "1x" 92 | } 93 | ], 94 | "info" : { 95 | "version" : 1, 96 | "author" : "xcode" 97 | } 98 | } -------------------------------------------------------------------------------- /Sources/TestApp/Resources/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /Sources/TestApp/Resources/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /Sources/TestApp/Resources/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | $(PRODUCT_BUNDLE_PACKAGE_TYPE) 17 | CFBundleShortVersionString 18 | $(MARKETING_VERSION) 19 | CFBundleVersion 20 | 1 21 | LSRequiresIPhoneOS 22 | 23 | NSCameraUsageDescription 24 | To scan ID cards 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIMainStoryboardFile 28 | Main 29 | UIRequiredDeviceCapabilities 30 | 31 | armv7 32 | 33 | UISupportedInterfaceOrientations 34 | 35 | UIInterfaceOrientationPortrait 36 | UIInterfaceOrientationLandscapeLeft 37 | UIInterfaceOrientationLandscapeRight 38 | 39 | UISupportedInterfaceOrientations~ipad 40 | 41 | UIInterfaceOrientationPortrait 42 | UIInterfaceOrientationPortraitUpsideDown 43 | UIInterfaceOrientationLandscapeLeft 44 | UIInterfaceOrientationLandscapeRight 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /Sources/TestApp/ResultViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ResultViewController.swift 3 | // TestApp 4 | // 5 | // Created by Jakub Dolejs on 12/11/2021. 6 | // Copyright © 2021 Applied Recognition Inc. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class ResultViewController: UITableViewController { 12 | 13 | var documentProperties: [(String,String)] = [] 14 | var documentImage: UIImage? 15 | var imageAspectRatio: CGFloat? 16 | 17 | // MARK: - Table view data source 18 | 19 | override func numberOfSections(in tableView: UITableView) -> Int { 20 | var sectionCount: Int = 0 21 | if self.documentImage != nil { 22 | sectionCount += 1 23 | } 24 | if !self.documentProperties.isEmpty { 25 | sectionCount += 1 26 | } 27 | return sectionCount 28 | } 29 | 30 | override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { 31 | if section == 0 && self.documentImage != nil { 32 | return 1 33 | } else { 34 | return self.documentProperties.count 35 | } 36 | } 37 | 38 | override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { 39 | let cell: UITableViewCell 40 | if indexPath.section == 0, let image = self.documentImage { 41 | cell = tableView.dequeueReusableCell(withIdentifier: "image", for: indexPath) 42 | if let imageCell = cell as? ImageCell { 43 | imageCell.documentImageView.image = image 44 | if let constraint = imageCell.documentImageView.constraints.first(where: { $0.identifier == "aspectRatio" }) { 45 | imageCell.documentImageView.removeConstraint(constraint) 46 | } 47 | if let aspectRatio = self.imageAspectRatio { 48 | let constraint = NSLayoutConstraint(item: imageCell.documentImageView as Any, attribute: .width, relatedBy: .equal, toItem: imageCell.documentImageView, attribute: .height, multiplier: aspectRatio, constant: 0) 49 | constraint.identifier = "aspectRatio" 50 | constraint.priority = .defaultHigh 51 | imageCell.documentImageView.addConstraint(constraint) 52 | } 53 | } 54 | } else { 55 | cell = tableView.dequeueReusableCell(withIdentifier: "property", for: indexPath) 56 | if #available(iOS 14, *) { 57 | var content = cell.defaultContentConfiguration() 58 | content.text = self.documentProperties[indexPath.row].0 59 | content.secondaryText = self.documentProperties[indexPath.row].1 60 | cell.contentConfiguration = content 61 | } else { 62 | cell.textLabel?.text = self.documentProperties[indexPath.row].0 63 | cell.detailTextLabel?.text = self.documentProperties[indexPath.row].1 64 | } 65 | } 66 | return cell 67 | } 68 | 69 | override func tableView(_ tableView: UITableView, titleForHeaderInSection section: Int) -> String? { 70 | if section == 0 && self.documentImage != nil { 71 | return "Photo page" 72 | } else { 73 | return "Barcode" 74 | } 75 | } 76 | 77 | override func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat { 78 | return 44 79 | } 80 | 81 | } 82 | 83 | class ImageCell: UITableViewCell { 84 | 85 | @IBOutlet var documentImageView: UIImageView! 86 | } 87 | -------------------------------------------------------------------------------- /build-docs.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | 4 | # build-docs.sh 5 | # IDCardCamera 6 | # 7 | # Created by Jakub Dolejs on 15/11/2021. 8 | # Copyright © 2021 Applied Recognition Inc. All rights reserved. 9 | LOG_FILE=build-docs-log.txt 10 | rm -f ${LOG_FILE} 11 | DERIVED_DATA_PATH=tmp/IDCardCamera 12 | echo "Building documentation archive" 13 | xcodebuild docbuild -scheme IDCardCamera -sdk iphoneos -derivedDataPath "${DERIVED_DATA_PATH}" > ${LOG_FILE} 2>&1 14 | DOCCARCHIVE=`find "${DERIVED_DATA_PATH}" -type d -name IDCardCamera.doccarchive` 15 | echo "Cloning docc2html utility from Github" 16 | git clone https://github.com/DoccZz/docc2html.git >> ${LOG_FILE} 2>&1 17 | cd docc2html 18 | echo "Converting doccarchive to html" 19 | swift run docc2html --force "../${DOCCARCHIVE}" ../docs >> ${LOG_FILE} 2>&1 20 | cd .. 21 | echo "Writing redirection index.html" 22 | echo 'Documentation' > docs/index.html 23 | echo "Cleaning up" 24 | rm -rf docc2html 25 | rm -rf tmp 26 | rm -rf IDCardCamera.doccarchive 27 | echo "Done" 28 | -------------------------------------------------------------------------------- /docs/documentation/idcardcamera/barcodedetectionsettings/torchlevel.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | torchLevel| Documentation 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 |
19 | 57 | 58 |
59 |
60 | Instance Property 61 |

torchLevel

62 |
63 | 64 |
65 |
66 |
67 | Set the torch level when the user turns the torch on 68 |
69 |
70 | 71 | 72 | 73 |
74 |
75 |

Declaration

76 |
77 |
@objc var torchLevel: Float
78 |
79 |
80 |

Discussion

Range 0.0 (darkest) – 1 (brightest). Default value is 0.1.

81 |
82 |
83 | 84 | 85 | 86 | 87 |
88 | 89 |
90 |
91 |
92 | 93 | 94 | 95 | -------------------------------------------------------------------------------- /docs/documentation/idcardcamera/barcodedetectionsettingserror/!=(_:_:).html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | !=(_:_:)| Documentation 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 |
19 | 64 | 65 |
66 |
67 | Operator 68 |

!=(_:_:)

69 |
70 | 71 |
72 |
73 |
74 | Inherited from Equatable.!=(_:_:). 75 |
76 |
77 | 78 | 79 | 80 |
81 |
82 |

Declaration

83 |
84 |
static func != (lhs: Self, rhs: Self) -> Bool
85 |
86 |
87 | 88 |
89 |
90 | 91 | 92 | 93 | 94 |
95 | 96 |
97 |
98 |
99 | 100 | 101 | 102 | -------------------------------------------------------------------------------- /docs/documentation/idcardcamera/barcodedetectionsettingserror/error-implementations.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Error Implementations| Documentation 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 |
19 | 57 | 58 |
59 |
60 | 61 |

Error Implementations

62 |
63 | 64 | 65 | 66 |
67 |
68 |

Topics

69 | 70 | 71 |
72 |
73 |

Instance Properties

74 |
75 | 76 |
77 | 78 | 89 | 90 |
91 |
92 | 93 |
94 |
95 | 96 | 97 |
98 | 99 |
100 |
101 |
102 | 103 | 104 | 105 | -------------------------------------------------------------------------------- /docs/documentation/idcardcamera/barcodedetectionsettingserror/hashvalue.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | hashValue| Documentation 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 |
19 | 64 | 65 |
66 |
67 | Instance Property 68 |

hashValue

69 |
70 | 71 |
72 |
73 |
74 | Inherited from RawRepresentable.hashValue. 75 |
76 |
77 | 78 | 79 | 80 |
81 |
82 |

Declaration

83 |
84 |
var hashValue: Int { get }
85 |
86 |
87 | 88 |
89 |
90 | 91 | 92 | 93 | 94 |
95 | 96 |
97 |
98 |
99 | 100 | 101 | 102 | -------------------------------------------------------------------------------- /docs/documentation/idcardcamera/barcodedetectionsettingserror/localizeddescription.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | localizedDescription| Documentation 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 |
19 | 64 | 65 |
66 |
67 | Instance Property 68 |

localizedDescription

69 |
70 | 71 |
72 |
73 |
74 | Inherited from Error.localizedDescription. 75 |
76 |
77 | 78 | 79 | 80 |
81 |
82 |

Declaration

83 |
84 |
var localizedDescription: String { get }
85 |
86 |
87 | 88 |
89 |
90 | 91 | 92 | 93 | 94 |
95 | 96 |
97 |
98 |
99 | 100 | 101 | 102 | -------------------------------------------------------------------------------- /docs/documentation/idcardcamera/barcodedetectionsettingserror/rawrepresentable-implementations.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | RawRepresentable Implementations| Documentation 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 |
19 | 57 | 58 |
59 |
60 | 61 |

RawRepresentable Implementations

62 |
63 | 64 | 65 | 66 |
67 |
68 |

Topics

69 | 70 | 71 |
72 |
73 |

Instance Properties

74 |
75 | 76 |
77 | 78 | 89 | 90 |
91 |
92 | 93 |
94 |
95 | 96 | 97 |
98 | 99 |
100 |
101 |
102 | 103 | 104 | 105 | -------------------------------------------------------------------------------- /docs/documentation/idcardcamera/barcodedetectionsettingserror/unsupportedbarcodesymbology.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | BarcodeDetectionSettingsError.unsupportedBarcodeSymbology| Documentation 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 |
19 | 57 | 58 |
59 |
60 | Case 61 |

BarcodeDetectionSettingsError.unsupportedBarcodeSymbology

62 |
63 | 64 |
65 |
66 |
67 | Unsupported barcode symbology error 68 |
69 |
70 | 71 | 72 | 73 |
74 |
75 |

Declaration

76 |
77 |
case unsupportedBarcodeSymbology
78 |
79 |
80 |

Discussion

81 |
82 |
83 | 84 | 85 | 86 | 87 |
88 | 89 |
90 |
91 |
92 | 93 | 94 | 95 | -------------------------------------------------------------------------------- /docs/documentation/idcardcamera/barcodedetectionviewcontroller/delegate.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | delegate| Documentation 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 |
19 | 57 | 58 |
59 |
60 | Instance Property 61 |

delegate

62 |
63 | 64 |
65 |
66 |
67 | Barcode detection view controller delegate 68 |
69 |
70 | 71 | 72 | 73 |
74 |
75 |

Declaration

76 |
77 |
@objc weak var delegate: BarcodeDetectionViewControllerDelegate?
78 |
79 |
80 |

Discussion

81 |
82 |
83 | 84 | 85 | 86 | 87 |
88 | 89 |
90 |
91 |
92 | 93 | 94 | 95 | -------------------------------------------------------------------------------- /docs/documentation/idcardcamera/barcodedetectionviewcontroller/init(settings:).html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | init(settings:)| Documentation 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 |
19 | 57 | 58 |
59 |
60 | Initializer 61 |

init(settings:)

62 |
63 | 64 |
65 |
66 |
67 | Initializer 68 |
69 |
70 | 71 | 72 | 73 |
74 |
75 |

Declaration

76 |
77 |
@objc init(settings: BarcodeDetectionSettings)
78 |
79 |
80 |
81 |

Parameters

82 |
83 | 84 |
settings
85 |
86 |

Barcode detection settings

87 |
88 | 89 |
90 |
91 |

Discussion

92 |
93 |
94 | 95 | 96 | 97 | 98 |
99 | 100 |
101 |
102 |
103 | 104 | 105 | 106 | -------------------------------------------------------------------------------- /docs/documentation/idcardcamera/barcodedetectionviewcontroller/presentationcontrollerdiddismiss(_:).html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | presentationControllerDidDismiss(_:)| Documentation 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 |
19 | 57 | 58 |
59 |
60 | Instance Method 61 |

presentationControllerDidDismiss(_:)

62 |
63 | 64 |
65 |
66 |
67 | No overview available. 68 |
69 |
70 | 71 | 72 | 73 |
74 |
75 |

Declaration

76 |
77 |
override func presentationControllerDidDismiss(_ presentationController: UIPresentationController)
78 |
79 |
80 | 81 |
82 |
83 | 84 | 85 | 86 | 87 |
88 | 89 |
90 |
91 |
92 | 93 | 94 | 95 | -------------------------------------------------------------------------------- /docs/documentation/idcardcamera/barcodedetectionviewcontroller/settings.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | settings| Documentation 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 |
19 | 57 | 58 |
59 |
60 | Instance Property 61 |

settings

62 |
63 | 64 |
65 |
66 |
67 | Barcode detection settings 68 |
69 |
70 | 71 | 72 | 73 |
74 |
75 |

Declaration

76 |
77 |
@objc let settings: BarcodeDetectionSettings
78 |
79 |
80 |

Discussion

81 |
82 |
83 | 84 | 85 | 86 | 87 |
88 | 89 |
90 |
91 |
92 | 93 | 94 | 95 | -------------------------------------------------------------------------------- /docs/documentation/idcardcamera/barcodedetectionviewcontroller/viewdidload().html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | viewDidLoad()| Documentation 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 |
19 | 57 | 58 |
59 |
60 | Instance Method 61 |

viewDidLoad()

62 |
63 | 64 |
65 |
66 |
67 | No overview available. 68 |
69 |
70 | 71 | 72 | 73 |
74 |
75 |

Declaration

76 |
77 |
override func viewDidLoad()
78 |
79 |
80 | 81 |
82 |
83 | 84 | 85 | 86 | 87 |
88 | 89 |
90 |
91 |
92 | 93 | 94 | 95 | -------------------------------------------------------------------------------- /docs/documentation/idcardcamera/basebarcodedetectionsettings/barcodesymbologies.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | barcodeSymbologies| Documentation 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 |
19 | 57 | 58 |
59 |
60 | Instance Property 61 |

barcodeSymbologies

62 |
63 | 64 |
65 |
66 |
67 | Symbologies of barcodes to detect 68 |
69 |
70 | 71 | 72 | 73 |
74 |
75 |

Declaration

76 |
77 |
@objc let barcodeSymbologies: [VNBarcodeSymbology]
78 |
79 |
80 |

Discussion

81 |
82 |
83 | 84 | 85 | 86 | 87 |
88 | 89 |
90 |
91 |
92 | 93 | 94 | 95 | -------------------------------------------------------------------------------- /docs/documentation/idcardcamera/basecarddetectionsettings/imagepoolsize.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | imagePoolSize| Documentation 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 |
19 | 57 | 58 |
59 |
60 | Instance Property 61 |

imagePoolSize

62 |
63 | 64 |
65 |
66 |
67 | Number of image samples the camera should collect 68 |
69 |
70 | 71 | 72 | 73 |
74 |
75 |

Declaration

76 |
77 |
@objc var imagePoolSize: Int
78 |
79 |
80 |

Discussion

The samples in the pool are compared for sharpness and the sharpest one is de-warped and returned.

81 |
82 |
83 | 84 | 85 | 86 | 87 |
88 | 89 |
90 |
91 |
92 | 93 | 94 | 95 | -------------------------------------------------------------------------------- /docs/documentation/idcardcamera/basecarddetectionsettings/init().html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | init()| Documentation 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 |
19 | 57 | 58 |
59 |
60 | Initializer 61 |

init()

62 |
63 | 64 |
65 |
66 |
67 | Convenience initializer 68 |
69 |
70 | 71 | 72 | 73 |
74 |
75 |

Declaration

76 |
77 |
@objc override convenience init()
78 |
79 |
80 |

Discussion

Initializes settings with ISO ID-1 dimensions

81 |
82 |
83 | 84 | 85 | 86 | 87 |
88 | 89 |
90 |
91 |
92 | 93 | 94 | 95 | -------------------------------------------------------------------------------- /docs/documentation/idcardcamera/basecarddetectionsettings/init(width:height:).html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | init(width:height:)| Documentation 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 |
19 | 57 | 58 |
59 |
60 | Initializer 61 |

init(width:height:)

62 |
63 | 64 |
65 |
66 |
67 | Initializer 68 |
69 |
70 | 71 | 72 | 73 |
74 |
75 |

Declaration

76 |
77 |
@objc init(width: CGFloat, height: CGFloat)
78 |
79 |
80 |
81 |

Parameters

82 |
83 | 84 |
width
85 |
86 |

Width of the card (units don’t matter)

87 |
88 | 89 |
height
90 |
91 |

Height of the card (units don’t matter)

92 |
93 | 94 |
95 |
96 |

Discussion

97 |
98 |
99 | 100 | 101 | 102 | 103 |
104 | 105 |
106 |
107 |
108 | 109 | 110 | 111 | -------------------------------------------------------------------------------- /docs/documentation/idcardcamera/basecarddetectionsettings/orientation-swift.enum/!=(_:_:).html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | !=(_:_:)| Documentation 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 |
19 | 71 | 72 |
73 |
74 | Operator 75 |

!=(_:_:)

76 |
77 | 78 |
79 |
80 |
81 | Inherited from Equatable.!=(_:_:). 82 |
83 |
84 | 85 | 86 | 87 |
88 |
89 |

Declaration

90 |
91 |
static func != (lhs: Self, rhs: Self) -> Bool
92 |
93 |
94 | 95 |
96 |
97 | 98 | 99 | 100 | 101 |
102 | 103 |
104 |
105 |
106 | 107 | 108 | 109 | -------------------------------------------------------------------------------- /docs/documentation/idcardcamera/basecarddetectionsettings/orientation-swift.enum/hash(into:).html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | hash(into:)| Documentation 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 |
19 | 71 | 72 |
73 |
74 | Instance Method 75 |

hash(into:)

76 |
77 | 78 |
79 |
80 |
81 | Inherited from RawRepresentable.hash(into:). 82 |
83 |
84 | 85 | 86 | 87 |
88 |
89 |

Declaration

90 |
91 |
func hash(into hasher: inout Hasher)
92 |
93 |
94 | 95 |
96 |
97 | 98 | 99 | 100 | 101 |
102 | 103 |
104 |
105 |
106 | 107 | 108 | 109 | -------------------------------------------------------------------------------- /docs/documentation/idcardcamera/basecarddetectionsettings/orientation-swift.enum/hashvalue.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | hashValue| Documentation 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 |
19 | 71 | 72 |
73 |
74 | Instance Property 75 |

hashValue

76 |
77 | 78 |
79 |
80 |
81 | Inherited from RawRepresentable.hashValue. 82 |
83 |
84 | 85 | 86 | 87 |
88 |
89 |

Declaration

90 |
91 |
var hashValue: Int { get }
92 |
93 |
94 | 95 |
96 |
97 | 98 | 99 | 100 | 101 |
102 | 103 |
104 |
105 |
106 | 107 | 108 | 109 | -------------------------------------------------------------------------------- /docs/documentation/idcardcamera/basecarddetectionsettings/orientation-swift.enum/landscape.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | BaseCardDetectionSettings.Orientation.landscape| Documentation 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 |
19 | 64 | 65 |
66 |
67 | Case 68 |

BaseCardDetectionSettings.Orientation.landscape

69 |
70 | 71 |
72 |
73 |
74 | Landscape (height < width) 75 |
76 |
77 | 78 | 79 | 80 |
81 |
82 |

Declaration

83 |
84 |
case landscape
85 |
86 |
87 | 88 |
89 |
90 | 91 | 92 | 93 | 94 |
95 | 96 |
97 |
98 |
99 | 100 | 101 | 102 | -------------------------------------------------------------------------------- /docs/documentation/idcardcamera/basecarddetectionsettings/orientation-swift.enum/portrait.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | BaseCardDetectionSettings.Orientation.portrait| Documentation 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 |
19 | 64 | 65 |
66 |
67 | Case 68 |

BaseCardDetectionSettings.Orientation.portrait

69 |
70 | 71 |
72 |
73 |
74 | Portrait (width < height) 75 |
76 |
77 | 78 | 79 | 80 |
81 |
82 |

Declaration

83 |
84 |
case portrait
85 |
86 |
87 | 88 |
89 |
90 | 91 | 92 | 93 | 94 |
95 | 96 |
97 |
98 |
99 | 100 | 101 | 102 | -------------------------------------------------------------------------------- /docs/documentation/idcardcamera/basecarddetectionsettings/orientation-swift.property.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | orientation| Documentation 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 |
19 | 57 | 58 |
59 |
60 | Instance Property 61 |

orientation

62 |
63 | 64 |
65 |
66 |
67 | Orientation of the card to be detected 68 |
69 |
70 | 71 | 72 | 73 |
74 |
75 |

Declaration

76 |
77 |
@objc var orientation: BaseCardDetectionSettings.Orientation { get set }
78 |
79 |
80 |

Discussion

The orientation is determined by the size. Setting the orientation to the other available value will flip the width and height of the size.

81 |
82 |
83 | 84 | 85 | 86 | 87 |
88 | 89 |
90 |
91 |
92 | 93 | 94 | 95 | -------------------------------------------------------------------------------- /docs/documentation/idcardcamera/basecarddetectionsettings/size.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | size| Documentation 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 |
19 | 57 | 58 |
59 |
60 | Instance Property 61 |

size

62 |
63 | 64 |
65 |
66 |
67 | Size of the card to detect 68 |
69 |
70 | 71 | 72 | 73 |
74 |
75 |

Declaration

76 |
77 |
@objc var size: CGSize
78 |
79 |
80 |

Discussion

Only the aspect ratio is considered by the app. The units are inconsequential.

81 |
82 |
83 | 84 | 85 | 86 | 87 |
88 | 89 |
90 |
91 |
92 | 93 | 94 | 95 | -------------------------------------------------------------------------------- /docs/documentation/idcardcamera/basecarddetectionviewcontroller/init().html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | init()| Documentation 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 |
19 | 57 | 58 |
59 |
60 | Initializer 61 |

init()

62 |
63 | 64 |
65 |
66 |
67 | No overview available. 68 |
69 |
70 | 71 | 72 | 73 |
74 |
75 |

Declaration

76 |
77 |
@objc init()
78 |
79 |
80 | 81 |
82 |
83 | 84 | 85 | 86 | 87 |
88 | 89 |
90 |
91 |
92 | 93 | 94 | 95 | -------------------------------------------------------------------------------- /docs/documentation/idcardcamera/basecarddetectionviewcontroller/observevalue(forkeypath:of:change:context:).html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | observeValue(forKeyPath:of:change:context:)| Documentation 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 |
19 | 57 | 58 |
59 |
60 | Instance Method 61 |

observeValue(forKeyPath:of:change:context:)

62 |
63 | 64 |
65 |
66 |
67 | No overview available. 68 |
69 |
70 | 71 | 72 | 73 |
74 |
75 |

Declaration

76 |
77 |
override func observeValue(forKeyPath keyPath: String?, of object: Any?, change: [NSKeyValueChangeKey : Any]?, context: UnsafeMutableRawPointer?)
78 |
79 |
80 | 81 |
82 |
83 | 84 | 85 | 86 | 87 |
88 | 89 |
90 |
91 |
92 | 93 | 94 | 95 | -------------------------------------------------------------------------------- /docs/documentation/idcardcamera/basecarddetectionviewcontroller/presentationcontrollerdiddismiss(_:).html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | presentationControllerDidDismiss(_:)| Documentation 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 |
19 | 57 | 58 |
59 |
60 | Instance Method 61 |

presentationControllerDidDismiss(_:)

62 |
63 | 64 |
65 |
66 |
67 | No overview available. 68 |
69 |
70 | 71 | 72 | 73 |
74 |
75 |

Declaration

76 |
77 |
override func presentationControllerDidDismiss(_ presentationController: UIPresentationController)
78 |
79 |
80 | 81 |
82 |
83 | 84 | 85 | 86 | 87 |
88 | 89 |
90 |
91 |
92 | 93 | 94 | 95 | -------------------------------------------------------------------------------- /docs/documentation/idcardcamera/basecarddetectionviewcontroller/viewdidload().html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | viewDidLoad()| Documentation 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 |
19 | 57 | 58 |
59 |
60 | Instance Method 61 |

viewDidLoad()

62 |
63 | 64 |
65 |
66 |
67 | No overview available. 68 |
69 |
70 | 71 | 72 | 73 |
74 |
75 |

Declaration

76 |
77 |
override func viewDidLoad()
78 |
79 |
80 | 81 |
82 |
83 | 84 | 85 | 86 | 87 |
88 | 89 |
90 |
91 |
92 | 93 | 94 | 95 | -------------------------------------------------------------------------------- /docs/documentation/idcardcamera/cardandbarcodedetectionsettings/barcodedetectionsettings.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | barcodeDetectionSettings| Documentation 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 |
19 | 57 | 58 |
59 |
60 | Instance Property 61 |

barcodeDetectionSettings

62 |
63 | 64 |
65 |
66 |
67 | Barcode detection settings (for the back of the card) 68 |
69 |
70 | 71 | 72 | 73 |
74 |
75 |

Declaration

76 |
77 |
@objc let barcodeDetectionSettings: BaseBarcodeDetectionSettings
78 |
79 |
80 |

Discussion

81 |
82 |
83 | 84 | 85 | 86 | 87 |
88 | 89 |
90 |
91 |
92 | 93 | 94 | 95 | -------------------------------------------------------------------------------- /docs/documentation/idcardcamera/cardandbarcodedetectionsettings/carddetectionsettings.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | cardDetectionSettings| Documentation 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 |
19 | 57 | 58 |
59 |
60 | Instance Property 61 |

cardDetectionSettings

62 |
63 | 64 |
65 |
66 |
67 | Card detection settings (for the front side of the card) 68 |
69 |
70 | 71 | 72 | 73 |
74 |
75 |

Declaration

76 |
77 |
@objc let cardDetectionSettings: BaseCardDetectionSettings
78 |
79 |
80 |

Discussion

81 |
82 |
83 | 84 | 85 | 86 | 87 |
88 | 89 |
90 |
91 |
92 | 93 | 94 | 95 | -------------------------------------------------------------------------------- /docs/documentation/idcardcamera/cardandbarcodedetectionsettings/init().html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | init()| Documentation 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 |
19 | 57 | 58 |
59 |
60 | Initializer 61 |

init()

62 |
63 | 64 |
65 |
66 |
67 | Convenience initializer 68 |
69 |
70 | 71 | 72 | 73 |
74 |
75 |

Declaration

76 |
77 |
@objc override init()
78 |
79 |
80 |

Discussion

Initializes settings with ISO ID-1 dimensions and PDF417 barcode

81 |
82 |
83 | 84 | 85 | 86 | 87 |
88 | 89 |
90 |
91 |
92 | 93 | 94 | 95 | -------------------------------------------------------------------------------- /docs/documentation/idcardcamera/cardandbarcodedetectionsettings/torchlevel.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | torchLevel| Documentation 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 |
19 | 57 | 58 |
59 |
60 | Instance Property 61 |

torchLevel

62 |
63 | 64 |
65 |
66 |
67 | Set the torch level when the user turns the torch on 68 |
69 |
70 | 71 | 72 | 73 |
74 |
75 |

Declaration

76 |
77 |
@objc var torchLevel: Float
78 |
79 |
80 |

Discussion

Range 0.0 (darkest) – 1 (brightest). Default value is 0.1.

81 |
82 |
83 | 84 | 85 | 86 | 87 |
88 | 89 |
90 |
91 |
92 | 93 | 94 | 95 | -------------------------------------------------------------------------------- /docs/documentation/idcardcamera/cardandbarcodedetectionviewcontroller/delegate.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | delegate| Documentation 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 |
19 | 57 | 58 |
59 |
60 | Instance Property 61 |

delegate

62 |
63 | 64 |
65 |
66 |
67 | Detection delegate 68 |
69 |
70 | 71 | 72 | 73 |
74 |
75 |

Declaration

76 |
77 |
@objc weak var delegate: CardAndBarcodeDetectionViewControllerDelegate?
78 |
79 |
80 |

Discussion

81 |
82 |
83 | 84 | 85 | 86 | 87 |
88 | 89 |
90 |
91 |
92 | 93 | 94 | 95 | -------------------------------------------------------------------------------- /docs/documentation/idcardcamera/cardandbarcodedetectionviewcontroller/init(settings:).html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | init(settings:)| Documentation 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 |
19 | 57 | 58 |
59 |
60 | Initializer 61 |

init(settings:)

62 |
63 | 64 |
65 |
66 |
67 | Initializer 68 |
69 |
70 | 71 | 72 | 73 |
74 |
75 |

Declaration

76 |
77 |
@objc init(settings: CardAndBarcodeDetectionSettings)
78 |
79 |
80 |
81 |

Parameters

82 |
83 | 84 |
settings
85 |
86 |

Detection settings

87 |
88 | 89 |
90 |
91 |

Discussion

92 |
93 |
94 | 95 | 96 | 97 | 98 |
99 | 100 |
101 |
102 |
103 | 104 | 105 | 106 | -------------------------------------------------------------------------------- /docs/documentation/idcardcamera/cardandbarcodedetectionviewcontroller/settings.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | settings| Documentation 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 |
19 | 57 | 58 |
59 |
60 | Instance Property 61 |

settings

62 |
63 | 64 |
65 |
66 |
67 | Detection settings 68 |
69 |
70 | 71 | 72 | 73 |
74 |
75 |

Declaration

76 |
77 |
@objc let settings: CardAndBarcodeDetectionSettings
78 |
79 |
80 |

Discussion

81 |
82 |
83 | 84 | 85 | 86 | 87 |
88 | 89 |
90 |
91 |
92 | 93 | 94 | 95 | -------------------------------------------------------------------------------- /docs/documentation/idcardcamera/cardandbarcodedetectionviewcontroller/viewdidload().html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | viewDidLoad()| Documentation 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 |
19 | 57 | 58 |
59 |
60 | Instance Method 61 |

viewDidLoad()

62 |
63 | 64 |
65 |
66 |
67 | No overview available. 68 |
69 |
70 | 71 | 72 | 73 |
74 |
75 |

Declaration

76 |
77 |
override func viewDidLoad()
78 |
79 |
80 | 81 |
82 |
83 | 84 | 85 | 86 | 87 |
88 | 89 |
90 |
91 |
92 | 93 | 94 | 95 | -------------------------------------------------------------------------------- /docs/documentation/idcardcamera/carddetectionsettings/torchlevel.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | torchLevel| Documentation 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 |
19 | 57 | 58 |
59 |
60 | Instance Property 61 |

torchLevel

62 |
63 | 64 |
65 |
66 |
67 | Set the torch level when the user turns the torch on 68 |
69 |
70 | 71 | 72 | 73 |
74 |
75 |

Declaration

76 |
77 |
@objc var torchLevel: Float
78 |
79 |
80 |

Discussion

Range 0.0 (darkest) – 1 (brightest). Default value is 0.1.

81 |
82 |
83 | 84 | 85 | 86 | 87 |
88 | 89 |
90 |
91 |
92 | 93 | 94 | 95 | -------------------------------------------------------------------------------- /docs/documentation/idcardcamera/carddetectionviewcontroller/delegate.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | delegate| Documentation 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 |
19 | 57 | 58 |
59 |
60 | Instance Property 61 |

delegate

62 |
63 | 64 |
65 |
66 |
67 | Card detection delegate 68 |
69 |
70 | 71 | 72 | 73 |
74 |
75 |

Declaration

76 |
77 |
@objc weak var delegate: CardDetectionViewControllerDelegate?
78 |
79 |
80 |

Discussion

81 |
82 |
83 | 84 | 85 | 86 | 87 |
88 | 89 |
90 |
91 |
92 | 93 | 94 | 95 | -------------------------------------------------------------------------------- /docs/documentation/idcardcamera/carddetectionviewcontroller/init().html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | init()| Documentation 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 |
19 | 57 | 58 |
59 |
60 | Initializer 61 |

init()

62 |
63 | 64 |
65 |
66 |
67 | Initializer 68 |
69 |
70 | 71 | 72 | 73 |
74 |
75 |

Declaration

76 |
77 |
@objc override init()
78 |
79 |
80 |

Discussion

81 |
82 |
83 | 84 | 85 | 86 | 87 |
88 | 89 |
90 |
91 |
92 | 93 | 94 | 95 | -------------------------------------------------------------------------------- /docs/documentation/idcardcamera/carddetectionviewcontroller/settings.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | settings| Documentation 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 |
19 | 57 | 58 |
59 |
60 | Instance Property 61 |

settings

62 |
63 | 64 |
65 |
66 |
67 | Card detection settings 68 |
69 |
70 | 71 | 72 | 73 |
74 |
75 |

Declaration

76 |
77 |
@objc var settings: CardDetectionSettings
78 |
79 |
80 |

Discussion

81 |
82 |
83 | 84 | 85 | 86 | 87 |
88 | 89 |
90 |
91 |
92 | 93 | 94 | 95 | -------------------------------------------------------------------------------- /docs/documentation/idcardcamera/carddetectionviewcontroller/viewdidload().html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | viewDidLoad()| Documentation 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 |
19 | 57 | 58 |
59 |
60 | Instance Method 61 |

viewDidLoad()

62 |
63 | 64 |
65 |
66 |
67 | No overview available. 68 |
69 |
70 | 71 | 72 | 73 |
74 |
75 |

Declaration

76 |
77 |
override func viewDidLoad()
78 |
79 |
80 | 81 |
82 |
83 | 84 | 85 | 86 | 87 |
88 | 89 |
90 |
91 |
92 | 93 | 94 | 95 | -------------------------------------------------------------------------------- /docs/documentation/idcardcamera/objectdetectionviewcontroller/prefersstatusbarhidden.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | prefersStatusBarHidden| Documentation 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 |
19 | 57 | 58 |
59 |
60 | Instance Property 61 |

prefersStatusBarHidden

62 |
63 | 64 |
65 |
66 |
67 | No overview available. 68 |
69 |
70 | 71 | 72 | 73 |
74 |
75 |

Declaration

76 |
77 |
override var prefersStatusBarHidden: Bool { get }
78 |
79 |
80 | 81 |
82 |
83 | 84 | 85 | 86 | 87 |
88 | 89 |
90 |
91 |
92 | 93 | 94 | 95 | -------------------------------------------------------------------------------- /docs/documentation/idcardcamera/objectdetectionviewcontroller/presentationcontrollerdiddismiss(_:).html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | presentationControllerDidDismiss(_:)| Documentation 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 |
19 | 57 | 58 |
59 |
60 | Instance Method 61 |

presentationControllerDidDismiss(_:)

62 |
63 | 64 |
65 |
66 |
67 | Inherited from UIAdaptivePresentationControllerDelegate.presentationControllerDidDismiss(_:). 68 |
69 |
70 | 71 | 72 | 73 |
74 |
75 |

Declaration

76 |
77 |
func presentationControllerDidDismiss(_ presentationController: UIPresentationController)
78 |
79 |
80 | 81 |
82 |
83 | 84 | 85 | 86 | 87 |
88 | 89 |
90 |
91 |
92 | 93 | 94 | 95 | -------------------------------------------------------------------------------- /docs/documentation/idcardcamera/objectdetectionviewcontroller/viewdidappear(_:).html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | viewDidAppear(_:)| Documentation 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 |
19 | 57 | 58 |
59 |
60 | Instance Method 61 |

viewDidAppear(_:)

62 |
63 | 64 |
65 |
66 |
67 | No overview available. 68 |
69 |
70 | 71 | 72 | 73 |
74 |
75 |

Declaration

76 |
77 |
override func viewDidAppear(_ animated: Bool)
78 |
79 |
80 | 81 |
82 |
83 | 84 | 85 | 86 | 87 |
88 | 89 |
90 |
91 |
92 | 93 | 94 | 95 | -------------------------------------------------------------------------------- /docs/documentation/idcardcamera/objectdetectionviewcontroller/viewdidload().html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | viewDidLoad()| Documentation 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 |
19 | 57 | 58 |
59 |
60 | Instance Method 61 |

viewDidLoad()

62 |
63 | 64 |
65 |
66 |
67 | No overview available. 68 |
69 |
70 | 71 | 72 | 73 |
74 |
75 |

Declaration

76 |
77 |
override func viewDidLoad()
78 |
79 |
80 | 81 |
82 |
83 | 84 | 85 | 86 | 87 |
88 | 89 |
90 |
91 |
92 | 93 | 94 | 95 | -------------------------------------------------------------------------------- /docs/documentation/idcardcamera/objectdetectionviewcontroller/viewwilldisappear(_:).html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | viewWillDisappear(_:)| Documentation 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 |
19 | 57 | 58 |
59 |
60 | Instance Method 61 |

viewWillDisappear(_:)

62 |
63 | 64 |
65 |
66 |
67 | No overview available. 68 |
69 |
70 | 71 | 72 | 73 |
74 |
75 |

Declaration

76 |
77 |
override func viewWillDisappear(_ animated: Bool)
78 |
79 |
80 | 81 |
82 |
83 | 84 | 85 | 86 | 87 |
88 | 89 |
90 |
91 |
92 | 93 | 94 | 95 | -------------------------------------------------------------------------------- /docs/documentation/idcardcamera/objectdetectionviewcontroller/viewwilltransition(to:with:).html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | viewWillTransition(to:with:)| Documentation 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 |
19 | 57 | 58 |
59 |
60 | Instance Method 61 |

viewWillTransition(to:with:)

62 |
63 | 64 |
65 |
66 |
67 | No overview available. 68 |
69 |
70 | 71 | 72 | 73 |
74 |
75 |

Declaration

76 |
77 |
override func viewWillTransition(to size: CGSize, with coordinator: UIViewControllerTransitionCoordinator)
78 |
79 |
80 | 81 |
82 |
83 | 84 | 85 | 86 | 87 |
88 | 89 |
90 |
91 |
92 | 93 | 94 | 95 | -------------------------------------------------------------------------------- /docs/documentation/idcardcamera/perspectivecorrectionparamsoperation/init(pixelbuffer:orientation:rect:).html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | init(pixelBuffer:orientation:rect:)| Documentation 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 |
19 | 57 | 58 |
59 |
60 | Initializer 61 |

init(pixelBuffer:orientation:rect:)

62 |
63 | 64 |
65 |
66 |
67 | No overview available. 68 |
69 |
70 | 71 | 72 | 73 |
74 |
75 |

Declaration

76 |
77 |
init(pixelBuffer: CVImageBuffer, orientation: CGImagePropertyOrientation, rect: VNRectangleObservation)
78 |
79 |
80 | 81 |
82 |
83 | 84 | 85 | 86 | 87 |
88 | 89 |
90 |
91 |
92 | 93 | 94 | 95 | -------------------------------------------------------------------------------- /docs/documentation/idcardcamera/perspectivecorrectionparamsoperation/main().html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | main()| Documentation 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 |
19 | 57 | 58 |
59 |
60 | Instance Method 61 |

main()

62 |
63 | 64 |
65 |
66 |
67 | No overview available. 68 |
69 |
70 | 71 | 72 | 73 |
74 |
75 |

Declaration

76 |
77 |
override func main()
78 |
79 |
80 | 81 |
82 |
83 | 84 | 85 | 86 | 87 |
88 | 89 |
90 |
91 |
92 | 93 | 94 | 95 | -------------------------------------------------------------------------------- /docs/documentation/idcardcamera/torchsettings/torchlevel.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | torchLevel| Documentation 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 |
19 | 57 | 58 |
59 |
60 | Instance Property 61 |

torchLevel

62 |
63 | 64 |
65 |
66 |
67 | Set the torch level when the user turns the torch on 68 |
69 |
70 | 71 | 72 | 73 |
74 |
75 |

Declaration

76 |
77 |
@objc var torchLevel: Float { get }
78 |
79 |
80 |

Discussion

Range 0.0 (darkest) – 1 (brightest). Default value is 0.1.

81 |
82 |
83 | 84 | 85 | 86 | 87 |
88 | 89 |
90 |
91 |
92 | 93 | 94 | 95 | -------------------------------------------------------------------------------- /docs/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AppliedRecognition/ID-Card-Camera/0db686702a5ed728cd236efb40bc1c3f9ed8fcfd/docs/favicon.ico -------------------------------------------------------------------------------- /docs/favicon.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /docs/img/added-icon.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /docs/img/deprecated-icon.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /docs/img/modified-icon.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /docs/index.html: -------------------------------------------------------------------------------- 1 | Documentation 2 | --------------------------------------------------------------------------------