{ "info": { "author": "vfdev-5", "author_email": "vfdev.5@gmail.com", "bugtrack_url": null, "classifiers": [], "description": "[![Build Status](https://travis-ci.org/vfdev-5/ImageTilingUtils.svg?branch=master)](https://travis-ci.org/vfdev-5/ImageTilingUtils)\n[![Coverage Status](https://coveralls.io/repos/github/vfdev-5/ImageTilingUtils/badge.svg?branch=master)](https://coveralls.io/github/vfdev-5/ImageTilingUtils?branch=master)\n[![Documentation Status](https://readthedocs.org/projects/imagetilingutils/badge/?version=latest)](http://imagetilingutils.readthedocs.io/en/latest/?badge=latest)\n\n# Image Tiling Utils\nMinimalistic set of image reader agnostic tools to easily iterate over large images\n\n**Example 1**\n\nLet's iterate over a large image with overlapping tiles of the \nsame size tiles in pixels. At boundaries we add \"no-data\" pixels. \nLet's assume the data access is provided with an example function\n```python\ndef read_data(x, y, width, height, out_width=None, out_height=None):\n out_width = width if out_width is None else out_width\n out_height = height if out_height is None else out_height \n img.read(x, y, width, height, out_width, out_height)\n``` \nThus, overlapping tiles can be extracted as \n```python\nfrom tiling import ConstStrideTiles\n\ntiles = ConstStrideTiles(image_size=(500, 500), tile_size=(256, 256), stride=(100, 100), \n origin=(-100, -100),\n scale=1.0,\n include_nodata=True)\n\nprint(\"Number of tiles: %i\" % len(tiles))\nfor extent, out_size in tiles:\n x, y, width, height = extent\n data = read_data(x, y, width, height, \n out_width=out_size[0], \n out_height=out_size[1])\n print(\"data.shape: {}\".format(data.shape))\n\n# Access a tile:\ni = len(tiles) // 2 \nextent, out_size = tiles[i]\n```\n\n![example 1 tiles](assets/example_const_stride_tiles.png)\n\n\n**Example 2**\n\nLet's iterate over a large image with overlapping tiles of the same size in pixels. \nIn this case we prefer to not going outside the input image and fill tiles with `nodata`.\nIn this situation, overlapping is not constant. \nLet's assume the data access is provided with an example function\n```python\ndef read_data(x, y, width, height, out_width=None, out_height=None):\n out_width = width if out_width is None else out_width\n out_height = height if out_height is None else out_height \n img.read(x, y, width, height, out_width, out_height)\n``` \nThus, overlapping tiles can be extracted as \n```python\nfrom tiling import ConstSizeTiles\n\ntiles = ConstSizeTiles(image_size=(500, 500), tile_size=(256, 256), min_overlapping=15, scale=1.0)\n\nprint(\"Number of tiles: %i\" % len(tiles))\nfor extent in tiles:\n x, y, width, height = extent\n data = read_data(x, y, width, height, \n out_width=tiles.tile_size[0], \n out_height=tiles.tile_size[1])\n print(\"data.shape: {}\".format(data.shape))\n\n# Access a tile:\ni = len(tiles) // 2 \nextent = tiles[i]\n```\n\n![example 2 tiles](assets/example_const_size_tiles.png)\n\n\n## Installation:\n\n#### from pip\n```bash\npip install tiling\n```\n\n#### from sources\n\n```bash\npip install git+https://github.com/vfdev-5/ImageTilingUtils.git\n```\n\n## Examples \n\nFor more practical examples, see [notebooks](examples)\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": "https://github.com/vfdev-5/ImageTilingUtils", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "tiling", "package_url": "https://pypi.org/project/tiling/", "platform": "", "project_url": "https://pypi.org/project/tiling/", "project_urls": { "Homepage": "https://github.com/vfdev-5/ImageTilingUtils" }, "release_url": "https://pypi.org/project/tiling/0.2.0/", "requires_dist": [ "six", "pytest ; extra == 'tests'", "pytest-cov ; extra == 'tests'" ], "requires_python": "", "summary": "Minimalistic set of image reader agnostic tools to easily iterate over large images", "version": "0.2.0" }, "last_serial": 5850654, "releases": { "0.1.2": [ { "comment_text": "", "digests": { "md5": "652c0630c4390327ddf5e756d68e62ec", "sha256": "0730e7d0cf87d9c20ac3b30a6182a241a7e3b405226f13fa4fc94edb04ec9bb1" }, "downloads": -1, "filename": "tiling-0.1.2-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "652c0630c4390327ddf5e756d68e62ec", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 4799, "upload_time": "2018-06-02T14:27:00", "url": "https://files.pythonhosted.org/packages/25/a0/74b5526d0ab386da743d42835c18d093bd663064ba89858a05d881a31fc8/tiling-0.1.2-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "06fca33719df242e8db6dd9d7804b6e2", "sha256": "d5250daf51913a330d50e265c77bb7850b1b1a0a16471373ce360ebbc0cf2853" }, "downloads": -1, "filename": "tiling-0.1.2.tar.gz", "has_sig": false, "md5_digest": "06fca33719df242e8db6dd9d7804b6e2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4409, "upload_time": "2018-06-02T14:27:01", "url": "https://files.pythonhosted.org/packages/9d/16/a65171bc66e23e3b75d08d8654126f74bf0858b6fe2015309bf5f0511dce/tiling-0.1.2.tar.gz" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "86dc1d96dc3f330b383222c9bbf0ebb5", "sha256": "922b9e7fe479e0f13cf2e6cee0d92c67c0adff1eb60a0cc4c7f741ed674736ba" }, "downloads": -1, "filename": "tiling-0.2.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "86dc1d96dc3f330b383222c9bbf0ebb5", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 7289, "upload_time": "2019-09-18T14:35:03", "url": "https://files.pythonhosted.org/packages/53/88/adeb789131ec49f9644b141fc591d1ee963d0c5773eb2816fd08c1b5d821/tiling-0.2.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "fa4defb21aedc1a7915c20c7228edfaa", "sha256": "37c5d71f630078069dd9c3f353998ed979e7b03c4a94b24ba5f51021f411968f" }, "downloads": -1, "filename": "tiling-0.2.0-py3.6.egg", "has_sig": false, "md5_digest": "fa4defb21aedc1a7915c20c7228edfaa", "packagetype": "bdist_egg", "python_version": "3.6", "requires_python": null, "size": 12626, "upload_time": "2019-09-18T14:35:05", "url": "https://files.pythonhosted.org/packages/f5/61/a9ddc10639c549272a7ef49cb5dcfd40d5f0bae7477742b2f34ebae92bbf/tiling-0.2.0-py3.6.egg" }, { "comment_text": "", "digests": { "md5": "b39eae82f2919b7e959c843e8d9d34d8", "sha256": "ccefa505adc357286a090c12b4ddab4615858f220b2250b28091883a89fc6765" }, "downloads": -1, "filename": "tiling-0.2.0.tar.gz", "has_sig": false, "md5_digest": "b39eae82f2919b7e959c843e8d9d34d8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5223, "upload_time": "2019-09-18T14:35:06", "url": "https://files.pythonhosted.org/packages/78/70/d4f3061fd4b097873a1fa29619d837aade74f1871e4268ec8a0d18a6f9bf/tiling-0.2.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "86dc1d96dc3f330b383222c9bbf0ebb5", "sha256": "922b9e7fe479e0f13cf2e6cee0d92c67c0adff1eb60a0cc4c7f741ed674736ba" }, "downloads": -1, "filename": "tiling-0.2.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "86dc1d96dc3f330b383222c9bbf0ebb5", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 7289, "upload_time": "2019-09-18T14:35:03", "url": "https://files.pythonhosted.org/packages/53/88/adeb789131ec49f9644b141fc591d1ee963d0c5773eb2816fd08c1b5d821/tiling-0.2.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "fa4defb21aedc1a7915c20c7228edfaa", "sha256": "37c5d71f630078069dd9c3f353998ed979e7b03c4a94b24ba5f51021f411968f" }, "downloads": -1, "filename": "tiling-0.2.0-py3.6.egg", "has_sig": false, "md5_digest": "fa4defb21aedc1a7915c20c7228edfaa", "packagetype": "bdist_egg", "python_version": "3.6", "requires_python": null, "size": 12626, "upload_time": "2019-09-18T14:35:05", "url": "https://files.pythonhosted.org/packages/f5/61/a9ddc10639c549272a7ef49cb5dcfd40d5f0bae7477742b2f34ebae92bbf/tiling-0.2.0-py3.6.egg" }, { "comment_text": "", "digests": { "md5": "b39eae82f2919b7e959c843e8d9d34d8", "sha256": "ccefa505adc357286a090c12b4ddab4615858f220b2250b28091883a89fc6765" }, "downloads": -1, "filename": "tiling-0.2.0.tar.gz", "has_sig": false, "md5_digest": "b39eae82f2919b7e959c843e8d9d34d8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5223, "upload_time": "2019-09-18T14:35:06", "url": "https://files.pythonhosted.org/packages/78/70/d4f3061fd4b097873a1fa29619d837aade74f1871e4268ec8a0d18a6f9bf/tiling-0.2.0.tar.gz" } ] }