Home

Awesome

openalpr-ios

A Ruby script that builds an Xcode project and a universal iOS static library framework for the openalpr library. As of this writing, this project is compatible with the 2.2.x release of OpenALPR and later.

Running the script will:

Requirements

As of this writing, the latest openalpr commit on the master branch was eecd41e097534f84e2669da24d4aed4bf75a1132

Installation

Usage

Bitcode

Because the OpenCV binary framework release is compiled without bitcode, the other frameworks built by this script are also built without it, which ultimately means your Xcode project also cannot be built with bitcode enabled. Per this message, it sounds like we want this feature disabled for OpenCV anyway.

To disable bitcode in your project:

Linking To Frameworks

AlprSample App

You can use the AlprSample app included in this project to test your installation. It has one view that simply presents a fixed (pre-selected) license plate image, and a table view below it showing scanned plate values for that image.

To run the app, you will need to build the frameworks with build_frameworks.rb. Then, in Xcode, open the project and follow these steps:

  1. Find a plate image file you wish to test with and add it to the project.
  2. Edit ViewController.mm and change the value of plateFilename to the name of the file you added in step 1, e.g. NSString *plateFilename = @"license_plate.jpg";
  3. Link the project to the dependency frameworks and add the required resources per the "Linking To Frameworks" section above.
  4. Run the app! The library should work in a simulator.

Misc Notes

Dynamic Library?

I initially attempted to build dynamic libraries, since they are supported as of iOS 9. It required me to update the rpath of the dynamic libraries. Then the frameworks must be embedded into the application. However, even after doing that, I ran into odd run-time errors where the libopenalpr.dylib library could not load the statedetection library. PRs welcome!

AlprSample Creation

Steps for creating the app are kept here for posterity.

Tips

Credits