Coder Social home page Coder Social logo

wissem01chiha / alpr Goto Github PK

View Code? Open in Web Editor NEW
4.0 2.0 0.0 172.26 MB

Automatic Tunisian License Plate Recognition System.

License: GNU General Public License v3.0

Python 98.99% Shell 1.01%
computer-vision image-processing raspberry-pi-3 alpr yolo python3 video-processing detection intelligent-systems opencv opencv-python recognition yolov3 alpr-unconstrained parking-management recognition-algorithms

alpr's Introduction

Automatic License Plate Recognition

Licence GitHub top language GitHub commit activity

Table of Contents

Description

ALPR (Automated License Plate Recognition) is a multistage software application designed for the identification and registration of cars' license plates within parking lots or road areas, in both constrained and unconstrained environments

General Notes

  • The project was primarily designed to be integrated within an end-to-end real-time embedded IoT application in public parking areas.
  • The package was tested in the development process on Raspberry-pi-3, Model B+, 2017 Before the integration of Yolo v3, you may encounter installation or runtime conflicts. If this happens, please open an issue. issue
  • Streaming data from the default Raspberry-pi camera module function is not tested, can lead to perfermances issues.
  • other embedded platfoms are not testd or supported
  • For C++ devllopers, there is no option to use this version with C or C++.

Build and Installation

Warning: Building OpenCV-lib from source, which is a dependency of the project on Raspberry Pi boards, can fail and consume time. We recommend checking the suitable version of OpenCV for the board and installing the precompiled Python packages for OpenCV listed in the requirements

Build

To build the package using python setuptools run :

python setup.py sdist --dist-dir build

It will generate a distributable version under the build/ directory.

or with :

python -m build 

to get a *.tar.gz and *.whl files under the dist/ diractory.

Installation on Raspberry pi Board

Update package information and upgrade installed packages

    sudo apt update
    sudo apt upgrade

Upgrade Python packages: pip, setuptools, and wheel

pip install --upgrade pip setuptools wheel

Install library dependencies

sudo apt install python3-opencv libopencv-dev

clone to the repository

git clone [email protected]:wissem01chiha/ALPR.git

Navigate to the repository folder and run

pip3  install ./dist/cil4sys-0.1.1.tar.gz

This will install the application with it dependencies and data files.

Usage

connect your camera to raspberry pi board throgh the USB port or the default raspiberry port, only one camera wich is ste to default will be detected for the raspi kit camera you miust enable the camera interface

after installation navigate to the main script diractory folder and run :

python3 main.py 

References

  • Automated License Plate Recognition: A Survey on Methods and Techniques J. Shashirangana et al. Applied Sciences, 2020, IEEE.
  • A Robust Real-Time Automatic License Plate Recognition Based on the YOLO Detector R. Laroca, E. Severo arXiv, 2018, MDPI.
  • Towards End-to-End Car License Plates Detection and Recognition with Deep Neural Networks Hui Li, Peng Wang, and Chunhua Shen IEEE, 2018.
  • Challenges in Automatic License Plate Recognition System: An Indian Scenario P. Mukhija, P. K. Dahiya, Priyanka IEEE, 2021.
  • A Comprehensive Review Of Yolo: From Yolov1 And Beyond Juan Terven, Diana Margarita Córdova-Esparza arXiv, 2023, MDPI.
  • Automatic License Plate Recognition via Sliding-Window Darknet-YOLO Deep Learning Lee, J. S., Su, Y. W., and Shen, C. C. Image and Vision Computing, 2019, Elsevier.
  • RGB to HSI Color Space Conversion via MACT Algorithm R. Aruna Jayashree International Conference on Communication and Signal Processing, 2013, India.
  • Blind Estimation of White Gaussian Noise Variance in Highly Textured Images M. Ponomarenko, N. Gapon, V. Voronin, K. Egiazarian arXiv, 2017.
  • Realization of the Contrast Limited Adaptive Histogram Equalization (CLAHE) for Real-Time Image Enhancement ALI M. REZA Journal of VLSI Signal Processing, 2003.
  • Survey of Smart Parking Systems Mathias Gabriel Diaz Ogás MDPI, 2020.
  • Image Denoising Using Wavelet Transform Sachin Ruika, D Doye ICMET, 2010.
  • The Unscented Kalman Filter for Nonlinear Estimation Wan, Eric A and Van Der Merwe, Rudolph Proceedings of the IEEE 2000 Adaptive Systems for Signal Processing, Communications, and Control Symposium (Cat. No. 00EX373), 2000.
  • On-Line Smoothing for an Integrated Navigation System with Low-Cost MEMS Inertial Sensors Chiang, Kai-Wei et al. Sensors, 2012.
  • Maximum Likelihood Estimates of Linear Dynamic Systems Rauch, Herbert E and Tung, F and Striebel, Charlotte T AIAA Journal, 1965.

