{"id":26472997,"url":"https://github.com/alessiobugetti/histogram-equalization","last_synced_at":"2026-05-04T08:39:07.468Z","repository":{"id":275153276,"uuid":"906768206","full_name":"AlessioBugetti/histogram-equalization","owner":"AlessioBugetti","description":"Implements sequential and parallel histogram equalization in C++ and Python, utilizing CUDA for parallel computation on GPU","archived":false,"fork":false,"pushed_at":"2025-03-07T14:25:32.000Z","size":15836,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-16T13:42:51.014Z","etag":null,"topics":["cuda","gpu-acceleration","histogram-equalization","parallel-computing","pycuda"],"latest_commit_sha":null,"homepage":"","language":"Cuda","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AlessioBugetti.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-12-21T21:05:34.000Z","updated_at":"2025-03-07T14:25:35.000Z","dependencies_parsed_at":"2025-06-01T07:08:50.888Z","dependency_job_id":"d0663d2b-a5c9-4255-9def-8c6293f0f162","html_url":"https://github.com/AlessioBugetti/histogram-equalization","commit_stats":null,"previous_names":["alessiobugetti/histogram-equalization"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/AlessioBugetti/histogram-equalization","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlessioBugetti%2Fhistogram-equalization","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlessioBugetti%2Fhistogram-equalization/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlessioBugetti%2Fhistogram-equalization/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlessioBugetti%2Fhistogram-equalization/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AlessioBugetti","download_url":"https://codeload.github.com/AlessioBugetti/histogram-equalization/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlessioBugetti%2Fhistogram-equalization/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32600967,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-03T22:12:39.696Z","status":"online","status_checked_at":"2026-05-04T02:00:06.625Z","response_time":58,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cuda","gpu-acceleration","histogram-equalization","parallel-computing","pycuda"],"created_at":"2025-03-19T21:50:35.741Z","updated_at":"2026-05-04T08:39:07.448Z","avatar_url":"https://github.com/AlessioBugetti.png","language":"Cuda","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CUDA-Based Histogram Equalization\n\n## Table of Contents\n- [Overview](#overview)\n- [Repository Structure](#repository-structure)\n- [Prerequisites](#prerequisites)\n- [Installation](#installation)\n- [Usage](#usage)\n    - [C++](#c)\n    - [Python](#python)\n- [Cuda Kernels](#cuda-kernels)\n    - [Included Kernels](#included-kernels)\n- [Performance](#performance)\n- [Credits](#credits)\n- [License](#license)\n- [Author](#author)\n\n## Overview\nThis project implements histogram equalization for grayscale images using CUDA. It leverages GPU parallel processing to achieve high performance, particularly for large datasets or computationally intensive tasks.\nThe algorithm incorporates different parallel prefix sum (scan) algorithms:\n- Kogge-Stone\n- Kogge-Stone with Double Buffer\n- Brent-Kung\n\n## Overview\nHistogram equalization is a method in image processing of contrast adjustment using the image's histogram.\n\nBefore Histogram Equalization:\n\n\u003cimg src=\"https://upload.wikimedia.org/wikipedia/commons/0/08/Unequalized_Hawkes_Bay_NZ.jpg\" alt=\"Image before Histogram Equalization\" width=\"300\" /\u003e\n\nCorresponding histogram (red) and cumulative histogram (black):\n\n\u003cimg src=\"https://upload.wikimedia.org/wikipedia/commons/thumb/4/4e/Unequalized_Histogram.svg/2560px-Unequalized_Histogram.svg.png\" alt=\"Corresponding histogram\" width=\"300\" /\u003e\n\nAfter Histogram Equalization:\n\n\u003cimg src=\"https://upload.wikimedia.org/wikipedia/commons/b/bd/Equalized_Hawkes_Bay_NZ.jpg\" alt=\"Image after Histogram Equalization\" width=\"300\" /\u003e\n\nCorresponding histogram (red) and cumulative histogram (black):\n\n\u003cimg src=\"https://upload.wikimedia.org/wikipedia/commons/thumb/3/34/Equalized_Histogram.svg/1920px-Equalized_Histogram.svg.png\" alt=\"Equalized histogram\" width=\"300\" /\u003e\n\n## Repository Structure\n\n```plaintext\n.\n├── python/\n│   └── main.py          # Python script for invoking CUDA kernels and managing the workflow\n├── c++/\n│   ├── main.cu          # CUDA source file containing the implementation of kernels\n│   └── kernel.cu        # CUDA kernel definitions\n├── data/                # Directory for input images\n└── histequalizer        # Script for compiling the project and running benchmarks\n```\n\n## Prerequisites\n\n- CUDA-capable NVIDIA GPU\n- CUDA Toolkit\n- OpenCV\n- C++ compiler\n- CMake\n- Python 3.x (for Python interface)\n- Python Libraries:\n    - numpy\n    - opencv-python\n    - pycuda\n\n## Installation\n1. Clone the repository:\n\n```sh\ngit clone https://github.com/AlessioBugetti/histogram-equalization.git\ncd histogram-equalization\n```\n2. Install Python dependencies:\n\n```sh\npip install -r requirements.txt\n```\n3. Ensure the CUDA environment is set up:\n    - Install NVIDIA drivers.\n    - Install the CUDA Toolkit. \n    - Verify with ```nvcc --version```.\n\n## Usage\n\n### C++\n```sh\n./histequalizer build\n./histequalizer run\n```\n\n### Python\n```sh\npython main.py\n```\n\n## Cuda Kernels\n\n### Included Kernels:\n\n- `CalculateHistogram`: Computes the histogram for the input image.\n- `KoggeStoneScan`: Performs parallel prefix sum using the Kogge-Stone algorithm.\n- `KoggeStoneScanDoubleBuffer`: Performs parallel prefix sum using the Kogge-Stone algorithm with double buffer.\n- `BrentKungScan`: Performs parallel prefix sum using the Brent-Kung algorithm.\n- `NormalizeCdf`: Normalizes the CDF for intensity adjustment.\n- `EqualizeHistogram`: Applies the equalized histogram to the input image.\n  \n\n## Performance\nThe implementation includes benchmarking capabilities that measure:\n- Sequential CPU execution time\n- CUDA execution time for each scan algorithm.\n- Speedup ratios compared to CPU implementation.\n- Measurements are averaged over multiple iterations to ensure reliable results.\n\n## Credits\nThe images used, placed in the [`data`](data/) folder, were sourced from the official European Space Agency (ESA) website dedicated to the Hubble Space Telescope. All credits to [NASA](http://www.nasa.gov/)/[ESA](http://www.esa.int/).\n\n## License\nThis project is licensed under the GPL-3.0-only License. See the [`LICENSE`](LICENSE) file for more details.\n\n## Author\nAlessio Bugetti - alessiobugetti98@gmail.com\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falessiobugetti%2Fhistogram-equalization","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falessiobugetti%2Fhistogram-equalization","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falessiobugetti%2Fhistogram-equalization/lists"}