{ "info": { "author": "Henrik Blidh", "author_email": "henrik.blidh@nedomkull.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "Intended Audience :: Science/Research", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: Implementation :: CPython", "Programming Language :: Python :: Implementation :: PyPy", "Topic :: Scientific/Engineering", "Topic :: Software Development" ], "description": "\nPyEFD\n=====\n\n[![Build Status](https://dev.azure.com/hbldh/github/_apis/build/status/hbldh.pyefd?branchName=master)](https://dev.azure.com/hbldh/github/_build/latest?definitionId=6&branchName=master)\n[![image](https://travis-ci.org/hbldh/pyefd.svg?branch=master)](https://travis-ci.org/hbldh/pyefd)\n[![Documentation Status](https://readthedocs.org/projects/pyefd/badge/?version=latest)](http://pyefd.readthedocs.org/en/latest/?badge=latest)\n[![image](http://img.shields.io/pypi/v/pyefd.svg)](https://pypi.python.org/pypi/pyefd/)\n[![image](http://img.shields.io/pypi/l/pyefd.svg)](https://pypi.python.org/pypi/pyefd/)\n[![image](https://coveralls.io/repos/github/hbldh/pyefd/badge.svg?branch=master)](https://coveralls.io/github/hbldh/pyefd?branch=master)\n\nAn Python/NumPy implementation of a method for approximating a contour with a Fourier series, as described in [1].\n\nInstallation\n------------\n\n```bash\npip install pyefd\n```\n\nUsage\n-----\n\nGiven a closed contour of a shape, generated by e.g. [scikit-image](http://scikit-image.org/) or\n [OpenCV](http://opencv.org/), this package can fit a \n [Fourier series](https://en.wikipedia.org/wiki/Fourier_series) approximating the shape of the contour.\n\n### General usage examples\n\nThis section describes the general usage patterns of `pyefd`.\n\n```python\nfrom pyefd import elliptic_fourier_descriptors\ncoeffs = elliptic_fourier_descriptors(contour, order=10)\n```\n\nThe coefficients returned are the `a_n`, `b_n`, `c_n` and `d_n` of the following Fourier series \nrepresentation of the shape.\n\nThe coefficients returned are by default normalized so that they are rotation and size-invariant. \nThis can be overridden by calling:\n\n```python\nfrom pyefd import elliptic_fourier_descriptors\ncoeffs = elliptic_fourier_descriptors(contour, order=10, normalize=False)\n```\n\nNormalization can also be done afterwards:\n\n```python\nfrom pyefd import normalize_efd\ncoeffs = normalize_efd(coeffs)\n```\n\n### OpenCV example\n\nIf you are using [OpenCV](http://opencv.org/) to generate contours, this example shows how to \nconnect it to `pyefd`.\n\n```python\nimport cv2 \nimport numpy\nfrom pyefd import elliptic_fourier_descriptors\n\n# Find the contours of a binary image using OpenCV.\ncontours, hierarchy = cv2.findContours(\n im, cv2.RETR_TREE, cv2.CHAIN_APPROX_SIMPLE)\n\n# Iterate through all contours found and store each contour's \n# elliptical Fourier descriptor's coefficients.\ncoeffs = []\nfor cnt in contours:\n # Find the coefficients of all contours\n coeffs.append(elliptic_fourier_descriptors(\n numpy.squeeze(cnt), order=10))\n```\n\n### Using EFD as features\n\nTo use these as features, one can write a small wrapper function:\n\n```python\nfrom pyefd import elliptic_fourier_descriptors\n\ndef efd_feature(contour):\n coeffs = elliptic_fourier_descriptors(contour, order=10, normalize=True)\n return coeffs.flatten()[3:]\n```\n\nIf the coefficients are normalized, then `coeffs[0, 0] = 1.0`, `coeffs[0, 1] = 0.0` and \n`coeffs[0, 2] = 0.0`, so they can be disregarded when using the elliptic Fourier descriptors as features.\n\nSee [1] for more technical details.\n\nTesting\n-------\n\nRun tests with with [Pytest](http://pytest.org/latest/):\n\n```bash\npy.test tests.py\n```\n\nThe tests include a single image from the MNIST dataset of handwritten digits ([2]) as a contour to use for testing.\n\nDocumentation\n-------------\n\nSee [ReadTheDocs](http://pyefd.readthedocs.org/).\n\nReferences\n----------\n\n[1]: [Frank P Kuhl, Charles R Giardina, Elliptic Fourier features of a closed contour, Computer Graphics and Image Processing, Volume 18, Issue 3, 1982, Pages 236-258, ISSN 0146-664X, .](http://www.sci.utah.edu/~gerig/CS7960-S2010/handouts/Kuhl-Giardina-CGIP1982.pdf)\n\n[2]: [LeCun et al. (1999): The MNIST Dataset Of Handwritten Digits](http://yann.lecun.com/exdb/mnist/)\n\n\n## v1.40 (2019-07-27)\n- Merged PR #4: Vectorized contour reconstruction function\n\n## v1.3.0 (2019-06-18)\n- Merged PR #2: Numpy vectorized efd\n- Moved from Travis CI to Azure Pipelines\n- Replaced rst with markdown\n\n## v1.2.0 (2018-06-14)\n- Updated setup.py\n- Updated numpy requirement\n- Added Pipfile\n- Ran Black on code\n- Testing on 3.6\n\n## v1.1.0 (2018-06-13)\n- New example for OpenCV\n- Updated documentation\n\n## v1.0 (2016-04-19)\n\n- Deemed stable enough for version 1.0 release\n- Created documentation.\n\n## v0.1.2 (2016-02-29)\n- Testing with pytest instead of nosetests.\n- Added Coveralls use.\n\n## v0.1.1 (2016-02-17)\n- Fixed MANIFEST\n- Added LICENSE file that was missing.\n\n## v0.1.0 (2016-02-09)\n- Initial release\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "", "keywords": "elliptic fourier descriptors,fourier descriptors,shape descriptors,image analysis", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "pyefd", "package_url": "https://pypi.org/project/pyefd/", "platform": "", "project_url": "https://pypi.org/project/pyefd/", "project_urls": null, "release_url": "https://pypi.org/project/pyefd/1.4.0/", "requires_dist": [ "numpy (>=1.7.0)" ], "requires_python": ">=2.7.10", "summary": "Python implementation of \"Elliptic Fourier Features of a Closed Contour\"", "version": "1.4.0" }, "last_serial": 5594180, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "2d9727fca9cb811ba5f54280e3f12bd7", "sha256": "c679d176ef3c1316e039cd57b78b5c148526169503cadcb8f0bb0d45f5a4ce05" }, "downloads": -1, "filename": "pyefd-0.1.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "2d9727fca9cb811ba5f54280e3f12bd7", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 7200, "upload_time": "2016-02-09T08:15:44", "url": "https://files.pythonhosted.org/packages/76/64/509e009be986546d10b40617d29b8c361f6fe934031cd7ef31d1f3b2ca51/pyefd-0.1.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "b4a509a398dc303fa08db066d330a2f5", "sha256": "f247200063b0ba418294a56fc85c81ed3143a8450902311ff11add90fb000377" }, "downloads": -1, "filename": "pyefd-0.1.0.tar.gz", "has_sig": false, "md5_digest": "b4a509a398dc303fa08db066d330a2f5", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5242, "upload_time": "2016-02-09T08:14:41", "url": "https://files.pythonhosted.org/packages/83/18/1a6774e23f9ed2cee5051cbedba39a7c8a12e68f857d072d4a565c041dbc/pyefd-0.1.0.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "b609f0ef2e3ef32a506dc7593f0df516", "sha256": "5fbfd7e51189807309156b53fd1f41f0c9a3b5360107a1dec47127524a89d581" }, "downloads": -1, "filename": "pyefd-0.1.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "b609f0ef2e3ef32a506dc7593f0df516", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 7302, "upload_time": "2016-02-17T16:36:44", "url": "https://files.pythonhosted.org/packages/54/8a/b0df0040862043c6abe0cb3c3c38e47a2004dee15aed51949d7f3704648f/pyefd-0.1.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "275d68714fdf40f7b0c8281347099e37", "sha256": "16255c0240267fd527bb449ed9232867bb2c130b8c5334c50cfbcf3144649e67" }, "downloads": -1, "filename": "pyefd-0.1.1.tar.gz", "has_sig": false, "md5_digest": "275d68714fdf40f7b0c8281347099e37", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6011, "upload_time": "2016-02-17T16:34:45", "url": "https://files.pythonhosted.org/packages/66/20/8bf6a1f5ae31c163f8d4c3f6429771df49d0942cf1353d713b0a33881cf0/pyefd-0.1.1.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "f7c8f1882725bc4dacd7d3d513dec9c6", "sha256": "3d9e991268a851c13c91fc8f827157d3ac1f6e196654b2ac5101cdffe176c679" }, "downloads": -1, "filename": "pyefd-0.1.2-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "f7c8f1882725bc4dacd7d3d513dec9c6", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 7441, "upload_time": "2016-02-29T15:01:13", "url": "https://files.pythonhosted.org/packages/db/19/6d0946c98aac9b0dcc9b8895f626b2098d017753b562ca2a4d742a1d5e85/pyefd-0.1.2-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "0cb9167c7ad309871c46ff354889e566", "sha256": "6ff364c034e436d7fee7ca2618961ec87903dc81fcc9e056b4794019e18329f5" }, "downloads": -1, "filename": "pyefd-0.1.2.tar.gz", "has_sig": false, "md5_digest": "0cb9167c7ad309871c46ff354889e566", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6129, "upload_time": "2016-02-29T15:00:57", "url": "https://files.pythonhosted.org/packages/a1/d7/4091b279f8ab0125108a2144cc0f59b992fa0d759f313437284475377fd1/pyefd-0.1.2.tar.gz" } ], "1.0": [ { "comment_text": "", "digests": { "md5": "30ea74f4b98673a769c4715accf94e0a", "sha256": "c39ed5e58bdb2d2fee591650eb2b0d7772ca4df45e9b039b6953330f6f98d224" }, "downloads": -1, "filename": "pyefd-1.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "30ea74f4b98673a769c4715accf94e0a", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 7520, "upload_time": "2016-04-19T07:50:48", "url": "https://files.pythonhosted.org/packages/47/c0/3f1fc1bbdbb165863071a327ba14b4f033f7c9ab0735e5c055c57988c6c4/pyefd-1.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "06f0faf538ecf7d7d58e809fe37dcb3c", "sha256": "4f5cd7b4ad8f1df72ad3178db791904eed4b2ba65d85448ee38d91fd871c2fef" }, "downloads": -1, "filename": "pyefd-1.0.tar.gz", "has_sig": false, "md5_digest": "06f0faf538ecf7d7d58e809fe37dcb3c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7627, "upload_time": "2016-04-19T07:50:32", "url": "https://files.pythonhosted.org/packages/16/f7/c7e623049bbaa974fbf72fc46f92b459de41b1421550cfe2aad827fd450d/pyefd-1.0.tar.gz" } ], "1.2.0": [ { "comment_text": "", "digests": { "md5": "73dc70335aa59ba56c4d5e8422818e17", "sha256": "b13d40d5f4362803b2ede95eda59a4853fc7ffbd8aa441f09547ae8b4f699123" }, "downloads": -1, "filename": "pyefd-1.2.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "73dc70335aa59ba56c4d5e8422818e17", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": ">=2.7.0", "size": 5537, "upload_time": "2018-06-14T07:37:12", "url": "https://files.pythonhosted.org/packages/f2/79/8515f60d069c7fe69580af669becd0451769264146fbb2a51a9f0dcc665b/pyefd-1.2.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "ffbd10329b18bed2e08cbd7ce48e124d", "sha256": "43433192362b7922489819bfd1f46b1bb43ae67f135d2b6422aa2933a9726329" }, "downloads": -1, "filename": "pyefd-1.2.0.tar.gz", "has_sig": false, "md5_digest": "ffbd10329b18bed2e08cbd7ce48e124d", "packagetype": "sdist", "python_version": "source", "requires_python": ">=2.7.0", "size": 8654, "upload_time": "2018-06-14T07:37:13", "url": "https://files.pythonhosted.org/packages/e7/7f/09818ddc758aa289fbe239d8a606626a95dec8a64e9d9169f5fbe2d6e9c5/pyefd-1.2.0.tar.gz" } ], "1.3.0": [ { "comment_text": "", "digests": { "md5": "89f6092bff245c9480ea4e7d439e5a56", "sha256": "4e77ca25fba0f4d3969f66ff9db463fdf6ac266dee78b50fc410a388495ff305" }, "downloads": -1, "filename": "pyefd-1.3.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "89f6092bff245c9480ea4e7d439e5a56", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": ">=2.7.10", "size": 6429, "upload_time": "2019-06-18T21:30:06", "url": "https://files.pythonhosted.org/packages/b5/0f/28c9ed928085de636fa91d9db4261efcd8fb466f99a5f7937502fb6a4514/pyefd-1.3.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "48baf7819cce942483ff46018e8a8e42", "sha256": "45caa4d6f4bf094dac469aea642c7b03f4cd03915d190db07bf1f9e5ea31dde7" }, "downloads": -1, "filename": "pyefd-1.3.0.tar.gz", "has_sig": false, "md5_digest": "48baf7819cce942483ff46018e8a8e42", "packagetype": "sdist", "python_version": "source", "requires_python": ">=2.7.10", "size": 9000, "upload_time": "2019-06-18T21:30:07", "url": "https://files.pythonhosted.org/packages/0c/89/a4d90fd62977597710cbffe4cfb0f48b237aa24e79c91c25bf228f394e25/pyefd-1.3.0.tar.gz" } ], "1.4.0": [ { "comment_text": "", "digests": { "md5": "cbcc1571c7dea8282492ecfc06f8c77b", "sha256": "b46c5b9b7e98f40a64d34bdf03d8d5c1290f663cabf1be18a0abb6f89804d77b" }, "downloads": -1, "filename": "pyefd-1.4.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "cbcc1571c7dea8282492ecfc06f8c77b", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": ">=2.7.10", "size": 6790, "upload_time": "2019-07-27T21:57:37", "url": "https://files.pythonhosted.org/packages/fa/69/422b60191e303ea4c1dd00e08828420877b5f97c2b398eb1b03e5128bb1d/pyefd-1.4.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "72cfac3ef07afa5b0e61ae1a25018cc0", "sha256": "1b8305e2b58771a9942998aada630081fca8d27f53ada57e350ad7faf0090dd3" }, "downloads": -1, "filename": "pyefd-1.4.0.tar.gz", "has_sig": false, "md5_digest": "72cfac3ef07afa5b0e61ae1a25018cc0", "packagetype": "sdist", "python_version": "source", "requires_python": ">=2.7.10", "size": 11938, "upload_time": "2019-07-27T21:57:39", "url": "https://files.pythonhosted.org/packages/84/77/4087ec15384041678bcde00f5a46132f5aaa3477d03a8af621894c748d03/pyefd-1.4.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "cbcc1571c7dea8282492ecfc06f8c77b", "sha256": "b46c5b9b7e98f40a64d34bdf03d8d5c1290f663cabf1be18a0abb6f89804d77b" }, "downloads": -1, "filename": "pyefd-1.4.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "cbcc1571c7dea8282492ecfc06f8c77b", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": ">=2.7.10", "size": 6790, "upload_time": "2019-07-27T21:57:37", "url": "https://files.pythonhosted.org/packages/fa/69/422b60191e303ea4c1dd00e08828420877b5f97c2b398eb1b03e5128bb1d/pyefd-1.4.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "72cfac3ef07afa5b0e61ae1a25018cc0", "sha256": "1b8305e2b58771a9942998aada630081fca8d27f53ada57e350ad7faf0090dd3" }, "downloads": -1, "filename": "pyefd-1.4.0.tar.gz", "has_sig": false, "md5_digest": "72cfac3ef07afa5b0e61ae1a25018cc0", "packagetype": "sdist", "python_version": "source", "requires_python": ">=2.7.10", "size": 11938, "upload_time": "2019-07-27T21:57:39", "url": "https://files.pythonhosted.org/packages/84/77/4087ec15384041678bcde00f5a46132f5aaa3477d03a8af621894c748d03/pyefd-1.4.0.tar.gz" } ] }