Contributing


Please see first the CHANGELOG guide.

Feel free to mail to :

Contributors

License


This project is actually under The GNU General Public License.
See the LICENCE file for more details.

alpr's People

Contributors

hamdahmida avatar kmezhoud avatar wissem01chiha avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

alpr's Issues

How to generate /build folder

Hi,
It is not an issue taht could be labeled by need help or doc
I removed /build folder while am thinking that will be generated by python3 -m build for python3 setup.py sdist , but it is not the case.
How todo?
Thanks

dependency conflicts scipy and stochastic

Hi,
Thank you for this package.
In the end of installation I got this Error message

ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
stochastic 0.7.0 requires scipy<2.0,>=1.8, but you have scipy 1.6.0 which is incompatible.

The installation is well done (second installation)

site-packages is not writeable
Processing ./dist/cil4sys-0.1.tar.gz
  Preparing metadata (setup.py) ... done
Requirement already satisfied: multiprocess==0.70.15 in /home/kirus/.local/lib/python3.10/site-packages (from cil4sys==0.1) (0.70.15)
Requirement already satisfied: numpy==1.23.5 in /home/kirus/.local/lib/python3.10/site-packages (from cil4sys==0.1) (1.23.5)
Requirement already satisfied: opencv_python==4.5.5.62 in /home/kirus/.local/lib/python3.10/site-packages (from cil4sys==0.1) (4.5.5.62)
Requirement already satisfied: Pillow==10.0.0 in /home/kirus/.local/lib/python3.10/site-packages (from cil4sys==0.1) (10.0.0)
Requirement already satisfied: pytesseract==0.3.10 in /home/kirus/.local/lib/python3.10/site-packages (from cil4sys==0.1) (0.3.10)
Requirement already satisfied: scipy==1.6.0 in /home/kirus/.local/lib/python3.10/site-packages (from cil4sys==0.1) (1.6.0)
Requirement already satisfied: setuptools==68.1.2 in /home/kirus/.local/lib/python3.10/site-packages (from cil4sys==0.1) (68.1.2)
Requirement already satisfied: scikit-image==0.18.1 in /home/kirus/.local/lib/python3.10/site-packages (from cil4sys==0.1) (0.18.1)
Requirement already satisfied: dill>=0.3.7 in /home/kirus/.local/lib/python3.10/site-packages (from multiprocess==0.70.15->cil4sys==0.1) (0.3.7)
Requirement already satisfied: packaging>=21.3 in /home/kirus/.local/lib/python3.10/site-packages (from pytesseract==0.3.10->cil4sys==0.1) (23.2)
Requirement already satisfied: matplotlib!=3.0.0,>=2.0.0 in /home/kirus/.local/lib/python3.10/site-packages (from scikit-image==0.18.1->cil4sys==0.1) (3.8.0)
Requirement already satisfied: networkx>=2.0 in /home/kirus/.local/lib/python3.10/site-packages (from scikit-image==0.18.1->cil4sys==0.1) (3.2.1)
Requirement already satisfied: imageio>=2.3.0 in /home/kirus/.local/lib/python3.10/site-packages (from scikit-image==0.18.1->cil4sys==0.1) (2.33.0)
Requirement already satisfied: tifffile>=2019.7.26 in /home/kirus/.local/lib/python3.10/site-packages (from scikit-image==0.18.1->cil4sys==0.1) (2023.9.26)
Requirement already satisfied: PyWavelets>=1.1.1 in /home/kirus/.local/lib/python3.10/site-packages (from scikit-image==0.18.1->cil4sys==0.1) (1.5.0)
Requirement already satisfied: contourpy>=1.0.1 in /home/kirus/.local/lib/python3.10/site-packages (from matplotlib!=3.0.0,>=2.0.0->scikit-image==0.18.1->cil4sys==0.1) (1.1.1)
Requirement already satisfied: cycler>=0.10 in /home/kirus/.local/lib/python3.10/site-packages (from matplotlib!=3.0.0,>=2.0.0->scikit-image==0.18.1->cil4sys==0.1) (0.12.1)
Requirement already satisfied: fonttools>=4.22.0 in /home/kirus/.local/lib/python3.10/site-packages (from matplotlib!=3.0.0,>=2.0.0->scikit-image==0.18.1->cil4sys==0.1) (4.43.1)
Requirement already satisfied: kiwisolver>=1.0.1 in /home/kirus/.local/lib/python3.10/site-packages (from matplotlib!=3.0.0,>=2.0.0->scikit-image==0.18.1->cil4sys==0.1) (1.4.5)
Requirement already satisfied: pyparsing>=2.3.1 in /usr/lib/python3/dist-packages (from matplotlib!=3.0.0,>=2.0.0->scikit-image==0.18.1->cil4sys==0.1) (2.4.7)
Requirement already satisfied: python-dateutil>=2.7 in /home/kirus/.local/lib/python3.10/site-packages (from matplotlib!=3.0.0,>=2.0.0->scikit-image==0.18.1->cil4sys==0.1) (2.8.2)
Requirement already satisfied: six>=1.5 in /usr/lib/python3/dist-packages (from python-dateutil>=2.7->matplotlib!=3.0.0,>=2.0.0->scikit-image==0.18.1->cil4sys==0.1) (1.16.0)
Building wheels for collected packages: cil4sys
  Building wheel for cil4sys (setup.py) ... done
  Created wheel for cil4sys: filename=cil4sys-0.1-py3-none-any.whl size=17985676 sha256=451df7ca4c975f6100e09f74ba811d141faa3d32deffd279c1290217194d3133
  Stored in directory: /home/kirus/.cache/pip/wheels/94/c5/9b/8e49563ac201c4a1a3daaa6a738063425fe2865d1b859fd60a
