Automatic number-plate recognition is a technology that uses optical character recognition on images to read vehicle registration plates.
Python
Accurate, Fast, Developer- Friendly ALPR
Automatic License Plate Recognition software that works in all environments, optimized for your location. It supports a number of country's number plates all over the world.
To see all the countries supported Click Here.
To get API Key:
Go to https://platerecognizer.com and create an account to get your own API KEY.
CODE:
import requests
import json
from pprint import pprint
#Automatic number-plate recognition API
regions = ['in'] #Change to your country
with open('IMAGE_PATH', 'rb') as fp:
response = requests.post(
'https://api.platerecognizer.com/v1/plate-reader/',
data=dict(regions=regions),
files=dict(upload=fp),
headers={'Authorization': 'Token YOUR_API_KEY'})
data = response.json()
#print output in JSON Format
pprint(data)
#get number plate value from JSON response
for plate in data['results']:
plate_data = plate['plate']
print(plate_data)
Changes you should make:
YOUR_API_KEY
IMAGE_PATH
Country Code (if required)
If you get any import error:
pip install json
pip install requests
Further Process:
Add Database - Firebase or sqlite3 or MySQL
Add the outvalue to CSV File
Integrate this code and HTML to create a Web App
Comentarios