Latest 1.0.2
Homepage https://github.com/yasirmturk/openalpr-swift
License GPL 3.0
Platforms ios 9.0, requires ARC
Dependencies OpenCV, TesseractOCRiOS
Frameworks CoreGraphics, UIKit, opencv2*
Authors

OpenALPRSwift is an iOS Framework for the open source OpenALPR Automatic License Plate Recognition library http://www.openalpr.com. It can be used in Swift and Objective-C

The library analyzes images and video streams to identify license plates. The output is the text representation of any license plate characters.

Current version is using precompiled Frameworks from cardash:

  • leptonica.framework
  • tesseract.framework

openalpr.framework compiled from v2.3.0 and dependency pod v3.1.0.1 for OpenCV

Requirements

  • iOS 9+

Installation

CocoaPods

CocoaPods is a dependency manager for Cocoa projects. You can install it with the following command:

$ gem install cocoapods

CocoaPods 1.3.0.beta.2+ is required to build OpenALPRSwift 1.0.0+.

To integrate OpenALPRSwift into your Xcode project using CocoaPods, specify it in your Podfile:

platform :ios, '9.0'
use_frameworks!

target '<Your Target Name>' do
    #pod 'OpenALPRSwift', '~> 1.0.0'
    pod 'OpenALPRSwift', :git => 'https://github.com/yasirmturk/openalpr-swift.git', :tag => 'v1.0.0'
end

Then, run the following command:

$ pod install

If you get an error complaining about "transitive dependencies" then put this in your Podfile

pre_install do |installer|
    Pod::Installer::Xcode::TargetValidator.send(:define_method, :verify_no_static_framework_transitive_dependencies) {}
end

Usage

import OpenALPRSwift
in your class and then

    let imagePath = Bundle.main.path(forResource: "dk_vb33742", ofType: "jpg")
    let alprScanner = OAScanner(country: "eu", patternRegion: "dk")
    alprScanner?.scanImage(atPath: imagePath, onSuccess: { (plates) in
        plates?.forEach({ (plate) in
            print("result: (plate.number)")
        })
    }, onFailure: { (error) in
        print("error: (error?.localizedDescription)")
    })

or you can pass a UIImage as well

Options

country

Specifies which OpenALPR config file to load, corresponding to the country whose plates you wish to recognize. Currently supported values are: [au, auwide, br, eu, fr, gb, kr, kr2, mx, sg, us, vn2]

region

Specifies which plate pattern to look for e.g. dk for Denmark or al for Alabama. Complete list of patterns is available under runtime_data/postprocess/*.patterns

Documentation

Detailed documentation is available at doc.openalpr.com

License

GPLv3
http://www.gnu.org/licenses/gpl-3.0.html

Credits

Latest podspec

{
    "name": "OpenALPRSwift",
    "version": "1.0.2",
    "summary": "iOS Framework for the openalpr library ready to use in Swift and Objective-C.",
    "homepage": "https://github.com/yasirmturk/openalpr-swift",
    "license": {
        "type": "GPL 3.0",
        "file": "LICENSE"
    },
    "authors": {
        "Yasir M Tu00fcrk": "[email protected]"
    },
    "social_media_url": "https://twitter.com/yasirmturk",
    "platforms": {
        "ios": "9.0"
    },
    "requires_arc": true,
    "source": {
        "git": "https://github.com/yasirmturk/openalpr-swift.git",
        "tag": "v1.0.2",
        "submodules": true
    },
    "source_files": "openalpr-swift/**/*.{h,mm,swift}",
    "resources": [
        "openalpr-swift/openalpr.conf",
        "openalpr-swift/runtime_data"
    ],
    "frameworks": [
        "CoreGraphics",
        "UIKit"
    ],
    "weak_frameworks": "opencv2",
    "static_framework": true,
    "vendored_frameworks": "lib/openalpr.framework",
    "pod_target_xcconfig": {
        "ENABLE_BITCODE": "NO",
        "OTHER_LDFLAGS": "-lstdc++ -lz -llept -ltesseract_all",
        "LIBRARY_SEARCH_PATHS": ""${PODS_ROOT}/TesseractOCRiOS/TesseractOCR/lib"",
        "FRAMEWORK_SEARCH_PATHS": ""${PODS_ROOT}/OpenCV" "${PODS_ROOT}/TesseractOCRiOS/Products"",
        "CLANG_WARN_DOCUMENTATION_COMMENTS": "NO"
    },
    "dependencies": {
        "OpenCV": [
            "~> 3.1.0.1"
        ],
        "TesseractOCRiOS": [
            "~> 3.03"
        ]
    }
}

Pin It on Pinterest

Share This