Skip to content

Instantly share code, notes, and snippets.

@zhouhao27
Last active July 13, 2018 06:17
Show Gist options
  • Save zhouhao27/0417b6065473fe20d5e713e61a7780da to your computer and use it in GitHub Desktop.
Save zhouhao27/0417b6065473fe20d5e713e61a7780da to your computer and use it in GitHub Desktop.
Compile OpenAlpr for iOS
  1. Download the source code

git clone https://github.com/openalpr/openalpr.git

cd openalpr

  1. Copy dependecies to framework folder

Regarding with the compiling of the dependent libraris like opencv2.framework, leptonica.framework and tesseract.framework is another story.

  1. Create the build folder in src

cd src

mkdir build

cd build

  1. Add iOS CMake toolchain from Polly

git clone https://github.com/ruslo/polly.git

  1. Generate the Xcode project for iOS

export XCODE_XCCONFIG_FILE=$PWD/polly/scripts/NoCodeSign.xcconfig

cmake .. -DCMAKE_TOOLCHAIN_FILE=./polly/ios-nocodesign-10-3.cmake -DTesseract_FRAMEWORK_PATH=../frameworks/tesseract.framework -DOpenCV_FRAMEWORK_PATH=../frameworks/opencv2.framework -DLeptonica_FRAMEWORK_PATH=../frameworks/leptonica.framework -DOpenCV_VERSION=3.4.1 -DOpenCV_VERSION_MAJOR=3 -DWITH_DAEMON=OFF -DWITH_STATEDETECTION=ON -GXcode

NOTICE:

Got a compile error for "Can't find opencv2/*.hpp". I copy all files under opencv2.framework/Headers to opencv2.framework/Headers/opencv2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment