localaplace


Namelocalaplace JSON
Version 0.0.1 PyPI version JSON
download
home_page
Summaryimplement of local laplace filter algorithm
upload_time2023-11-11 15:15:50
maintainer
docs_urlNone
author
requires_python>=3.5
licenseApache 2.0
keywords local laplace filter local-laplace-filter computer vision tone mapping image process
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            ## Install

```
$ pip install localaplace
```

This is an implement of Local Laplace Filter algorithm [1]  [[Paper](https://people.csail.mit.edu/hasinoff/pubs/ParisEtAl11-lapfilters-lowres.pdf)]. Just see the effect below.


|Image modal|   Original    |   Enhanced    |
|:---:|:------------:|:------------:|
|RGB (800 × 533)|  <img src="./images/flower.png" alt="Image 1" style="width: 600px; height: auto;">  |  <img src="./images/flower_enchanced.png" alt="Image 2" style="width: 600px; height: auto;">  |
|RGBA (600 × 460)|  <img src="./images/anime.png" alt="Image 1" style="width: 600px; height: auto;">  |  <img src="./images/anime_enchanced.png" alt="Image 2" style="width: 600px; height: auto;">  |
|CT (3072 × 3072)|  <img src="./images/ankle.png" alt="Image 1" style="width: 600px; height: auto;">  |  <img src="./images/ankle_enchanced.png" alt="Image 2" style="width: 600px; height: auto;">  |



> This is a boring code when I attempt to finish my computer vision homework, but no available python package is found on PyPi

## Usage

Demo is as follows, the only function is `local_laplace_filter` (Please see my detailed comment of the function to see the meaning of arguments):

```python
import os

import cv2
import localaplace as llp

image = cv2.imread('./images/flower.png', cv2.IMREAD_UNCHANGED)

result = llp.local_laplace_filter(
    image, 0.2, 0.5, 0.8, 100, 
    num_workers=-1, 
    verbose=1, 
    return_layers=False
)

# save result to disk
if not os.path.exists('results'):
    os.makedirs('results')
cv2.imwrite('./results/flower_enchanced.png', result)
```

If you are interested in the Laplace Pyramid, set `return_layers` as `True` to get layers:

```python
result, layers = llp.local_laplace_filter(
    image, 0.2, 0.5, 0.8, 100, 
    num_workers=-1, 
    verbose=1, 
    return_layers=True
)

# save inner layers to disk
for i, layer_image in enumerate(layers):
    cv2.imwrite(f'./results/layer_{i + 1}.png', layer_image)
```


## Reference

[1] Paris, Sylvain, Samuel W. Hasinoff, and Jan Kautz. "Local Laplacian filters: edge-aware image processing with a Laplacian pyramid." Communications of the ACM 58.3 (2015): 81-91

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "localaplace",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.5",
    "maintainer_email": "",
    "keywords": "local laplace filter,local-laplace-filter,computer vision,tone mapping,image process",
    "author": "",
    "author_email": "lstm-kirigaya <1193466151@qq.com>",
    "download_url": "https://files.pythonhosted.org/packages/55/0c/0b3708d27bd21cfa2dca3f4bdb910e5baef89a41d9f4233d13db63cf5cef/localaplace-0.0.1.tar.gz",
    "platform": null,
    "description": "## Install\r\n\r\n```\r\n$ pip install localaplace\r\n```\r\n\r\nThis is an implement of Local Laplace Filter algorithm [1]  [[Paper](https://people.csail.mit.edu/hasinoff/pubs/ParisEtAl11-lapfilters-lowres.pdf)]. Just see the effect below.\r\n\r\n\r\n|Image modal|   Original    |   Enhanced    |\r\n|:---:|:------------:|:------------:|\r\n|RGB (800 \u00d7 533)|  <img src=\"./images/flower.png\" alt=\"Image 1\" style=\"width: 600px; height: auto;\">  |  <img src=\"./images/flower_enchanced.png\" alt=\"Image 2\" style=\"width: 600px; height: auto;\">  |\r\n|RGBA (600 \u00d7 460)|  <img src=\"./images/anime.png\" alt=\"Image 1\" style=\"width: 600px; height: auto;\">  |  <img src=\"./images/anime_enchanced.png\" alt=\"Image 2\" style=\"width: 600px; height: auto;\">  |\r\n|CT (3072 \u00d7 3072)|  <img src=\"./images/ankle.png\" alt=\"Image 1\" style=\"width: 600px; height: auto;\">  |  <img src=\"./images/ankle_enchanced.png\" alt=\"Image 2\" style=\"width: 600px; height: auto;\">  |\r\n\r\n\r\n\r\n> This is a boring code when I attempt to finish my computer vision homework, but no available python package is found on PyPi\r\n\r\n## Usage\r\n\r\nDemo is as follows, the only function is `local_laplace_filter` (Please see my detailed comment of the function to see the meaning of arguments):\r\n\r\n```python\r\nimport os\r\n\r\nimport cv2\r\nimport localaplace as llp\r\n\r\nimage = cv2.imread('./images/flower.png', cv2.IMREAD_UNCHANGED)\r\n\r\nresult = llp.local_laplace_filter(\r\n    image, 0.2, 0.5, 0.8, 100, \r\n    num_workers=-1, \r\n    verbose=1, \r\n    return_layers=False\r\n)\r\n\r\n# save result to disk\r\nif not os.path.exists('results'):\r\n    os.makedirs('results')\r\ncv2.imwrite('./results/flower_enchanced.png', result)\r\n```\r\n\r\nIf you are interested in the Laplace Pyramid, set `return_layers` as `True` to get layers:\r\n\r\n```python\r\nresult, layers = llp.local_laplace_filter(\r\n    image, 0.2, 0.5, 0.8, 100, \r\n    num_workers=-1, \r\n    verbose=1, \r\n    return_layers=True\r\n)\r\n\r\n# save inner layers to disk\r\nfor i, layer_image in enumerate(layers):\r\n    cv2.imwrite(f'./results/layer_{i + 1}.png', layer_image)\r\n```\r\n\r\n\r\n## Reference\r\n\r\n[1] Paris, Sylvain, Samuel W. Hasinoff, and Jan Kautz. \"Local Laplacian filters: edge-aware image processing with a Laplacian pyramid.\" Communications of the ACM 58.3 (2015): 81-91\r\n",
    "bugtrack_url": null,
    "license": "Apache 2.0",
    "summary": "implement of local laplace filter algorithm",
    "version": "0.0.1",
    "project_urls": {
        "text": "https://github.com/LSTM-Kirigaya"
    },
    "split_keywords": [
        "local laplace filter",
        "local-laplace-filter",
        "computer vision",
        "tone mapping",
        "image process"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "4b31d549dae69803d74d09591bb97f7b2cf15c19d66fca440f19d85670a8c4b6",
                "md5": "d2be81a194a96e823dda4ea77f44620a",
                "sha256": "37ebf40cbee4ae2bb6870e6084824938af56012c3fb34932e2a76d15ee998ddf"
            },
            "downloads": -1,
            "filename": "localaplace-0.0.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "d2be81a194a96e823dda4ea77f44620a",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.5",
            "size": 10367,
            "upload_time": "2023-11-11T15:15:48",
            "upload_time_iso_8601": "2023-11-11T15:15:48.410489Z",
            "url": "https://files.pythonhosted.org/packages/4b/31/d549dae69803d74d09591bb97f7b2cf15c19d66fca440f19d85670a8c4b6/localaplace-0.0.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "550c0b3708d27bd21cfa2dca3f4bdb910e5baef89a41d9f4233d13db63cf5cef",
                "md5": "2dac4740d7da117bd5fe45010097d97e",
                "sha256": "ecfab21738cb8582484f3ebc5d994db640282ab74d3d3f800571f49b89f4f4f8"
            },
            "downloads": -1,
            "filename": "localaplace-0.0.1.tar.gz",
            "has_sig": false,
            "md5_digest": "2dac4740d7da117bd5fe45010097d97e",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.5",
            "size": 9912,
            "upload_time": "2023-11-11T15:15:50",
            "upload_time_iso_8601": "2023-11-11T15:15:50.473160Z",
            "url": "https://files.pythonhosted.org/packages/55/0c/0b3708d27bd21cfa2dca3f4bdb910e5baef89a41d9f4233d13db63cf5cef/localaplace-0.0.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-11-11 15:15:50",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "localaplace"
}
        
Elapsed time: 3.36604s