Successfully built cil4sys
Installing collected packages: cil4sys
  Attempting uninstall: cil4sys
    Found existing installation: cil4sys 0.1
    Uninstalling cil4sys-0.1:
      Successfully uninstalled cil4sys-0.1
Successfully installed cil4sys-0.1

BUT
When I run python3 main.py

I got error during importing packages

python3 main.py 
Traceback (most recent call last):
  File "/media/DATA/ComputerVision/cil4sys/main.py", line 44, in <module>
    from        skimage import  filters
  File "/home/kirus/.local/lib/python3.10/site-packages/skimage/filters/__init__.py", line 4, in <module>
    from .edges import (sobel, sobel_h, sobel_v,
  File "/home/kirus/.local/lib/python3.10/site-packages/skimage/filters/edges.py", line 18, in <module>
    from ..restoration.uft import laplacian
  File "/home/kirus/.local/lib/python3.10/site-packages/skimage/restoration/__init__.py", line 5, in <module>
    from .deconvolution import wiener, unsupervised_wiener, richardson_lucy
  File "/home/kirus/.local/lib/python3.10/site-packages/skimage/restoration/deconvolution.py", line 6, in <module>
    from scipy.signal import convolve
  File "/home/kirus/.local/lib/python3.10/site-packages/scipy/signal/__init__.py", line 302, in <module>
    from .filter_design import *
  File "/home/kirus/.local/lib/python3.10/site-packages/scipy/signal/filter_design.py", line 16, in <module>
    from scipy import special, optimize, fft as sp_fft
  File "/home/kirus/.local/lib/python3.10/site-packages/scipy/optimize/__init__.py", line 421, in <module>
    from ._shgo import shgo
  File "/home/kirus/.local/lib/python3.10/site-packages/scipy/optimize/_shgo.py", line 9, in <module>
    from scipy import spatial
  File "/home/kirus/.local/lib/python3.10/site-packages/scipy/spatial/__init__.py", line 107, in <module>
    from . import distance, transform
  File "/home/kirus/.local/lib/python3.10/site-packages/scipy/spatial/transform/__init__.py", line 19, in <module>
    from .rotation import Rotation, Slerp
ImportError: /home/kirus/.local/lib/python3.10/site-packages/scipy/spatial/transform/rotation.cpython-310-x86_64-linux-gnu.so: undefined symbol: _PyGen_Send

After updating scipy with pip install scipy==1.8.1 , The package seems to work well with the default video.mp4.

python3 main.py 
[INFO] Configuring Environment ...
[INFO] Reading Variable Files ...
[INFO] Starting Video Processing
[INFO] Capturing video ...
[SUCESS] video captured in 0 seconds
[INFO] Generating Frames ...
[SUCESS] 181 frames generated in 7 seconds
[INFO] Preprocessing Frames ...
[SUCESS] frames preprocessed in 17 seconds
[INFO] Filtring and Denoisng Frames ...
[SUCESS] frames filtred and denoised in 19 seconds
[INFO] frames sorted in 19 seconds
[INFO] Numerical Character Detection ... 

and during this /data/images/video_frames and /data/images/roi_frames folders were generated.

Maybe it is necessary to update setup.py with scipy==1.8.1

But after I got this error

---------------------------------------------
[FAIL] licence plate not detected ! 
[INFO] processing possible best matched numbers ...
[INFO] car number is:0-0
[INFO] Time Remaining:19
Traceback (most recent call last):
  File "/home/kirus/.local/lib/python3.10/site-packages/pytesseract/pytesseract.py", line 255, in run_tesseract
    proc = subprocess.Popen(cmd_args, **subprocess_args())
  File "/usr/lib/python3.10/subprocess.py", line 971, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/usr/lib/python3.10/subprocess.py", line 1863, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'tesseract'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/media/DATA/ComputerVision/cil4sys/main.py", line 347, in <module>
    chars = pytesseract.image_to_string(img_result, lang='eng')
  File "/home/kirus/.local/lib/python3.10/site-packages/pytesseract/pytesseract.py", line 423, in image_to_string
    return {
  File "/home/kirus/.local/lib/python3.10/site-packages/pytesseract/pytesseract.py", line 426, in <lambda>
    Output.STRING: lambda: run_and_get_output(*args),
  File "/home/kirus/.local/lib/python3.10/site-packages/pytesseract/pytesseract.py", line 288, in run_and_get_output
    run_tesseract(**kwargs)
  File "/home/kirus/.local/lib/python3.10/site-packages/pytesseract/pytesseract.py", line 260, in run_tesseract
    raise TesseractNotFoundError()
pytesseract.pytesseract.TesseractNotFoundError: tesseract is not installed or it's not in your PATH. See README file for more information.

How we an setup inputs like live camera or recorded video?

Note:
I am on PC without camera (ubuntu). And I just want to use camera recorded video as INPUT.

Many Thanks,
Karim

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.