SimpleLPR


NameSimpleLPR JSON
Version 3.5.5 PyPI version JSON
download
home_pagehttps://www.warelogic.com
SummarySimpleLPR License Plate Recognition (LPR/ANPR) library.
upload_time2023-06-30 18:18:09
maintainer
docs_urlNone
authorXavier Girones
requires_python>=3.8, <3.12
license
keywords lpr anpr sdk toolkit library component number plate recognition license plate recognition read license plates read number plates shareware
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            **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": "",
    "docs_url": null,
    "requires_python": ">=3.8, <3.12",
    "maintainer_email": "",
    "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": "",
    "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": "",
    "summary": "SimpleLPR License Plate Recognition (LPR/ANPR) library.",
    "version": "3.5.5",
    "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": "5cd7fcff277447475f529930a5d9e8b620aaa37a8a8e30fbdfb1bc4128a07ee8",
                "md5": "94330df6b5dd4fefb0211ff5171a8a68",
                "sha256": "6ff2928d129e01f6cdf73b6debed23f07cbc1d46adb33fbff21c284981343a36"
            },
            "downloads": -1,
            "filename": "SimpleLPR-3.5.5-cp310-cp310-manylinux_2_31_x86_64.whl",
            "has_sig": false,
            "md5_digest": "94330df6b5dd4fefb0211ff5171a8a68",
            "packagetype": "bdist_wheel",
            "python_version": "cp310",
            "requires_python": ">=3.8, <3.12",
            "size": 94485430,
            "upload_time": "2023-06-30T18:18:09",
            "upload_time_iso_8601": "2023-06-30T18:18:09.998525Z",
            "url": "https://files.pythonhosted.org/packages/5c/d7/fcff277447475f529930a5d9e8b620aaa37a8a8e30fbdfb1bc4128a07ee8/SimpleLPR-3.5.5-cp310-cp310-manylinux_2_31_x86_64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "523336e88e361a6fb5c67158e5f263cc5364326c4c6bb8dd4a5173d8cdb0556f",
                "md5": "3efd3360393bc9a58f553eafa7bf6c49",
                "sha256": "f7ce704c9da8e5c51281177f2c07659b6ee87e9c3d5b87c10597e1a981e8d7d4"
            },
            "downloads": -1,
            "filename": "SimpleLPR-3.5.5-cp310-cp310-win_amd64.whl",
            "has_sig": false,
            "md5_digest": "3efd3360393bc9a58f553eafa7bf6c49",
            "packagetype": "bdist_wheel",
            "python_version": "cp310",
            "requires_python": ">=3.8, <3.12",
            "size": 34515226,
            "upload_time": "2023-06-30T18:06:04",
            "upload_time_iso_8601": "2023-06-30T18:06:04.203840Z",
            "url": "https://files.pythonhosted.org/packages/52/33/36e88e361a6fb5c67158e5f263cc5364326c4c6bb8dd4a5173d8cdb0556f/SimpleLPR-3.5.5-cp310-cp310-win_amd64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "387b6f1445b65e6c94f287cca87b315258221fa5a0b058d091f05dd96d717fd1",
                "md5": "35148dc8901b54badb836db544d7ed55",
                "sha256": "a9a1d0a5ff1c573e7e12265183678fdec09fc9c6eeb746aaa3b627288c48ddac"
            },
            "downloads": -1,
            "filename": "SimpleLPR-3.5.5-cp311-cp311-manylinux_2_31_x86_64.whl",
            "has_sig": false,
            "md5_digest": "35148dc8901b54badb836db544d7ed55",
            "packagetype": "bdist_wheel",
            "python_version": "cp311",
            "requires_python": ">=3.8, <3.12",
            "size": 94485430,
            "upload_time": "2023-06-30T18:21:59",
            "upload_time_iso_8601": "2023-06-30T18:21:59.046215Z",
            "url": "https://files.pythonhosted.org/packages/38/7b/6f1445b65e6c94f287cca87b315258221fa5a0b058d091f05dd96d717fd1/SimpleLPR-3.5.5-cp311-cp311-manylinux_2_31_x86_64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "78689c11338df36de45ea0f8f8920c22c185439f6dafe3147a3acb1d82d8c016",
                "md5": "2222f23400beb3617d801d149b92a4a7",
                "sha256": "0e2a5d7f4fb26063df7563e2d0bbd0f849f2eb4a75aa009c8b3d5d9394bc0f59"
            },
            "downloads": -1,
            "filename": "SimpleLPR-3.5.5-cp311-cp311-win_amd64.whl",
            "has_sig": false,
            "md5_digest": "2222f23400beb3617d801d149b92a4a7",
            "packagetype": "bdist_wheel",
            "python_version": "cp311",
            "requires_python": ">=3.8, <3.12",
            "size": 34515226,
            "upload_time": "2023-06-30T18:07:56",
            "upload_time_iso_8601": "2023-06-30T18:07:56.298783Z",
            "url": "https://files.pythonhosted.org/packages/78/68/9c11338df36de45ea0f8f8920c22c185439f6dafe3147a3acb1d82d8c016/SimpleLPR-3.5.5-cp311-cp311-win_amd64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "cf751cb1953fb8a7e65bf3db1965ad267ea16a57ed2fba38f8a07d649bbc46e7",
                "md5": "fad24ab4158575784efd151c18083866",
                "sha256": "94b7f47d8047352b62091fdbd93161b65d1d773dc03a48853555b3fd330c33c8"
            },
            "downloads": -1,
            "filename": "SimpleLPR-3.5.5-cp38-cp38-manylinux_2_31_x86_64.whl",
            "has_sig": false,
            "md5_digest": "fad24ab4158575784efd151c18083866",
            "packagetype": "bdist_wheel",
            "python_version": "cp38",
            "requires_python": ">=3.8, <3.12",
            "size": 94485429,
            "upload_time": "2023-06-30T18:25:30",
            "upload_time_iso_8601": "2023-06-30T18:25:30.766641Z",
            "url": "https://files.pythonhosted.org/packages/cf/75/1cb1953fb8a7e65bf3db1965ad267ea16a57ed2fba38f8a07d649bbc46e7/SimpleLPR-3.5.5-cp38-cp38-manylinux_2_31_x86_64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "dafbf7ca237f3814be952d4f493fb60a5fe7e09fa4ca74cb31999946db5bc857",
                "md5": "865f1e69fdfc64499a0ad96428281ead",
                "sha256": "ee7c20c5fc4a00e44eaa0c45c2a77bae1fb038c9a33ceecc93928f861a15db3c"
            },
            "downloads": -1,
            "filename": "SimpleLPR-3.5.5-cp38-cp38-win_amd64.whl",
            "has_sig": false,
            "md5_digest": "865f1e69fdfc64499a0ad96428281ead",
            "packagetype": "bdist_wheel",
            "python_version": "cp38",
            "requires_python": ">=3.8, <3.12",
            "size": 34516667,
            "upload_time": "2023-06-30T18:09:59",
            "upload_time_iso_8601": "2023-06-30T18:09:59.139745Z",
            "url": "https://files.pythonhosted.org/packages/da/fb/f7ca237f3814be952d4f493fb60a5fe7e09fa4ca74cb31999946db5bc857/SimpleLPR-3.5.5-cp38-cp38-win_amd64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "098aa2733aaee2cf63e2bb92cb3db1b9c219b8d584c08ef717a6faf34397e805",
                "md5": "ebb6d188f92fb8cd543b7003cb09f27b",
                "sha256": "fa75d1e93d29d5695aa3503d908ce559cca02f126e4906a24e97028a3f980ad0"
            },
            "downloads": -1,
            "filename": "SimpleLPR-3.5.5-cp39-cp39-manylinux_2_31_x86_64.whl",
            "has_sig": false,
            "md5_digest": "ebb6d188f92fb8cd543b7003cb09f27b",
            "packagetype": "bdist_wheel",
            "python_version": "cp39",
            "requires_python": ">=3.8, <3.12",
            "size": 94485429,
            "upload_time": "2023-06-30T18:29:21",
            "upload_time_iso_8601": "2023-06-30T18:29:21.014880Z",
            "url": "https://files.pythonhosted.org/packages/09/8a/a2733aaee2cf63e2bb92cb3db1b9c219b8d584c08ef717a6faf34397e805/SimpleLPR-3.5.5-cp39-cp39-manylinux_2_31_x86_64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "1c572af4243293596ee0997cb63dd734c5284cbc860721ce7fe4e840ead084b6",
                "md5": "bca63b145967f7575df129aeb777c441",
                "sha256": "7e09aa130d32a692a43e479ed292994c24d2b8c3a8900bfbcec802adbfb15b45"
            },
            "downloads": -1,
            "filename": "SimpleLPR-3.5.5-cp39-cp39-win_amd64.whl",
            "has_sig": false,
            "md5_digest": "bca63b145967f7575df129aeb777c441",
            "packagetype": "bdist_wheel",
            "python_version": "cp39",
            "requires_python": ">=3.8, <3.12",
            "size": 34515225,
            "upload_time": "2023-06-30T18:11:31",
            "upload_time_iso_8601": "2023-06-30T18:11:31.087843Z",
            "url": "https://files.pythonhosted.org/packages/1c/57/2af4243293596ee0997cb63dd734c5284cbc860721ce7fe4e840ead084b6/SimpleLPR-3.5.5-cp39-cp39-win_amd64.whl",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-06-30 18:18:09",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "simplelpr"
}
        
Elapsed time: 0.08315s