Install Module openalpr

Asked

Viewed 1,049 times

0

Good evening developers.
I need to download a module for Python, but I’m not getting it, I looked on the internet and mainly on Stackoverflow in English, but nothing helped, if anyone can help me I would be grateful.

Edit:
Since yesterday I was trying to install the module on the notebook, I tried to install via Pip, and taking the package from Git, extracted the file, opened the CMD and went and installed it correctly, but when I was going to run the file gave module problem not found, then I went to try again just now and the module passed , however other errors were found, I will be leaving images

Click Run to see some images:

<html>
  <head></head>
  <body>

    <blockquote class="imgur-embed-pub" lang="en" data-id="MdQcTwd"><a href="//imgur.com/MdQcTwd">View post on imgur.com</a></blockquote><script async src="//s.imgur.com/min/embed.js" charset="utf-8"></script>

<blockquote class="imgur-embed-pub" lang="en" data-id="udwI9Ap"><a href="//imgur.com/udwI9Ap">View post on imgur.com</a></blockquote><script async src="//s.imgur.com/min/embed.js" charset="utf-8"></script>
  </body>
</html>

Edit2:
At the request of @Sidon error code:

    Traceback (most recent call last):
  File "C:\Users\Andreza\AppData\Local\Programs\Python\Python35\lib\site-packages\openalpr\openalpr.py", line 48, in __init__
    self._openalprpy_lib = ctypes.cdll.LoadLibrary("libopenalprpy.dll")
  File "C:\Users\Andreza\AppData\Local\Programs\Python\Python35\lib\ctypes\__init__.py", line 425, in LoadLibrary
    return self._dlltype(name)
  File "C:\Users\Andreza\AppData\Local\Programs\Python\Python35\lib\ctypes\__init__.py", line 347, in __init__
    self._handle = _dlopen(self._name, mode)
OSError: [WinError 126] Não foi possível encontrar o módulo especificado

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "C:\Users\Andreza\Desktop\asdasd.py", line 3, in <module>
    alpr = Alpr("us", "/path/to/openalpr.conf", "/path/to/runtime_data")
  File "C:\Users\Andreza\AppData\Local\Programs\Python\Python35\lib\site-packages\openalpr\openalpr.py", line 58, in __init__
    raise nex
OSError: Unable to locate the OpenALPR library. Please make sure that OpenALPR is properly installed on your system and that the libraries are in the appropriate paths.

Module: openalpr

  • Isn’t that right? https://github.com/openalpr/openalpr/tree/master/src/bindings/python

  • @Andersoncarloswoss - Yes, but I’m having trouble executing

  • Then edit your question and add all this information. Put all the steps you have done and what is the error returned. As it stands, your question is lacking in detail and can be closed because it is not clear.

  • @Andersoncarloswoss All right

1 answer

1

Openalpr itself is a binary package developed in C (and other languages) and optionally a webservice. This package makes Binding with several languages, among them python.

Att.: Examples of this answer are based on Linux (Debian).

To documentation says there are 2 ways you can integrate Openalpr with your application:

  • Use commercial DFK to compile Openalpr libraries inside of your application and process frames of images individually;

  • Run the Openalpr Agent executable to directly capture feeds video and send the results of the cards and images to your app.

Commercial SDK

Windows, download it here:
http://deb.openalpr.com/windows-sdk/openalpr64-sdk-latest.zip

Linux:

bash <(curl http://deb.openalpr.com/install)

Binding to the SDK:

Make the repository clone:

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

Installation:

cd openalpr/src/bindings/python/
python setup.py install 

utilizing

from openalpr import Alpr

alpr = Alpr("us", "/path/to/openalpr.conf", "/path/to/runtime_data")
if not alpr.is_loaded():
    print("Error loading OpenALPR")
    sys.exit(1)

alpr.set_top_n(20)
alpr.set_default_region("md")

results = alpr.recognize_file("/path/to/image.jpg")

i = 0
for plate in results['results']:
    i += 1
    print("Plate #%d" % i)
    print("   %12s %12s" % ("Plate", "Confidence"))
    for candidate in plate['candidates']:
        prefix = "-"
        if candidate['matches_template']:
            prefix = "*"

        print("  %s %12s%12f" % (prefix, candidate['plate'], candidate['confidence']))

# Call when completely done to release memory
alpr.unload()

Webserver

A second option is to use it as a web-server, in this case the documentation recommends the use of Ubuntu 16.04, so that you can run the web-server, if this option is better study the documentation and, anyway, you will have to use part of the third option, then.

Cloudapi

The third option is perhaps the most "easy", is to use the guys' "cloud" API:

The Openalpr Cloud API is a service running in the cloud that is ready to Analyze your images. The service receives image data and Responds with License Plate information, as well as Vehicle color, make, and model.

For this option, sign up for the service (Free for 2,000 recognitions/month), install the python api, and read the documentation.

Lower the cloudapi

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

Install in python

cd cloudapi/python
pip install -r requirements.txt
sudo python setup.py install

To use

>>> import openalpr_api

REFERENCE
Official documentation

  • I had already done these procedures, apparently the module was installed correctly via CMD, but when I run the presented code, it returns error in the module, as if it was not installed on the computer, however I have installed it several times.

  • Which options? Agent, Webservice? Cloud? Which operating system?

  • I used the method of installing from CMD by downloading the package and installing via CMD with python install. Windows 8 64bits

  • Do you reproduce here the code that you are trying to run and the errors that are occurring? Edit the question and add this information.

  • I edited and added the error code

  • See the last message: Oserror: Unable to locate the Openalpr library. Please make sure that Openalpr is properly installed on your system and that the Libraries are in the appropriate paths. The message says that the library is not installed. If it is not in the path. I asked you to enter the code too,?

  • As you can see in this image http://imgur.com/MdQcTwd the module has been installed

  • I moved the comments to the chat - http://chat.stackexchange.com/rooms/56890/discussion-between-felix-and-sidon

Show 4 more comments

Browser other questions tagged

You are not signed in. Login or sign up in order to post.