{ "info": { "author": "Konstantin Tretyakov", "author_email": "kt@ut.ee", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "Intended Audience :: Financial and Insurance Industry", "Intended Audience :: Legal Industry", "Intended Audience :: Science/Research", "License :: OSI Approved :: MIT License", "Programming Language :: Python", "Topic :: Scientific/Engineering :: Image Recognition" ], "description": "==========================================================================\nPassportEye: Python tools for image processing of identification documents\n==========================================================================\n.. image:: https://travis-ci.org/konstantint/PassportEye.svg?branch=master\n :target: https://travis-ci.org/konstantint/PassportEye\n\nThe package provides tools for recognizing machine readable zones (MRZ) from scanned identification documents.\nThe documents may be located rather arbitrarily on the page - the code tries to find anything resembling a MRZ \nand parse it from there.\n\nThe recognition procedure may be rather slow - around 10 or more seconds for some documents. Its precision is\nnot perfect, yet seemingly decent as far as test documents available to the developer were concerned - in\naround 80% of the cases, whenever there is a clearly visible MRZ on a page, the system will recognize it and extract the text\nto the best of the abilities of the underlying OCR engine (Google Tesseract).\n\nThe failed examples seem to be most often either clearly badly scanned documents, where text is way too blurred, or,\nmore seriously, some types of IDs (Romanian being one example), where the MRZ is too close to the remaining part of the card - \na situation not accounted for too well by the current algorithm.\n\nInstallation\n------------\n\nThe simplest way to install the package is via ``pip``::\n\n $ pip install PassportEye\n\nNote that `PassportEye` depends on `numpy`, `scipy`, `matplotlib` and `scikit-image`, among other things. The installation of those requirements, although automatic,\nmay take time or fail sometimes for various reasons (e.g. lack of necessary libraries). If this happens, consider installing the dependencies explicitly from the binary packages, such as those provided by the OS distribution or the \"wheel\" packages. Another convenient option is to use a Python distribution with pre-packaged `numpy`/`scipy`/`matplotlib` binaries (Anaconda Python being a great choice at the moment).\n\nIn addition, you must have the `Tesseract OCR `_ installed and added to the system path: the ``tesseract`` tool must be \naccessible at the command line.\n\nUsage\n-----\n\nOn installation, the package installs a standalone tool ``mrz`` into your Python scripts path. Running::\n\n $ mrz \n \nwill process a given filename, extracting the MRZ information it finds and printing it out in tabular form.\nRunning ``mrz --json `` will output the same information in JSON. Running ``mrz --save-roi `` will,\nin addition, extract the detected MRZ (\"region of interest\") into a separate png file for further exploration.\nNote that the tool provides a limited support for PDF files -- it attempts to extract the first DCT-encoded image \nfrom the PDF and applies the recognition on it. This seems to work fine with most scanner-produced one-page PDFs, but\nhas not been tested extensively.\n\nIf your Tesseract installation has the \"legacy\" ``*.traineddata`` models installed (in its ``tessdata`` directory), consider running::\n\n $ mrz --legacy \n\nThis will enable the \"legacy\" recognizer which, despite the name, seems to work better for MRZ recognition. If you do not know\nwhether you have the relevant files, just try running the command above and see whether you get an error. \n\nIn order to use the recognition function in Python code, simply do::\n\n >> from passporteye import read_mrz\n >> mrz = read_mrz(image_file)\n\nWhere image_file can be either a path to a file on disk, or a byte stream containing image data.\n\nThe returned object (unless it is None, which means no ROI was detected) contains the fields extracted from the MRZ along\nwith some metainformation. For the description of the available fields, see the docstring for the `passporteye.mrz.text.MRZ` class.\nNote that you can convert the object to a dictionary using the ``to_dict()`` method.\n\nIf you want to have the ROI reported alongside the MRZ, call the ``read_mrz`` function as follows::\n\n >> mrz = read_mrz(image_file, save_roi=True)\n\nThe ROI can then be accessed as ``mrz.aux['roi']`` -- it is a numpy ndarray, representing the (grayscale) image region where the OCR was applied.\n\nFinally, in order to use the \"legacy recognizer\", pass the ``--oem 0`` extra command line argument to Tesseract as follows::\n\n >> mrz = read_mrz(image_file, extra_cmdline_params='--oem 0')\n\nFor more flexibility, you may instead use a ``MRZPipeline`` object, which will provide you access to all intermediate computations as follows::\n\n >> from passporteye.mrz.image import MRZPipeline\n >> p = MRZPipeline(file, extra_cmdline_params='--oem 0')\n >> mrz = p.result\n\nThe \"pipeline\" object stores the intermediate computations in its ``data`` dictionary. Although you need to understand the underlying algorithm\nto make sense of it, sometimes it may provide for insightful visualizations. This code, for example, will plot the binarized version of the original image\nwhich is used in the algorithm to extract ROIs alongside the boxes corresponding to the extracted ROIs::\n\n >> imshow(p['img_binary'])\n >> for b in p['boxes']:\n .. plot(b.points[:,1], b.points[:,0], c='b')\n .. b.plot()\n\nDevelopment\n-----------\n\nIf you plan to develop or debug the package, consider installing it by running::\n\n $ pip install -e .[dev]\n\nThis will install the package in \"editable\" mode and add a couple of useful extras (such as `pytest`). \nYou can then run the tests by typing::\n\n $ py.test\n \nAt the root of the source distribution.\n\nThe command-line script ``evaluate_mrz`` can be used to assess the performance of the current recognition pipeline on a set \nof sample images: this is useful if you want to see the effects of changes to the code. Just run::\n\n $ evaluate_mrz -j 4\n\n(where ``-j 4`` would request to use 4 cores in parallel). The same script may be used to run the recognition pipeline on a \ngiven directory of images, sorting successes and failures, see ``evaluate_mrz -h`` for options.\n\n\nContributing\n------------\n\nFeel free to contribute or report issues via Github: https://github.com/konstantint/PassportEye\n\nCopyright & License\n-------------------\n\nCopyright: 2016, Konstantin Tretyakov.\nLicense: MIT", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/konstantint/PassportEye", "keywords": "id-card passport image-processing mrz machine-readable-zone", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "PassportEye", "package_url": "https://pypi.org/project/PassportEye/", "platform": "", "project_url": "https://pypi.org/project/PassportEye/", "project_urls": { "Homepage": "https://github.com/konstantint/PassportEye" }, "release_url": "https://pypi.org/project/PassportEye/1.4.1/", "requires_dist": null, "requires_python": "", "summary": "Extraction of machine-readable zone information from passports, visas and id-cards via OCR", "version": "1.4.1" }, "last_serial": 5316672, "releases": { "1.0": [], "1.0.0": [ { "comment_text": "", "digests": { "md5": "8e54777a981e7a4eb945d54fd6203b9e", "sha256": "354a8282e3a8201de2126e52bbcf3da91568b2c39eb67c32172cc94f9d4c9f0e" }, "downloads": -1, "filename": "PassportEye-1.0.0.zip", "has_sig": false, "md5_digest": "8e54777a981e7a4eb945d54fd6203b9e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 34532, "upload_time": "2016-09-24T07:20:39", "url": "https://files.pythonhosted.org/packages/87/b8/e01d2f4397cc89bf92ec867e6bf91e2d6f57ba9af9f1859728704beefb31/PassportEye-1.0.0.zip" } ], "1.0.1": [ { "comment_text": "", "digests": { "md5": "e01cf6f2f7d14e9854411e1b495d83db", "sha256": "a740edcdc1a63a3b07e7916253448ad040700c2fb530898c7e4fb6f0a0fdca21" }, "downloads": -1, "filename": "PassportEye-1.0.1.zip", "has_sig": false, "md5_digest": "e01cf6f2f7d14e9854411e1b495d83db", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 35351, "upload_time": "2016-09-24T10:35:07", "url": "https://files.pythonhosted.org/packages/71/e0/e84a30b86b44520158cab4fb76496c2b60e4628dcb9c5e10b1df4fc1d5e1/PassportEye-1.0.1.zip" } ], "1.0.2": [ { "comment_text": "", "digests": { "md5": "d157b1546c52bbe045edabb94ac6f12c", "sha256": "f3eb5f8bfa67d17e2c1343cd06357ec629165c1a51004d80499fdf0f2e335090" }, "downloads": -1, "filename": "PassportEye-1.0.2.tar.gz", "has_sig": false, "md5_digest": "d157b1546c52bbe045edabb94ac6f12c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 24621, "upload_time": "2017-07-14T11:07:40", "url": "https://files.pythonhosted.org/packages/44/2d/190e1ec8e372874ee1c69e2ef433a137d012c9f3fb23d80bbc1bd38144fc/PassportEye-1.0.2.tar.gz" } ], "1.1.0": [ { "comment_text": "", "digests": { "md5": "608deb25798b56bbefe073fe3e4469c5", "sha256": "094416c7eabd08966d01952a18534fc1a2ee3696dc8a890e666b84b2d9dad09d" }, "downloads": -1, "filename": "PassportEye-1.1.0.tar.gz", "has_sig": false, "md5_digest": "608deb25798b56bbefe073fe3e4469c5", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 24786, "upload_time": "2017-12-20T00:02:47", "url": "https://files.pythonhosted.org/packages/37/64/763998dda45b2db07efc3973f00512a95185903c7f08e78bd49c63c3132b/PassportEye-1.1.0.tar.gz" } ], "1.1.1": [ { "comment_text": "", "digests": { "md5": "0b1f051c07fcfe7a6c2474243d129301", "sha256": "3d2256decd60e63e548eb94a349f1941daf560b1cad3759ac781f00e55fb4826" }, "downloads": -1, "filename": "PassportEye-1.1.1.tar.gz", "has_sig": false, "md5_digest": "0b1f051c07fcfe7a6c2474243d129301", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 24804, "upload_time": "2017-12-21T20:04:47", "url": "https://files.pythonhosted.org/packages/2f/97/2823221ed90918c07a53413120369b889286ec8e7a0bd70b90de0832ab19/PassportEye-1.1.1.tar.gz" } ], "1.1.2": [ { "comment_text": "", "digests": { "md5": "209fff28c8ed7c67cd99a15ada0a2912", "sha256": "dee373e09fdb5ea8d142de12db9e73ba1899e034c5a6ebe6d2cae36fcfd8ef09" }, "downloads": -1, "filename": "PassportEye-1.1.2.tar.gz", "has_sig": false, "md5_digest": "209fff28c8ed7c67cd99a15ada0a2912", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 24876, "upload_time": "2018-02-06T12:14:58", "url": "https://files.pythonhosted.org/packages/44/42/9dab680716d15d7c05c25e7cd58c1432ee3f3883bc6b5f33be1aea74fde1/PassportEye-1.1.2.tar.gz" } ], "1.2.0": [ { "comment_text": "", "digests": { "md5": "c5a5170de589ce457893bb706c00e246", "sha256": "5d84dc422817ac5d296f630b560c7e75fe72d398e00a0e0e253c9ce2d58b74b0" }, "downloads": -1, "filename": "PassportEye-1.2.0.tar.gz", "has_sig": false, "md5_digest": "c5a5170de589ce457893bb706c00e246", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 24889, "upload_time": "2018-02-06T12:41:35", "url": "https://files.pythonhosted.org/packages/73/bb/e74c3ce256a2b7c5c0262348d3b8ed8e49416531715a8c33fc452c2004d9/PassportEye-1.2.0.tar.gz" } ], "1.2.1": [ { "comment_text": "", "digests": { "md5": "3f9fb9f0840b7ba8bfd97074e90db0e2", "sha256": "597df5be56cec080f8fbe526516059297c1b1ec8b58ad44fb2c443cce19a078e" }, "downloads": -1, "filename": "PassportEye-1.2.1.tar.gz", "has_sig": false, "md5_digest": "3f9fb9f0840b7ba8bfd97074e90db0e2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 25011, "upload_time": "2018-07-11T13:38:27", "url": "https://files.pythonhosted.org/packages/38/02/b8e188c43dfa6b5cdccdd3521c2eaad214d1711d27bdc6281716554e3339/PassportEye-1.2.1.tar.gz" } ], "1.2.2": [ { "comment_text": "", "digests": { "md5": "5ff11db42cb5a7af98114ead76adf5c2", "sha256": "7129006bf9d7858a505a983e220989bfea6c0c5f6ebf1535222a5effb217e542" }, "downloads": -1, "filename": "PassportEye-1.2.2.tar.gz", "has_sig": false, "md5_digest": "5ff11db42cb5a7af98114ead76adf5c2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 25081, "upload_time": "2018-09-20T12:26:28", "url": "https://files.pythonhosted.org/packages/51/fb/67056e03c28730c7d9490111f84fed9042bd6c8ed5f19d60d4ed8680a9ef/PassportEye-1.2.2.tar.gz" } ], "1.2.3": [ { "comment_text": "", "digests": { "md5": "a8511f34b1b78163a5b9649e2cda19ea", "sha256": "3756b1d1c5a1609a198f813dd0185f08e1a4f676b76b983ce5373000371c5dfe" }, "downloads": -1, "filename": "PassportEye-1.2.3.tar.gz", "has_sig": false, "md5_digest": "a8511f34b1b78163a5b9649e2cda19ea", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 25120, "upload_time": "2018-10-19T09:37:15", "url": "https://files.pythonhosted.org/packages/61/59/0df2fd18c334b4ef14dac5f0ca4c58e5ae19630cc8d248e0a6a0377b110e/PassportEye-1.2.3.tar.gz" } ], "1.2.4": [ { "comment_text": "", "digests": { "md5": "3ede62e228c14e437d4d8a859fce8f07", "sha256": "5ce4f61e8cd92d42df59f7414194935aabcf91deebfdca8672d12d7ccc9a5505" }, "downloads": -1, "filename": "PassportEye-1.2.4.tar.gz", "has_sig": false, "md5_digest": "3ede62e228c14e437d4d8a859fce8f07", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 25273, "upload_time": "2018-10-19T13:55:33", "url": "https://files.pythonhosted.org/packages/05/8f/866a744d3f77afa60274d706ae1f9c289e876cc028aa70c62b276ea6a9ad/PassportEye-1.2.4.tar.gz" } ], "1.3.0": [ { "comment_text": "", "digests": { "md5": "f10d73991cc9905f7785cdf35efaab61", "sha256": "0b09270fa826bb6d4c4b7edd3ff29894f5b4b2ff0121a787256533a256d99478" }, "downloads": -1, "filename": "PassportEye-1.3.0.tar.gz", "has_sig": false, "md5_digest": "f10d73991cc9905f7785cdf35efaab61", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 25622, "upload_time": "2018-12-23T16:09:43", "url": "https://files.pythonhosted.org/packages/61/cc/e30891e4a731560e169d02c5e1247d6c62a75a08ef24571b0fae02959ec2/PassportEye-1.3.0.tar.gz" } ], "1.4.0": [ { "comment_text": "", "digests": { "md5": "e7ea5af88f9344c591ffe25b7a7f0af8", "sha256": "0b862442c402a1043ed6e6a084953f5a51ce9b9dcfcb1bba5d17e1382b0d1352" }, "downloads": -1, "filename": "PassportEye-1.4.0.tar.gz", "has_sig": false, "md5_digest": "e7ea5af88f9344c591ffe25b7a7f0af8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 26636, "upload_time": "2018-12-24T19:18:55", "url": "https://files.pythonhosted.org/packages/fe/da/17abaa520f5224e4123a806dc3b04cf40259a2464cc993c325d26690180f/PassportEye-1.4.0.tar.gz" } ], "1.4.1": [ { "comment_text": "", "digests": { "md5": "ba99a925386d509c35947f036de70c88", "sha256": "8e55ba3a2efda87adbeeb69c26cb3271e7c6db9804364379ed6ce360c99c7084" }, "downloads": -1, "filename": "PassportEye-1.4.1.tar.gz", "has_sig": false, "md5_digest": "ba99a925386d509c35947f036de70c88", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 26679, "upload_time": "2019-05-25T15:31:56", "url": "https://files.pythonhosted.org/packages/7b/7c/fc335196feec9f2d407e878619c91a49f846a7b6c82ec1ed6ef0948cdda5/PassportEye-1.4.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "ba99a925386d509c35947f036de70c88", "sha256": "8e55ba3a2efda87adbeeb69c26cb3271e7c6db9804364379ed6ce360c99c7084" }, "downloads": -1, "filename": "PassportEye-1.4.1.tar.gz", "has_sig": false, "md5_digest": "ba99a925386d509c35947f036de70c88", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 26679, "upload_time": "2019-05-25T15:31:56", "url": "https://files.pythonhosted.org/packages/7b/7c/fc335196feec9f2d407e878619c91a49f846a7b6c82ec1ed6ef0948cdda5/PassportEye-1.4.1.tar.gz" } ] }