Skip to content

Instantly share code, notes, and snippets.

@ctrl-freak
Last active January 6, 2022 04:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ctrl-freak/da46bf58114a276f3af0f85298fe1c1c to your computer and use it in GitHub Desktop.
Save ctrl-freak/da46bf58114a276f3af0f85298fe1c1c to your computer and use it in GitHub Desktop.
OpenALPR on Raspbian buster
## Prep SD card
# wpa_supplicant.conf
touch /boot/ssh
echo "enable_uart=1" >> /boot/config.txt
## Boot, ssh
uname -a
# Linux gatelpr 5.10.63+ #1496 Wed Dec 1 15:57:05 GMT 2021 armv6l GNU/Linux
lsb_release -a
# No LSB modules are available.
# Distributor ID: Raspbian
# Description: Raspbian GNU/Linux 10 (buster)
# Release: 10
# Codename: buster
sudo raspi-config
## Interface Options > Camera: Enable
## Test camera
raspistill -o ~/image.jpg
sudo apt-get update && sudo apt-get install -y openalpr openalpr-daemon openalpr-utils libopenalpr-dev
## For some reason alpr returns error
# Error opening data file /usr/share/openalpr/runtime_data/ocr/lau.traineddata
# Please make sure the TESSDATA_PREFIX environment variable is set to your "tessdata" directory.
## Doesn't seem to respect
export TESSDATA_PREFIX="/usr/share/openalpr/runtime_data/ocr/tessdata"
## So soft link traineddata to where it expects it:
sudo cp --symbolic-link /usr/share/openalpr/runtime_data/ocr/tessdata/*.traineddata /usr/share/openalpr/runtime_data/ocr
## ls /usr/share/openalpr/runtime_data/ocr/ -l
# total 32
# lrwxrwxrwx 1 root root 61 Jan 6 03:57 lau.traineddata -> /usr/share/openalpr/runtime_data/ocr/tessdata/lau.traineddata
# lrwxrwxrwx 1 root root 61 Jan 6 03:57 leu.traineddata -> /usr/share/openalpr/runtime_data/ocr/tessdata/leu.traineddata
# lrwxrwxrwx 1 root root 61 Jan 6 03:57 lgb.traineddata -> /usr/share/openalpr/runtime_data/ocr/tessdata/lgb.traineddata
# lrwxrwxrwx 1 root root 62 Jan 6 03:57 lkr2.traineddata -> /usr/share/openalpr/runtime_data/ocr/tessdata/lkr2.traineddata
# lrwxrwxrwx 1 root root 61 Jan 6 03:57 lkr.traineddata -> /usr/share/openalpr/runtime_data/ocr/tessdata/lkr.traineddata
# lrwxrwxrwx 1 root root 61 Jan 6 03:57 lsg.traineddata -> /usr/share/openalpr/runtime_data/ocr/tessdata/lsg.traineddata
# lrwxrwxrwx 1 root root 61 Jan 6 03:57 lus.traineddata -> /usr/share/openalpr/runtime_data/ocr/tessdata/lus.traineddata
# drwxr-xr-x 2 root root 4096 Jan 6 03:50 tessdata
alpr -c auwide ~/plates.jpg
man alpr
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment