**SimpleLPR** is a software component for vehicle license plate recognition. It has a very simple programming interface that allows applications to supply a path to an image or a buffer in memory and returns the detected license plate text and its location in the input image. It can be used from C++, .NET-enabled programming languages, or Python.
Typical detection rates range between 85% and 95%, provided the license plates are in good condition, free of obstructions, and the text height is at least 20 pixels.
You can submit your questions/issues/bug reports/feedback to support@warelogic.com
Integration is simple and straightforward, as demonstrated in the following example:
```Python
import sys, os, argparse
# Import the SimpleLPR extension.
import simplelpr
# Lists all available countries.
def list_countries(eng):
print('List of available countries:')
for i in range(0, eng.numSupportedCountries):
print(eng.get_countryCode(i))
def analyze_file(eng, country_id, img_path, key_path):
# Enables syntax verification with the selected country.
eng.set_countryWeight(country_id, 1)
eng.realizeCountryWeights()
# If provided, supplies the product key as a file.
if key_path is not None:
eng.set_productKey(key_path)
# Alternatively, it could also be supplied from a buffer in memory:
#
# with open(key_path, mode='rb') as file:
# key_content = file.read()
# eng.set_productKey( key_content )
# Create a Processor object. Every working thread should use its own processor.
proc = eng.createProcessor()
# Enable the plate region detection and crop to plate region features.
proc.plateRegionDetectionEnabled = True
proc.cropToPlateRegionEnabled = True
# Looks for license plate candidates in an image in the file system.
cds = proc.analyze(img_path)
# Alternatively, the input image can be supplied through an object supporting the buffer protocol:
#
# fh = open(img_path, 'rb')
# try:
# ba = bytearray(fh.read())
# finally:
# fh.close()
# cds = proc.analyze(ba)
#
# or
#
# import numpy as np
# from PIL import Image
#
# im = Image.open(img_path)
# npi = np.asarray(im)
# cds = proc.analyze(npi)
#
# or
#
# import cv2
#
# im = cv2.imread(img_path)
# cds = proc.analyze(im)
# Show the detection results.
print('Number of detected candidates:', len(cds))
for cand in cds:
print('-----------------------------')
print('darkOnLight:', cand.darkOnLight, ', plateDetectionConfidence:', cand.plateDetectionConfidence)
print('boundingBox:', cand.boundingBox)
print('plateRegionVertices:', cand.plateRegionVertices)
for cm in cand.matches:
print('\tcountry:', "'{:}'".format(cm.country), ', countryISO:', "'{:}'".format(cm.countryISO),
', text:', "'{:}'".format(cm.text), ', confidence:', '{:.3f}'.format(cm.confidence))
for e in cm.elements:
print('\t\tglyph:', "'{:}'".format(e.glyph), ', confidence:', '{:.3f}'.format(e.confidence),
', boundingBox:', e.boundingBox)
def main():
try:
# The simplelpr extension requires 64-bit Python 3.8 or 3.9
if sys.version_info[0:2] != (3, 8) and sys.version_info[0:2] != (3, 9):
raise RuntimeError('This demo requires either Python 3.8 or 3.9')
if len(sys.argv) == 1:
sys.argv.append('--help')
# Create a SimpleLPR engine.
setupP = simplelpr.EngineSetupParms()
eng = simplelpr.SimpleLPR(setupP)
print("SimpleLPR version:",
"{:}.{:}.{:}.{:}".format(eng.versionNumber.A, eng.versionNumber.B, eng.versionNumber.C,
eng.versionNumber.D))
# Parse the command line arguments.
parser = argparse.ArgumentParser(description='SimpleLPR on Python demo application')
subparsers = parser.add_subparsers(dest='command', help='Sub-command help')
subparsers.add_parser('list', help='List all available countries')
parser_analyze = subparsers.add_parser('analyze', help='Looks for license plate candidates in an image')
parser_analyze.add_argument('country_id', type=str, help='Country string identifier')
parser_analyze.add_argument('img_path', type=str, help='Path to the image file')
parser_analyze.add_argument('key_path',
type=str,
nargs='?',
help="Path to the registration key file. In case you need to extend the 60-day "
"evaluation period you can send an e-mail to 'support@warelogic.com' to "
"request a trial key")
args = parser.parse_args()
if args.command == 'list':
# List countries.
list_countries(eng)
elif args.command == 'analyze':
# Analyze an image in the file system.
analyze_file(eng, args.country_id, args.img_path, args.key_path)
else:
# Shouldn't occur.
raise RuntimeError('Unknown command')
except Exception as e:
print('An exception occurred: {}'.format(e))
if __name__ == '__main__':
main()
Raw data
{
"_id": null,
"home_page": "https://www.warelogic.com",
"name": "SimpleLPR",
"maintainer": null,
"docs_url": null,
"requires_python": "<3.13,>=3.8",
"maintainer_email": null,
"keywords": "LPR, ANPR, SDK, toolkit, library, component, number plate recognition, license plate recognition, read license plates, read number plates, shareware",
"author": "Xavier Girones",
"author_email": "xavier.girones@warelogic.com",
"download_url": null,
"platform": null,
"description": "**SimpleLPR** is a software component for vehicle license plate recognition. It has a very simple programming interface that allows applications to supply a path to an image or a buffer in memory and returns the detected license plate text and its location in the input image. It can be used from C++, .NET-enabled programming languages, or Python. \r\n\r\nTypical detection rates range between 85% and 95%, provided the license plates are in good condition, free of obstructions, and the text height is at least 20 pixels.\r\n\r\nYou can submit your questions/issues/bug reports/feedback to support@warelogic.com\r\n\r\nIntegration is simple and straightforward, as demonstrated in the following example:\r\n\r\n```Python\r\nimport sys, os, argparse\r\n\r\n# Import the SimpleLPR extension.\r\nimport simplelpr\r\n\r\n# Lists all available countries.\r\n\r\ndef list_countries(eng):\r\n print('List of available countries:')\r\n\r\n for i in range(0, eng.numSupportedCountries):\r\n print(eng.get_countryCode(i))\r\n\r\n\r\ndef analyze_file(eng, country_id, img_path, key_path):\r\n # Enables syntax verification with the selected country.\r\n eng.set_countryWeight(country_id, 1)\r\n eng.realizeCountryWeights()\r\n\r\n # If provided, supplies the product key as a file.\r\n if key_path is not None:\r\n eng.set_productKey(key_path)\r\n\r\n # Alternatively, it could also be supplied from a buffer in memory:\r\n #\r\n # with open(key_path, mode='rb') as file:\r\n # key_content = file.read()\r\n # eng.set_productKey( key_content )\r\n\r\n # Create a Processor object. Every working thread should use its own processor.\r\n proc = eng.createProcessor()\r\n\r\n # Enable the plate region detection and crop to plate region features.\r\n proc.plateRegionDetectionEnabled = True\r\n proc.cropToPlateRegionEnabled = True\r\n\r\n # Looks for license plate candidates in an image in the file system.\r\n cds = proc.analyze(img_path)\r\n\r\n # Alternatively, the input image can be supplied through an object supporting the buffer protocol:\r\n #\r\n # fh = open(img_path, 'rb')\r\n # try:\r\n # ba = bytearray(fh.read())\r\n # finally:\r\n # fh.close()\r\n # cds = proc.analyze(ba)\r\n #\r\n # or\t\r\n #\r\n # import numpy as np\r\n # from PIL import Image\r\n #\r\n # im = Image.open(img_path)\r\n # npi = np.asarray(im)\r\n # cds = proc.analyze(npi)\r\n #\r\n # or\r\n #\r\n # import cv2\r\n #\r\n # im = cv2.imread(img_path)\r\n # cds = proc.analyze(im)\r\n\r\n # Show the detection results.\r\n print('Number of detected candidates:', len(cds))\r\n\r\n for cand in cds:\r\n print('-----------------------------')\r\n print('darkOnLight:', cand.darkOnLight, ', plateDetectionConfidence:', cand.plateDetectionConfidence)\r\n print('boundingBox:', cand.boundingBox)\r\n print('plateRegionVertices:', cand.plateRegionVertices)\r\n\r\n for cm in cand.matches:\r\n print('\\tcountry:', \"'{:}'\".format(cm.country), ', countryISO:', \"'{:}'\".format(cm.countryISO),\r\n ', text:', \"'{:}'\".format(cm.text), ', confidence:', '{:.3f}'.format(cm.confidence))\r\n\r\n for e in cm.elements:\r\n print('\\t\\tglyph:', \"'{:}'\".format(e.glyph), ', confidence:', '{:.3f}'.format(e.confidence),\r\n ', boundingBox:', e.boundingBox)\r\n\r\n\r\ndef main():\r\n try:\r\n\r\n # The simplelpr extension requires 64-bit Python 3.8 or 3.9\r\n\r\n if sys.version_info[0:2] != (3, 8) and sys.version_info[0:2] != (3, 9):\r\n raise RuntimeError('This demo requires either Python 3.8 or 3.9')\r\n\r\n if len(sys.argv) == 1:\r\n sys.argv.append('--help')\r\n\r\n\r\n # Create a SimpleLPR engine.\r\n\r\n setupP = simplelpr.EngineSetupParms()\r\n eng = simplelpr.SimpleLPR(setupP)\r\n\r\n print(\"SimpleLPR version:\",\r\n \"{:}.{:}.{:}.{:}\".format(eng.versionNumber.A, eng.versionNumber.B, eng.versionNumber.C,\r\n eng.versionNumber.D))\r\n\r\n # Parse the command line arguments.\r\n\r\n parser = argparse.ArgumentParser(description='SimpleLPR on Python demo application')\r\n subparsers = parser.add_subparsers(dest='command', help='Sub-command help')\r\n subparsers.add_parser('list', help='List all available countries')\r\n parser_analyze = subparsers.add_parser('analyze', help='Looks for license plate candidates in an image')\r\n parser_analyze.add_argument('country_id', type=str, help='Country string identifier')\r\n parser_analyze.add_argument('img_path', type=str, help='Path to the image file')\r\n parser_analyze.add_argument('key_path',\r\n type=str,\r\n nargs='?',\r\n help=\"Path to the registration key file. In case you need to extend the 60-day \"\r\n \"evaluation period you can send an e-mail to 'support@warelogic.com' to \"\r\n \"request a trial key\")\r\n\r\n args = parser.parse_args()\r\n\r\n if args.command == 'list':\r\n # List countries.\r\n list_countries(eng)\r\n elif args.command == 'analyze':\r\n # Analyze an image in the file system.\r\n analyze_file(eng, args.country_id, args.img_path, args.key_path)\r\n else:\r\n # Shouldn't occur.\r\n raise RuntimeError('Unknown command')\r\n\r\n except Exception as e:\r\n print('An exception occurred: {}'.format(e))\r\n\r\n\r\nif __name__ == '__main__':\r\n main()\r\n",
"bugtrack_url": null,
"license": null,
"summary": "SimpleLPR License Plate Recognition (LPR/ANPR) library.",
"version": "3.5.7",
"project_urls": {
"Homepage": "https://www.warelogic.com"
},
"split_keywords": [
"lpr",
" anpr",
" sdk",
" toolkit",
" library",
" component",
" number plate recognition",
" license plate recognition",
" read license plates",
" read number plates",
" shareware"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "7ddbd5848c084c47b5ce787ba345ecf953872fffc998323eaed902076deaf5f8",
"md5": "3dfc4da2642df84854bf2a7947ce401b",
"sha256": "f6553d76178704a2226221286a6370c67a91820f979184bf07aa03ecb5ec6d3b"
},
"downloads": -1,
"filename": "SimpleLPR-3.5.7-cp310-cp310-win_amd64.whl",
"has_sig": false,
"md5_digest": "3dfc4da2642df84854bf2a7947ce401b",
"packagetype": "bdist_wheel",
"python_version": "cp310",
"requires_python": "<3.13,>=3.8",
"size": 34319938,
"upload_time": "2024-08-02T11:37:17",
"upload_time_iso_8601": "2024-08-02T11:37:17.416809Z",
"url": "https://files.pythonhosted.org/packages/7d/db/d5848c084c47b5ce787ba345ecf953872fffc998323eaed902076deaf5f8/SimpleLPR-3.5.7-cp310-cp310-win_amd64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "4c19b3f9b54de9b973b5de8d4ac5cebc7bc4567dfa72f1ea9e59868b80704ad6",
"md5": "58d2a37cc80635767c3821e495b9b359",
"sha256": "b9eb5214d14936b4433f696cf675e53d731e4e6ef715c7552310194d1e2e89f4"
},
"downloads": -1,
"filename": "SimpleLPR-3.5.7-cp311-cp311-win_amd64.whl",
"has_sig": false,
"md5_digest": "58d2a37cc80635767c3821e495b9b359",
"packagetype": "bdist_wheel",
"python_version": "cp311",
"requires_python": "<3.13,>=3.8",
"size": 34319936,
"upload_time": "2024-08-02T11:38:22",
"upload_time_iso_8601": "2024-08-02T11:38:22.161338Z",
"url": "https://files.pythonhosted.org/packages/4c/19/b3f9b54de9b973b5de8d4ac5cebc7bc4567dfa72f1ea9e59868b80704ad6/SimpleLPR-3.5.7-cp311-cp311-win_amd64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "cafaa4636897666d1b8c8680f6fe74cd647eeec436165a47b5f35225967ab598",
"md5": "6465e4f825c85a0cde537801f0557c22",
"sha256": "38b9e07baaa88461f3bd8713d7e1c876a1a4638b8aca6400d1d2e80ff6ae2e5f"
},
"downloads": -1,
"filename": "SimpleLPR-3.5.7-cp312-cp312-win_amd64.whl",
"has_sig": false,
"md5_digest": "6465e4f825c85a0cde537801f0557c22",
"packagetype": "bdist_wheel",
"python_version": "cp312",
"requires_python": "<3.13,>=3.8",
"size": 34319937,
"upload_time": "2024-08-02T11:39:28",
"upload_time_iso_8601": "2024-08-02T11:39:28.395127Z",
"url": "https://files.pythonhosted.org/packages/ca/fa/a4636897666d1b8c8680f6fe74cd647eeec436165a47b5f35225967ab598/SimpleLPR-3.5.7-cp312-cp312-win_amd64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "df7ff790edd5f43e16a4bb04ac585e563d54b48d6fdd047c484403d6413dcb1c",
"md5": "4e8a8ab6d2e9df0f5235112b8d2eed4b",
"sha256": "e55a147384ac9a308260a5cd21ff732462c8b079f8d7bae99b54e89f870d8a61"
},
"downloads": -1,
"filename": "SimpleLPR-3.5.7-cp38-cp38-win_amd64.whl",
"has_sig": false,
"md5_digest": "4e8a8ab6d2e9df0f5235112b8d2eed4b",
"packagetype": "bdist_wheel",
"python_version": "cp38",
"requires_python": "<3.13,>=3.8",
"size": 34321504,
"upload_time": "2024-08-02T11:40:45",
"upload_time_iso_8601": "2024-08-02T11:40:45.714664Z",
"url": "https://files.pythonhosted.org/packages/df/7f/f790edd5f43e16a4bb04ac585e563d54b48d6fdd047c484403d6413dcb1c/SimpleLPR-3.5.7-cp38-cp38-win_amd64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "2440cc0ac923ffffe148215d09b93c98762651301d552caa1030728887cb2940",
"md5": "3a2b00a7bd7d3505ffc106ca2f370ee5",
"sha256": "b94712dd62216564bdae63b90af44c94bae88100b4d30b44f809485f30b92cc6"
},
"downloads": -1,
"filename": "SimpleLPR-3.5.7-cp39-cp39-win_amd64.whl",
"has_sig": false,
"md5_digest": "3a2b00a7bd7d3505ffc106ca2f370ee5",
"packagetype": "bdist_wheel",
"python_version": "cp39",
"requires_python": "<3.13,>=3.8",
"size": 34319937,
"upload_time": "2024-08-02T11:42:16",
"upload_time_iso_8601": "2024-08-02T11:42:16.773219Z",
"url": "https://files.pythonhosted.org/packages/24/40/cc0ac923ffffe148215d09b93c98762651301d552caa1030728887cb2940/SimpleLPR-3.5.7-cp39-cp39-win_amd64.whl",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-08-02 11:37:17",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "simplelpr"
}