foureg


Namefoureg JSON
Version 0.1.0 PyPI version JSON
download
home_pagehttps://github.com/GCBallesteros/foureg
SummaryFourier transform based image registration
upload_time2023-05-27 06:11:49
maintainer
docs_urlNone
authorGuillem Ballesteros
requires_python>=3.8,<3.12
license
keywords image registration image
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            Foureg
======
Image registration using discrete Fourier transform.


Given two images, `foureg` calculates a similarity transformation that
transforms one image into the other.

NOTE
----
THIS IS STILL WIP AND INTERFACES MAY CHANGE WITHOU NOTICE

Example
-------
The example transforms an image with a user defined transformation and then rediscovers
it using `foureg`.
```python
import matplotlib.pyplot as plt
import numpy as np
from PIL import Image  # Not a dependency from this pa

from foureg import similarity, similarity_matrix, transform_img

# 1) Make up some transformation
transformation = similarity_matrix(1.2, 15, (40, 60))

# 2) Open the master image and transform it to generate the slave image
master = np.asarray(Image.open("./resources/examples/sample1.png"))
slave = transform_img(master, transformation)


# 3) Use foureg to recover the transformation
imreg_result = similarity(master, slave)
slave_transformed = transform_img(slave, imreg_result["transformation"])

4) Some plotting to verify everything is working
_, axs = plt.subplots(1, 5, figsize=(13, 8))
im_0 = axs[0].imshow(master)
plt.colorbar(im_0, ax=axs[0])
im_1 = axs[1].imshow(slave)
plt.colorbar(im_1, ax=axs[1])
im_2 = axs[2].imshow(slave_transformed)
plt.colorbar(im_2, ax=axs[2])
im_3 = axs[3].imshow(imreg_result["timg"])
plt.colorbar(im_3, ax=axs[3])
im_4 = axs[4].imshow(np.abs(imreg_result["timg"] - master))
plt.colorbar(im_4, ax=axs[4])

plt.show()
```

Features
--------
* Image pre-processing options (frequency filtration, image extension).
* Under-the-hood options exposed (iterations, phase correlation filtration).
* Permissive open-source license (3-clause BSD).

