Local Intensity Distribution Equalization – Python port of github.com/peune/lide
Project description
lide-python — Image Enhancement Library
Python port of peune/lide (C++), which accompanies the paper:
Image enhancement using local intensity distribution equalization https://jivp-eurasipjournals.springeropen.com/articles/10.1186/s13640-015-0085-2
Also includes Pixel Sorting (PS1/PS2) from:
Image enhancement by pixels sorting Sanparith Marukatat and Pichid Kittisuwan https://ieeexplore.ieee.org/document/8619964
Install
pip install lide
Or directly from GitHub:
pip install git+https://github.com/peune/lide-python.git
Methods
| ID | Name | Description |
|---|---|---|
| 0 | HE | Standard Histogram Equalization |
| 1 | AHE | Adaptive Histogram Equalization (CLAHE-style clipping) |
| 2 | DHE | Dynamic Histogram Equalization |
| 3 | MHE | Multi-interval Histogram Equalization |
| 4 | ESIHE | Exposure-based Sub-Image HE |
| 5 | BPHEME | Brightness-Preserving HE using Mean |
| 6 | FHSABP | Flattest Histogram Spec. with Adaptive Brightness Preservation |
| 7 | HEGMM | HE using Gaussian Mixture Model |
| 8 | LIDEG | LIDE simple – Gaussian model |
| 9 | LIDEL | LIDE simple – Laplacian model |
| 10 | LIDEGMM | LIDE mixture – Gaussian model |
| 11 | LIDELMM | LIDE mixture – Laplacian model |
| 12 | PS1 | Pixel Sorting variant 1 |
| 13 | PS2 | Pixel Sorting variant 2 |
Python API
import cv2
from lide import color_enhance, EnhanceParam, ENHANCE_LIDEG, ENHANCE_HE
img = cv2.imread("input.jpg") # BGR uint8
# Standard histogram equalization
param = EnhanceParam(method=ENHANCE_HE)
out = color_enhance(img, param)
cv2.imwrite("out_he.jpg", out)
# LIDE (Gaussian, local window 100px)
param = EnhanceParam(method=ENHANCE_LIDEG, d=100, lide_sigma_min=30.0)
out = color_enhance(img, param)
cv2.imwrite("out_lide.jpg", out)
Grayscale only
import cv2
from lide import enhance, EnhanceParam, ENHANCE_MHE
gray = cv2.imread("input.jpg", cv2.IMREAD_GRAYSCALE)
param = EnhanceParam(method=ENHANCE_MHE, mhe_mmin=5, mhe_mmax=10)
out = enhance(gray, param)
cv2.imwrite("out_mhe.jpg", out)
Command-line
lide -in input.jpg -out output.jpg -method 8
lide -in input.jpg -out output.jpg -method 1 -AHE:clipping 0.03 -ALL:d 50
lide -in input.jpg -out output.jpg -method 13 -PS:wei 5.0
Run lide --help for all options.
Dependencies
- numpy >= 1.24
- opencv-python >= 4.7
- scipy >= 1.10
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file lide-1.0.0.tar.gz.
File metadata
- Download URL: lide-1.0.0.tar.gz
- Upload date:
- Size: 17.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9ecd8b2c56ddc429b1548c4a26b2be0d4dec3f17d75c8ae8e12179f5e093ab42
|
|
| MD5 |
691cc0482782846b1deb407c5e77bdcb
|
|
| BLAKE2b-256 |
e7d82e35de2aa263c936a9586df01f90f5b8839273ef67dbff9e03c4a166654d
|
File details
Details for the file lide-1.0.0-py3-none-any.whl.
File metadata
- Download URL: lide-1.0.0-py3-none-any.whl
- Upload date:
- Size: 22.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6ca8747caa82aa3b1d50448673ea54bd3ec834abe1c7ab76a804b15fc114e550
|
|
| MD5 |
8ac28834921055ac313818066b53a032
|
|
| BLAKE2b-256 |
694ac8c30e7d96c073dba3aca5c70446396a7728d11a6338d34588c3bd7dbc69
|