im2dhisteq


Nameim2dhisteq JSON
Version 1.1.0 PyPI version JSON
download
home_pagehttps://github.com/Mamdasn/im2dhisteq
SummaryThis module attempts to enhance contrast of a given image by equalizing its two dimensional histogram.
upload_time2024-02-17 16:58:28
maintainer
docs_urlNone
authorMamdasan Sabrian
requires_python
license
keywords python histogram image-processing contrast-enhancement histogram-equalization image-contrast-enhancement imhist 2dhist hist2d im2dhisteq two-dimensional-histogram
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            
[![PyPI Latest Release](https://img.shields.io/pypi/v/im2dhisteq.svg)](https://pypi.org/project/im2dhisteq/) [![Package Status](https://img.shields.io/pypi/status/im2dhisteq.svg)](https://pypi.org/project/im2dhisteq/) [![Downloads](https://pepy.tech/badge/im2dhisteq)](https://pepy.tech/project/im2dhisteq) [![License](https://img.shields.io/pypi/l/im2dhisteq.svg)](https://github.com/Mamdasn/im2dhisteq/blob/main/LICENSE) ![Repository Size](https://img.shields.io/github/repo-size/mamdasn/im2dhisteq)

# im2dhisteq
This module attempts to enhance contrast of a given image by equalizing its two dimensional histogram. An easy way to enhance quality of a given image is to just equalize its histogram, but despite using minimum resources and a very short process time, there are a lot of drawbacks to it.
One of the ways to tackle drawbacks of `histogram equalization method` is to instead equalize the image's `two dimensional histogram`, as one dimensional histogram of a given image does not contain the image's contextual information. Tests on a multitude of images has shown, by taking contextual information of an image in addition to the image's histogram into account when attempting to enhance contrast, output images are significantly better in quality in compare to histogram equalizaion and a handful of other known methods.

You can access the article that came up with this method [here](https://www.researchgate.net/publication/256822485_Two-dimensional_histogram_equalization_and_contrast_enhancement).

## Two Dimensional Histogram
[Here](https://github.com/Mamdasn/im2dhist) is the source code for the im2dhist python library with a short description on how it's done.

## Installation

Run the following to install:

```python
pip install im2dhisteq
```

## Usage

For images
```Bash
im2dhisteq --input 'cloudy-day.jpg' --output 'assets/cloudy-day-2dhisteq.jpg' --w 6
```
For videos
```Bash
vid2dhisteq --input 'video-input.mp4' --output 'video-output-enhanced.mp4' --w 6
```
### Speed up
The speed of the program can be significantly increased if the go library `lib-im2dhist.go` in src/go_libs in the package is compiled and moved to a dir in the system path.
To compile, first make sure `go` is installed on your system. Then run
```Bash
go mod init lib-im2dhist.go
go mod tidy
```
followed by running the script `make-library`.

#### Download binary
Instead of compiling the go library `lib-im2dhist.go`, you can download the library based on your system configuration:
* [lib-im2dhist-linux-amd64.so](https://github.com/Mamdasn/im2dhisteq/releases/download/v1.0.12/lib-im2dhist-linux-amd64.so)
* [lib-im2dhist-linux-arm64.so](https://github.com/Mamdasn/im2dhisteq/releases/download/v1.0.12/lib-im2dhist-linux-arm64.so)
* [lib-im2dhist-linux-arm.so](https://github.com/Mamdasn/im2dhisteq/releases/download/v1.0.12/lib-im2dhist-linux-arm.so)
* [lib-im2dhist-linux-386.so](https://github.com/Mamdasn/im2dhisteq/releases/download/v1.0.12/lib-im2dhist-linux-386.so)
* [lib-im2dhist-windows-amd64.dll](https://github.com/Mamdasn/im2dhisteq/releases/download/v1.0.12/lib-im2dhist-windows-amd64.dll)
* [lib-im2dhist-windows-386.dll](https://github.com/Mamdasn/im2dhisteq/releases/download/v1.0.12/lib-im2dhist-windows-386.dll)
* [lib-im2dhist-darwin-amd64.dylib](https://github.com/Mamdasn/im2dhisteq/releases/download/v1.0.12/lib-im2dhist-darwin-amd64.dylib)
* [lib-im2dhist-darwin-arm64.dylib](https://github.com/Mamdasn/im2dhisteq/releases/download/v1.0.12/lib-im2dhist-darwin-arm64.dylib)



## Showcase
* A one minute comparative video: https://youtu.be/7LrzX2ZpLAQ
* This is a sample image and its corresponding 2d-histogram equalized image.
![cloudy-day-original-im2dhisteq.jpg Image](https://raw.githubusercontent.com/Mamdasn/im2dhisteq/main/assets/cloudy-day-original-im2dhisteq.jpg "cloudy-day-original-im2dhisteq.jpg Image")

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/Mamdasn/im2dhisteq",
    "name": "im2dhisteq",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "python,histogram,image-processing,contrast-enhancement,histogram-equalization,image-contrast-enhancement,imhist,2dhist,hist2d,im2dhisteq,two-dimensional-histogram",
    "author": "Mamdasan Sabrian",
    "author_email": "<reach.s.farhad@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/14/7c/04a8ed2691856b333d2bb7a664f6db0ede2dd7b58421476aa2d34b6bb3dc/im2dhisteq-1.1.0.tar.gz",
    "platform": null,
    "description": "\n[![PyPI Latest Release](https://img.shields.io/pypi/v/im2dhisteq.svg)](https://pypi.org/project/im2dhisteq/) [![Package Status](https://img.shields.io/pypi/status/im2dhisteq.svg)](https://pypi.org/project/im2dhisteq/) [![Downloads](https://pepy.tech/badge/im2dhisteq)](https://pepy.tech/project/im2dhisteq) [![License](https://img.shields.io/pypi/l/im2dhisteq.svg)](https://github.com/Mamdasn/im2dhisteq/blob/main/LICENSE) ![Repository Size](https://img.shields.io/github/repo-size/mamdasn/im2dhisteq)\n\n# im2dhisteq\nThis module attempts to enhance contrast of a given image by equalizing its two dimensional histogram. An easy way to enhance quality of a given image is to just equalize its histogram, but despite using minimum resources and a very short process time, there are a lot of drawbacks to it.\nOne of the ways to tackle drawbacks of `histogram equalization method` is to instead equalize the image's `two dimensional histogram`, as one dimensional histogram of a given image does not contain the image's contextual information. Tests on a multitude of images has shown, by taking contextual information of an image in addition to the image's histogram into account when attempting to enhance contrast, output images are significantly better in quality in compare to histogram equalizaion and a handful of other known methods.\n\nYou can access the article that came up with this method [here](https://www.researchgate.net/publication/256822485_Two-dimensional_histogram_equalization_and_contrast_enhancement).\n\n## Two Dimensional Histogram\n[Here](https://github.com/Mamdasn/im2dhist) is the source code for the im2dhist python library with a short description on how it's done.\n\n## Installation\n\nRun the following to install:\n\n```python\npip install im2dhisteq\n```\n\n## Usage\n\nFor images\n```Bash\nim2dhisteq --input 'cloudy-day.jpg' --output 'assets/cloudy-day-2dhisteq.jpg' --w 6\n```\nFor videos\n```Bash\nvid2dhisteq --input 'video-input.mp4' --output 'video-output-enhanced.mp4' --w 6\n```\n### Speed up\nThe speed of the program can be significantly increased if the go library `lib-im2dhist.go` in src/go_libs in the package is compiled and moved to a dir in the system path.\nTo compile, first make sure `go` is installed on your system. Then run\n```Bash\ngo mod init lib-im2dhist.go\ngo mod tidy\n```\nfollowed by running the script `make-library`.\n\n#### Download binary\nInstead of compiling the go library `lib-im2dhist.go`, you can download the library based on your system configuration:\n* [lib-im2dhist-linux-amd64.so](https://github.com/Mamdasn/im2dhisteq/releases/download/v1.0.12/lib-im2dhist-linux-amd64.so)\n* [lib-im2dhist-linux-arm64.so](https://github.com/Mamdasn/im2dhisteq/releases/download/v1.0.12/lib-im2dhist-linux-arm64.so)\n* [lib-im2dhist-linux-arm.so](https://github.com/Mamdasn/im2dhisteq/releases/download/v1.0.12/lib-im2dhist-linux-arm.so)\n* [lib-im2dhist-linux-386.so](https://github.com/Mamdasn/im2dhisteq/releases/download/v1.0.12/lib-im2dhist-linux-386.so)\n* [lib-im2dhist-windows-amd64.dll](https://github.com/Mamdasn/im2dhisteq/releases/download/v1.0.12/lib-im2dhist-windows-amd64.dll)\n* [lib-im2dhist-windows-386.dll](https://github.com/Mamdasn/im2dhisteq/releases/download/v1.0.12/lib-im2dhist-windows-386.dll)\n* [lib-im2dhist-darwin-amd64.dylib](https://github.com/Mamdasn/im2dhisteq/releases/download/v1.0.12/lib-im2dhist-darwin-amd64.dylib)\n* [lib-im2dhist-darwin-arm64.dylib](https://github.com/Mamdasn/im2dhisteq/releases/download/v1.0.12/lib-im2dhist-darwin-arm64.dylib)\n\n\n\n## Showcase\n* A one minute comparative video: https://youtu.be/7LrzX2ZpLAQ\n* This is a sample image and its corresponding 2d-histogram equalized image.\n![cloudy-day-original-im2dhisteq.jpg Image](https://raw.githubusercontent.com/Mamdasn/im2dhisteq/main/assets/cloudy-day-original-im2dhisteq.jpg \"cloudy-day-original-im2dhisteq.jpg Image\")\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "This module attempts to enhance contrast of a given image by equalizing its two dimensional histogram.",
    "version": "1.1.0",
    "project_urls": {
        "Homepage": "https://github.com/Mamdasn/im2dhisteq"
    },
    "split_keywords": [
        "python",
        "histogram",
        "image-processing",
        "contrast-enhancement",
        "histogram-equalization",
        "image-contrast-enhancement",
        "imhist",
        "2dhist",
        "hist2d",
        "im2dhisteq",
        "two-dimensional-histogram"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "03d064476630ad6ff825daf9d6d238fd6a964e0549bd964f1e2a63afb2e1a115",
                "md5": "7778c56eafa006520e91ed75516b4c9c",
                "sha256": "330bc853d5236787f042cc66a210a2773f64bbab99767f1a4696a71a6058ce8d"
            },
            "downloads": -1,
            "filename": "im2dhisteq-1.1.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "7778c56eafa006520e91ed75516b4c9c",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 21347,
            "upload_time": "2024-02-17T16:58:27",
            "upload_time_iso_8601": "2024-02-17T16:58:27.258822Z",
            "url": "https://files.pythonhosted.org/packages/03/d0/64476630ad6ff825daf9d6d238fd6a964e0549bd964f1e2a63afb2e1a115/im2dhisteq-1.1.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "147c04a8ed2691856b333d2bb7a664f6db0ede2dd7b58421476aa2d34b6bb3dc",
                "md5": "3fb2a41a2f837bdfa0743d770e51009b",
                "sha256": "f6aa10f15ca22d3761774559c25c59218907d6a3874b00e68636549a3cc36810"
            },
            "downloads": -1,
            "filename": "im2dhisteq-1.1.0.tar.gz",
            "has_sig": false,
            "md5_digest": "3fb2a41a2f837bdfa0743d770e51009b",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 21966,
            "upload_time": "2024-02-17T16:58:28",
            "upload_time_iso_8601": "2024-02-17T16:58:28.411672Z",
            "url": "https://files.pythonhosted.org/packages/14/7c/04a8ed2691856b333d2bb7a664f6db0ede2dd7b58421476aa2d34b6bb3dc/im2dhisteq-1.1.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-02-17 16:58:28",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "Mamdasn",
    "github_project": "im2dhisteq",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [],
    "lcname": "im2dhisteq"
}
        
Elapsed time: 0.39552s