Origin story
------------
This is a fork of the [imreg_dft](https://github.com/matejak/imreg_dft) borned of the
desire to achieve the following goals:
- Ability to return the final transformation in matrix form as opposed to the angle,
translation and scaling factor separately. The original code makes obtaining that
matrix really hard because it does some unorthodox resizings when performing the
image transformations.
- Better performance and ultimately a Pytorch powered GPU implementation
- A more focused codebase. The only goal here is to estimate similarity transformations
between pairs of images.


Acknowledgements
----------------
The code was originally developed by Christoph Gohlke (University of California, Irvine, USA)
and later on developed further by Matěj Týč (Brno University of Technology, CZ). This
repo wouldn't exist without them.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/GCBallesteros/foureg",
    "name": "foureg",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.8,<3.12",
    "maintainer_email": "",
    "keywords": "image registration,image",
    "author": "Guillem Ballesteros",
    "author_email": "guillem@maxwellrules.com",
    "download_url": "https://files.pythonhosted.org/packages/72/d1/711e95ccdc0d291ede1eecddc66a3f134a19fb507e17fabf03529a1713ba/foureg-0.1.0.tar.gz",
    "platform": null,
    "description": "Foureg\n======\nImage registration using discrete Fourier transform.\n\n\nGiven two images, `foureg` calculates a similarity transformation that\ntransforms one image into the other.\n\nNOTE\n----\nTHIS IS STILL WIP AND INTERFACES MAY CHANGE WITHOU NOTICE\n\nExample\n-------\nThe example transforms an image with a user defined transformation and then rediscovers\nit using `foureg`.\n```python\nimport matplotlib.pyplot as plt\nimport numpy as np\nfrom PIL import Image  # Not a dependency from this pa\n\nfrom foureg import similarity, similarity_matrix, transform_img\n\n# 1) Make up some transformation\ntransformation = similarity_matrix(1.2, 15, (40, 60))\n\n# 2) Open the master image and transform it to generate the slave image\nmaster = np.asarray(Image.open(\"./resources/examples/sample1.png\"))\nslave = transform_img(master, transformation)\n\n\n# 3) Use foureg to recover the transformation\nimreg_result = similarity(master, slave)\nslave_transformed = transform_img(slave, imreg_result[\"transformation\"])\n\n4) Some plotting to verify everything is working\n_, axs = plt.subplots(1, 5, figsize=(13, 8))\nim_0 = axs[0].imshow(master)\nplt.colorbar(im_0, ax=axs[0])\nim_1 = axs[1].imshow(slave)\nplt.colorbar(im_1, ax=axs[1])\nim_2 = axs[2].imshow(slave_transformed)\nplt.colorbar(im_2, ax=axs[2])\nim_3 = axs[3].imshow(imreg_result[\"timg\"])\nplt.colorbar(im_3, ax=axs[3])\nim_4 = axs[4].imshow(np.abs(imreg_result[\"timg\"] - master))\nplt.colorbar(im_4, ax=axs[4])\n\nplt.show()\n```\n\nFeatures\n--------\n* Image pre-processing options (frequency filtration, image extension).\n* Under-the-hood options exposed (iterations, phase correlation filtration).\n* Permissive open-source license (3-clause BSD).\n\nOrigin story\n------------\nThis is a fork of the [imreg_dft](https://github.com/matejak/imreg_dft) borned of the\ndesire to achieve the following goals:\n- Ability to return the final transformation in matrix form as opposed to the angle,\ntranslation and scaling factor separately. The original code makes obtaining that\nmatrix really hard because it does some unorthodox resizings when performing the\nimage transformations.\n- Better performance and ultimately a Pytorch powered GPU implementation\n- A more focused codebase. The only goal here is to estimate similarity transformations\nbetween pairs of images.\n\n\nAcknowledgements\n----------------\nThe code was originally developed by Christoph Gohlke (University of California, Irvine, USA)\nand later on developed further by Mat\u011bj T\u00fd\u010d (Brno University of Technology, CZ). This\nrepo wouldn't exist without them.\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "Fourier transform based image registration",
    "version": "0.1.0",
    "project_urls": {
        "Homepage": "https://github.com/GCBallesteros/foureg",
        "Repository": "https://github.com/GCBallesteros/foureg"
    },
    "split_keywords": [
        "image registration",
        "image"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "e8fd91ec6499690f5c4ca0cb911e425e43540514833a7f8f9bd3cfa26f874edb",
                "md5": "969682c9227b65049bedad0e0af6c230",
                "sha256": "268fa27c47d9fdb9d49db1bd70bfff4dbfdb7ceae62e68bf30f2075d97e2fe90"
            },
            "downloads": -1,
            "filename": "foureg-0.1.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "969682c9227b65049bedad0e0af6c230",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8,<3.12",
            "size": 17135,
            "upload_time": "2023-05-27T06:11:47",
            "upload_time_iso_8601": "2023-05-27T06:11:47.186717Z",
            "url": "https://files.pythonhosted.org/packages/e8/fd/91ec6499690f5c4ca0cb911e425e43540514833a7f8f9bd3cfa26f874edb/foureg-0.1.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "72d1711e95ccdc0d291ede1eecddc66a3f134a19fb507e17fabf03529a1713ba",
                "md5": "cc92fdc427561bfeccafaed97fd46aab",
                "sha256": "786b40f7bf06c26689cf869f06d5c2c3a0e6a5c794675f5be63b84ad45e6c121"
            },
            "downloads": -1,
            "filename": "foureg-0.1.0.tar.gz",
            "has_sig": false,
            "md5_digest": "cc92fdc427561bfeccafaed97fd46aab",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8,<3.12",
            "size": 15953,
            "upload_time": "2023-05-27T06:11:49",
            "upload_time_iso_8601": "2023-05-27T06:11:49.183479Z",
            "url": "https://files.pythonhosted.org/packages/72/d1/711e95ccdc0d291ede1eecddc66a3f134a19fb507e17fabf03529a1713ba/foureg-0.1.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-05-27 06:11:49",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "GCBallesteros",
    "github_project": "foureg",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "foureg"
}
        
Elapsed time: 0.07360s