Swiftpack.co - AppliedRecognition/ID-Card-Camera as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by AppliedRecognition.
AppliedRecognition/ID-Card-Camera v1.4.2
iOS framework that detects an ID card in a camera view and returns the de-warped image of the ID card.
⭐️ 5
🕓 2 weeks ago
iOS
.package(url: "https://github.com/AppliedRecognition/ID-Card-Camera.git", from: "v1.4.2")

Cocoapods

ID Card Camera

  • Detects an ID card in a camera view and returns the de-warped image of the ID card.
  • Scans PDF417 barcode on the back side of an ID card.

Installation

Using CocoaPods

Add the following pod in your Podfile and run pod install.

pod 'ID-Card-Camera', '~> 1.0'

Using Swift Package Manager

  • In Xcode select File -> Add Packages ... from the top menu.
  • Enter https://github.com/AppliedRecognition/ID-Card-Camera.git in the search bar.
  • Click the Add Package button.

Usage

import UIKit
import IDCardCamera

class ViewController: UIViewController, CardDetectionViewControllerDelegate {

    @IBOutlet var imageView: UIImageView!

    func scanIDCard() {
        // Set the scan settings
        // In this example the aspect ratio is that of a typical credit card
        // The width and height units are not important
        let settings = CardDetectionSettings(width: 85.6, height: 53.98)

        // Create the view controller
        let controller = CardDetectionViewController()

        // Set the delegate that will receive the result
        controller.delegate = self

        // Present the card detection view controller
        self.present(controller, animated: true, completion: nil)
    }

    func cardDetectionViewController(_ viewController: CardDetectionViewController, didDetectCard image: CGImage, withSettings settings: CardDetectionSettings) {
        // The card has been scanned
        // Display the image in the image view
        self.imageView.image = UIImage(cgImage: image)
    }
}

API documentation

Change log

GitHub

link
Stars: 5
Last commit: 2 weeks ago
jonrohan Something's broken? Yell at me @ptrpavlik. Praise and feedback (and money) is also welcome.

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics