{ "info": { "author": "zgyy", "author_email": "347186678@qq.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "Intended Audience :: Science/Research", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 2", "Programming Language :: Python :: 3", "Topic :: Scientific/Engineering :: Image Recognition", "Topic :: Scientific/Engineering :: Mathematics", "Topic :: Scientific/Engineering :: Physics" ], "description": "==========\naffine6p\n==========\n\nThe Python lib to estimate affine transformation parameters between two sets of 2D points.::\n\n | x' | | a b p | | x |\n | y' | = | c d q | | y |\n | 1 | | 0 0 1 | | 1 |\n\n.. image:: https://gitlab.com/yoshimoto/affine6p-py/raw/master/affine6p.png\n :alt: Example transformation\n :height: 353px\n :width: 300px\n\nWhen the sets are more than three points, the lib estimate parameters with the least squares method.\n\nIn making this lib, I used a lot of ideas in nudged lib. Ref: https://github.com/axelpale/nudged-py\n\nInstall\n-----------\nUse pip::\n\n pip install affine6p\n\nUsage\n-----------\n\nYou have lists of points for the **original** and **converted** of the transformation function to be estimated::\n\n import affine6p\n origin = [[0,0], [1,0], [0,1], [1,1]]\n convert = [[0,0], [1,0], [0,1], [1,1.1]]\n trans = affine6p.estimate(origin, convert)\n trans.get_matrix()\n # [[1.0, 0.0, 0.0],\n # [0.050000000000000044, 1.05, -0.02499999999999991],\n # [0, 0, 1]]\n affine6p.estimate_error(trans, origin, convert)\n # 0.025000000000000022\n\nWhen the number of origin is **1**, assume the following relationship::\n\n a = d = 1 and b = c = 0\n\nWhen the number of origin is **2**, assume the following relationship as described in *estimate_helmert*.::\n\n a = d and b = -c \n\nYou can access **Transform class members**.::\n\n trans.a() # params[0]\n trans.b() # params[1]\n trans.c() # params[2]\n trans.d() # params[3]\n trans.p() # params[4]\n trans.q() # params[5]\n trans.get_matrix() # [[a, b, p], [c, d, q], [0, 0, 1]]\n trans.get_rotation_x() # math.atan2(-b, a)\n trans.get_rotation_y() # math.atan2(c, d)\n trans.get_scale_x() # sqrt(a*a + b*b)\n trans.get_scale_y() # sqrt(c*c + d*d)\n trans.get_scale() # sqrt((scale_x*scale_x+scale_y*scale_y)*0.5)\n trans.get_translation() # [p, q]\n trans.params # [a, b, c, d, p, q]\n\nYou can apply **transform** or **rotate** to 2D point or points. The rotate means *p = q = 0*.::\n\n trans.transform([0, 0])\n trans.transform([[0, 0], [1, 1]])\n point = [0, 0]\n trans.transform_inv(point)\n trans.rotate(point)\n trans.rotate_inv(point)", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://gitlab.com/yoshimoto/affine6p-py", "keywords": "calculate affine transformation six parameters", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "affine6p-cstest", "package_url": "https://pypi.org/project/affine6p-cstest/", "platform": "", "project_url": "https://pypi.org/project/affine6p-cstest/", "project_urls": { "Homepage": "https://gitlab.com/yoshimoto/affine6p-py" }, "release_url": "https://pypi.org/project/affine6p-cstest/0.8.1/", "requires_dist": null, "requires_python": "", "summary": "To calculate affine transformation parameters with six free parameters.", "version": "0.8.1" }, "last_serial": 4088941, "releases": { "0.8.1": [ { "comment_text": "", "digests": { "md5": "ef57d87a6702359906aaba2a6d443411", "sha256": "d177fc62f6640e7cd1b1e18980a230047b1e67179e97dab73aa6e324e50af326" }, "downloads": -1, "filename": "affine6p-cstest-0.8.1.tar.gz", "has_sig": false, "md5_digest": "ef57d87a6702359906aaba2a6d443411", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4083, "upload_time": "2018-07-21T17:33:22", "url": "https://files.pythonhosted.org/packages/03/c1/ae75c0947949c537b7730bef5704fd0bad58b5ad7f0664c1d6ca37ef20da/affine6p-cstest-0.8.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "ef57d87a6702359906aaba2a6d443411", "sha256": "d177fc62f6640e7cd1b1e18980a230047b1e67179e97dab73aa6e324e50af326" }, "downloads": -1, "filename": "affine6p-cstest-0.8.1.tar.gz", "has_sig": false, "md5_digest": "ef57d87a6702359906aaba2a6d443411", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4083, "upload_time": "2018-07-21T17:33:22", "url": "https://files.pythonhosted.org/packages/03/c1/ae75c0947949c537b7730bef5704fd0bad58b5ad7f0664c1d6ca37ef20da/affine6p-cstest-0.8.1.tar.gz" } ] }