Fringes


NameFringes JSON
Version 1.1.1 PyPI version JSON
download
home_pagehttps://github.com/comimag/fringes
SummaryPhase shifting algorithms for encoding and decoding sinusoidal fringe patterns.
upload_time2024-04-14 18:51:50
maintainerNone
docs_urlNone
authorChristian Kludt
requires_python<3.13,>=3.9
licenseCC-BY-NC-SA-4.0
keywords phase shifting phase unwrapping fringe analysis fringe projection deflectometry computational imaging
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Fringes
[![PyPI](https://img.shields.io/pypi/v/fringes)](https://pypi.org/project/fringes/)
![PyPI - Python Version](https://img.shields.io/pypi/pyversions/fringes)
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
[![Read the Docs](https://img.shields.io/readthedocs/fringes)](https://fringes.readthedocs.io)
[![PyPI - License](https://img.shields.io/pypi/l/fringes)](https://github.com/comimag/fringes/blob/main/LICENSE.txt)
[![Static Badge](https://img.shields.io/badge/DOI-10.5281%2Fzenodo.10936353-blue)](https://zenodo.org/doi/10.5281/zenodo.10936353)
[![PyPI - Downloads](https://img.shields.io/pypi/dm/fringes)](https://pypistats.org/packages/fringes)

<!---
# todo: DOI
![GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/comimag/fringes/python-package.yml)
![GitHub top language](https://img.shields.io/github/languages/top/comimag/fringes)
![https://img.shields.io/badge/python-%3E=3.9-blue](https://img.shields.io/badge/python-%3E=3.9-blue)
![GitHub](https://img.shields.io/github/license/comimag/fringes)
[![Downloads](https://static.pepy.tech/badge/fringes)](https://pepy.tech/project/fringes)
--->

<!---
link to  paper, please cite
--->

Easily create customized fringe patterns
and analyse them using phase shifting algorithms.

![coding-cheme}](https://raw.githubusercontent.com/comimag/fringes/main/docs/getting_started/coding-scheme.gif)\
Figure 1: Phase Shifting Coding Scheme.

## Features
- [Parameterize](https://fringes.readthedocs.io/en/latest/user_guide/params.html) the phase shifting algorithm
- [Create](https://fringes.readthedocs.io/en/main/getting_started/fundamentals.html#encoding) and
  [decode](https://fringes.readthedocs.io/en/main/getting_started/fundamentals.html#decoding)
  customized fringe patterns
- Generalized Temporal Phase Unwrapping (GTPU)
- Uncertainty Propagation
- [Optimal Coding Strategy](https://fringes.readthedocs.io/en/latest/user_guide/optimal.html)
- [Multiplexing](https://fringes.readthedocs.io/en/latest/user_guide/mux.html)
- Compute [curvature maps](https://fringes.readthedocs.io/en/latest/user_guide/filter.html#curvature)
- Use many more [filter](https://fringes.readthedocs.io/en/latest/user_guide/filter.html) methods

## Installation
You can install `fringes` directly from [PyPi](https://pypi.org/) via `pip`:

```
pip install fringes
```

## Usage
You instantiate, parameterize and deploy the `Fringes` class:

```python
import fringes as frng  # import module

f = frng.Fringes()      # instantiate class

f.X = 1920              # set width of the fringe patterns
f.Y = 1080              # set height of the fringe patterns
f.K = 2                 # set number of sets
f.N = 4                 # set number of shifts
f.v = [9, 10]           # set spatial frequencies
f.T                     # get number of frames
                            
I = f.encode()          # encode fringe patterns
A, B, X = f.decode(I)   # decode fringe patterns
```

All [parameters](https://fringes.readthedocs.io/en/latest/user_guide/params.html)
are accesible as class properties (managed attributes) of the `Fringes` instance.

For generating the fringe pattern sequence `I`, use the method `encode()`.
It returns a [NumPy array](https://numpy.org/doc/stable/reference/generated/numpy.ndarray.html) in videoshape (frames, height, width, color channels).

For analyzing (recorded) fringe patterns, use the method `decode()`.
It returns the Numpy arrays brightness `A`, modulation `B` and coordinate `x`.

> Note:\
For the compitationally expensive ``decoding`` we make use of the just-in-time compiler [Numba](https://numba.pydata.org/).
During the first execution, an initial compilation is executed. 
This can take several tens of seconds up to single digit minutes, depending on your CPU and energy settings.
However, for any subsequent execution, the compiled code is cached and the code of the function runs much faster, 
approaching the speeds of code written in C.

## Graphical User Interface
Do you need a GUI? `Fringes` has a sister project which is called `Fringes-GUI`:

https://pypi.org/project/fringes-gui/

## Documentation
The documentation can be found here:

https://fringes.readthedocs.io

## License
Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International Public License

## Citation
If you use this software, please cite it using this DOI:
[10.5281/zenodo.10936353](https://zenodo.org/doi/10.5281/zenodo.10936353)\
This DOI represents all versions, i.e. the concept of this software package,
and will always resolve to the latest one.

If you want to cite a specific version,
please choose the respective DOI from [Zenodo](https://zenodo.org/doi/10.5281/zenodo.10936353) yourself.

## Support
I was looking for a user-friendly tool to configure,
encode and decode customized fringe patterns with phase shifting algorithms.
Since I couldn't find any, I started developing one myself.
It is intended for [non-commercial](#license), academic and educational use.

However, I do this entirely in my free time.
If you like this package and can make use of it, I would be happy about a donation.
It will help me keep it up-to-date and adding more features in the future.

<!---
[![Liberapay](https://liberapay.com/assets/widgets/donate.svg)](https://liberapay.com/comimag/donate/)
[![](https://www.paypalobjects.com/en_US/i/btn/btn_donate_LG.gif)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=EHBGZ229DKUC4)
--->

[![paypal](https://img.shields.io/badge/PayPal-00457C?style=for-the-badge&logo=PayPal&logoColor=white)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=EHBGZ229DKUC4)

Thank you!

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/comimag/fringes",
    "name": "Fringes",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<3.13,>=3.9",
    "maintainer_email": null,
    "keywords": "phase shifting, phase unwrapping, fringe analysis, fringe projection, deflectometry, computational imaging",
    "author": "Christian Kludt",
    "author_email": null,
    "download_url": "https://files.pythonhosted.org/packages/37/d6/95812beef402aa6bdce6f5e85277620ae5c0f266f7ed4cc37a7ac790e411/fringes-1.1.1.tar.gz",
    "platform": null,
    "description": "# Fringes\n[![PyPI](https://img.shields.io/pypi/v/fringes)](https://pypi.org/project/fringes/)\n![PyPI - Python Version](https://img.shields.io/pypi/pyversions/fringes)\n[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)\n[![Read the Docs](https://img.shields.io/readthedocs/fringes)](https://fringes.readthedocs.io)\n[![PyPI - License](https://img.shields.io/pypi/l/fringes)](https://github.com/comimag/fringes/blob/main/LICENSE.txt)\n[![Static Badge](https://img.shields.io/badge/DOI-10.5281%2Fzenodo.10936353-blue)](https://zenodo.org/doi/10.5281/zenodo.10936353)\n[![PyPI - Downloads](https://img.shields.io/pypi/dm/fringes)](https://pypistats.org/packages/fringes)\n\n<!---\n# todo: DOI\n![GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/comimag/fringes/python-package.yml)\n![GitHub top language](https://img.shields.io/github/languages/top/comimag/fringes)\n![https://img.shields.io/badge/python-%3E=3.9-blue](https://img.shields.io/badge/python-%3E=3.9-blue)\n![GitHub](https://img.shields.io/github/license/comimag/fringes)\n[![Downloads](https://static.pepy.tech/badge/fringes)](https://pepy.tech/project/fringes)\n--->\n\n<!---\nlink to  paper, please cite\n--->\n\nEasily create customized fringe patterns\nand analyse them using phase shifting algorithms.\n\n![coding-cheme}](https://raw.githubusercontent.com/comimag/fringes/main/docs/getting_started/coding-scheme.gif)\\\nFigure 1: Phase Shifting Coding Scheme.\n\n## Features\n- [Parameterize](https://fringes.readthedocs.io/en/latest/user_guide/params.html) the phase shifting algorithm\n- [Create](https://fringes.readthedocs.io/en/main/getting_started/fundamentals.html#encoding) and\n  [decode](https://fringes.readthedocs.io/en/main/getting_started/fundamentals.html#decoding)\n  customized fringe patterns\n- Generalized Temporal Phase Unwrapping (GTPU)\n- Uncertainty Propagation\n- [Optimal Coding Strategy](https://fringes.readthedocs.io/en/latest/user_guide/optimal.html)\n- [Multiplexing](https://fringes.readthedocs.io/en/latest/user_guide/mux.html)\n- Compute [curvature maps](https://fringes.readthedocs.io/en/latest/user_guide/filter.html#curvature)\n- Use many more [filter](https://fringes.readthedocs.io/en/latest/user_guide/filter.html) methods\n\n## Installation\nYou can install `fringes` directly from [PyPi](https://pypi.org/) via `pip`:\n\n```\npip install fringes\n```\n\n## Usage\nYou instantiate, parameterize and deploy the `Fringes` class:\n\n```python\nimport fringes as frng  # import module\n\nf = frng.Fringes()      # instantiate class\n\nf.X = 1920              # set width of the fringe patterns\nf.Y = 1080              # set height of the fringe patterns\nf.K = 2                 # set number of sets\nf.N = 4                 # set number of shifts\nf.v = [9, 10]           # set spatial frequencies\nf.T                     # get number of frames\n                            \nI = f.encode()          # encode fringe patterns\nA, B, X = f.decode(I)   # decode fringe patterns\n```\n\nAll [parameters](https://fringes.readthedocs.io/en/latest/user_guide/params.html)\nare accesible as class properties (managed attributes) of the `Fringes` instance.\n\nFor generating the fringe pattern sequence `I`, use the method `encode()`.\nIt returns a [NumPy array](https://numpy.org/doc/stable/reference/generated/numpy.ndarray.html) in videoshape (frames, height, width, color channels).\n\nFor analyzing (recorded) fringe patterns, use the method `decode()`.\nIt returns the Numpy arrays brightness `A`, modulation `B` and coordinate `x`.\n\n> Note:\\\nFor the compitationally expensive ``decoding`` we make use of the just-in-time compiler [Numba](https://numba.pydata.org/).\nDuring the first execution, an initial compilation is executed. \nThis can take several tens of seconds up to single digit minutes, depending on your CPU and energy settings.\nHowever, for any subsequent execution, the compiled code is cached and the code of the function runs much faster, \napproaching the speeds of code written in C.\n\n## Graphical User Interface\nDo you need a GUI? `Fringes` has a sister project which is called `Fringes-GUI`:\n\nhttps://pypi.org/project/fringes-gui/\n\n## Documentation\nThe documentation can be found here:\n\nhttps://fringes.readthedocs.io\n\n## License\nCreative Commons Attribution-NonCommercial-ShareAlike 4.0 International Public License\n\n## Citation\nIf you use this software, please cite it using this DOI:\n[10.5281/zenodo.10936353](https://zenodo.org/doi/10.5281/zenodo.10936353)\\\nThis DOI represents all versions, i.e. the concept of this software package,\nand will always resolve to the latest one.\n\nIf you want to cite a specific version,\nplease choose the respective DOI from [Zenodo](https://zenodo.org/doi/10.5281/zenodo.10936353) yourself.\n\n## Support\nI was looking for a user-friendly tool to configure,\nencode and decode customized fringe patterns with phase shifting algorithms.\nSince I couldn't find any, I started developing one myself.\nIt is intended for [non-commercial](#license), academic and educational use.\n\nHowever, I do this entirely in my free time.\nIf you like this package and can make use of it, I would be happy about a donation.\nIt will help me keep it up-to-date and adding more features in the future.\n\n<!---\n[![Liberapay](https://liberapay.com/assets/widgets/donate.svg)](https://liberapay.com/comimag/donate/)\n[![](https://www.paypalobjects.com/en_US/i/btn/btn_donate_LG.gif)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=EHBGZ229DKUC4)\n--->\n\n[![paypal](https://img.shields.io/badge/PayPal-00457C?style=for-the-badge&logo=PayPal&logoColor=white)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=EHBGZ229DKUC4)\n\nThank you!\n",
    "bugtrack_url": null,
    "license": "CC-BY-NC-SA-4.0",
    "summary": "Phase shifting algorithms for encoding and decoding sinusoidal fringe patterns.",
    "version": "1.1.1",
    "project_urls": {
        "Documentation": "https://fringes.readthedocs.io",
        "Homepage": "https://github.com/comimag/fringes",
        "Repository": "https://github.com/comimag/fringes"
    },
    "split_keywords": [
        "phase shifting",
        " phase unwrapping",
        " fringe analysis",
        " fringe projection",
        " deflectometry",
        " computational imaging"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "f5da2c294059ac09fba74e3a57a5b24edf055184b3e9a788ea38187adc33fe79",
                "md5": "f0f38141d132389a7fd6293d8cfabc5a",
                "sha256": "9b3d76b56712bbfe9bc1ab971e1ad88d93adc9f8308a2d3b63b8d3ac36b96d76"
            },
            "downloads": -1,
            "filename": "fringes-1.1.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "f0f38141d132389a7fd6293d8cfabc5a",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<3.13,>=3.9",
            "size": 56282,
            "upload_time": "2024-04-14T18:51:49",
            "upload_time_iso_8601": "2024-04-14T18:51:49.246411Z",
            "url": "https://files.pythonhosted.org/packages/f5/da/2c294059ac09fba74e3a57a5b24edf055184b3e9a788ea38187adc33fe79/fringes-1.1.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "37d695812beef402aa6bdce6f5e85277620ae5c0f266f7ed4cc37a7ac790e411",
                "md5": "368ce05971fcba67bcc8f95aa9b04415",
                "sha256": "20334c86a8bacca66bc615c1e220a0247bbc6148c6c0cf75ed355199e1ae3264"
            },
            "downloads": -1,
            "filename": "fringes-1.1.1.tar.gz",
            "has_sig": false,
            "md5_digest": "368ce05971fcba67bcc8f95aa9b04415",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<3.13,>=3.9",
            "size": 54715,
            "upload_time": "2024-04-14T18:51:50",
            "upload_time_iso_8601": "2024-04-14T18:51:50.579459Z",
            "url": "https://files.pythonhosted.org/packages/37/d6/95812beef402aa6bdce6f5e85277620ae5c0f266f7ed4cc37a7ac790e411/fringes-1.1.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-04-14 18:51:50",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "comimag",
    "github_project": "fringes",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "fringes"
}
        
Elapsed time: 0.23392s