Skip to main content

A Python implementation of https://doi.org/10.1007/s41095-021-0232-x

Project description

This repository features an implementation of the algorithm proposed in "Low and non-uniform illumination color image enhancement using weighted guided image filtering" by Mu, Q., Wang, X., Wei, Y. et al. (2021)

Installation

pip install illumination_using_wgif

Usage

from PIL import Image
from illumination_using_wgif import illuminate

# load_image
image = Image.open("./<YOUR_IMAGE_HERE>")

rgb_image_data = np.reshape(image.getdata(), (image.size[1], image.size[0], 3))
greyscale_image_data = np.reshape(image.convert('L').getdata(), (image.size[1], image.size[0]))

# greyscale
illuminated_greyscale_data = illuminate(rgb_image_data)
# or: illuminated_greyscale_data = illuminate(greyscale_image_data)
illuminated_greyscale = Image.fromarray(illuminated_greyscale_data)

# linear color restoration
illuminated_linear_data = illuminate(rgb_image_data, 'linear')
illuminated_linear = Image.fromarray(illuminated_linear_data)

# hls color restoration
illuminated_hls_data = illuminate(rgb_image_data, 'hls')
illuminated_hls = Image.fromarray(illuminated_hls_data)

Github

For more info see https://github.com/muelphil/illumination_using_wgif

Notes

The color restoration is terribly slow as of now, could be optimized

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

illumination_using_wgif-0.1.0.tar.gz (10.2 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page