0% found this document useful (0 votes)
62 views

Project Report On Automatically Correcting Exposure of Image

The document describes a project to develop a Python program that can improve the quality of digital images affected by exposure issues such as underexposure and overexposure. The proposed methodology uses the LAB colour space to separate luminance and color channels, calculate a scaling factor, and apply it to the luminance channel to correct exposure. The program demonstrates improving quality of images with exposure problems.

Uploaded by

Avadhoot
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
62 views

Project Report On Automatically Correcting Exposure of Image

The document describes a project to develop a Python program that can improve the quality of digital images affected by exposure issues such as underexposure and overexposure. The proposed methodology uses the LAB colour space to separate luminance and color channels, calculate a scaling factor, and apply it to the luminance channel to correct exposure. The program demonstrates improving quality of images with exposure problems.

Uploaded by

Avadhoot
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

A Course Project Report On

Automatically Correcting Exposure of Image


Submitted as a part of Term work for subject
Semester VI
SUBJECT: DIGITAL IMAGE PROCESSING AMD MACHINE VISION
By
RUTIK RAJESH BHISE (Roll NO. 04)
SANCHIT SUBHASH DESAI (ROLL NO 10)
AVADHOOT KIRAN JOSHI (ROLL NO 19)
PRATHAMESH SATISH SHINDE (R0LL NO 62)

FACULTY IN-CHARGE
DR. SHARADA CHOUGULE

Department of Electronics and Telecommunication


Engineering
Hope Foundation’s
Finolex Academy of Management & Technology,
Ratnagiri Academic Year 2022-23

1
ABSTRACT
The Automatic Correction of Underexposed and Overexposed Images project aims to develop a
Python program that can improve the quality of digital images affected by exposure issues. The
proposed methodology uses the LAB colour space to separate the luminance and colour
components of the image, calculate the scaling factor, and apply it to the luminance channel to
correct the exposure. The program has practical applications in the field of photography and
image processing. The project can be further advanced by implementing deep learning
algorithms to automatically detect underexposed and overexposed images and apply the
correction algorithm. The program has been tested and demonstrated its ability to improve the
quality of digital images.

2
INTRODUCTION
Digital images are often affected by exposure issues such as underexposure and overexposure,
which can result in poor image quality. Underexposed images appear dark and lack detail, while
overexposed images appear bright and may have washed-out colours. In this project, we aim to
develop a Python program that can automatically correct the exposure of underexposed and
overexposed images to improve their quality.

Exposure is the total amount of light falling on a photographic medium when capturing an
image. Improper exposure will inevitably reduce the quality of the acquired images, e.g.,
bringing contrast reduction. Thus, how to assess exposure levels of image and to correct
ill-exposed images are of paramount importance in the research area of multimedia.

METHODOLOGY
The proposed methodology involves the use of the LAB colour space to correct the exposure of
the image. The LAB colour space separates the luminance, A, and B components of the image.
The luminance component, L, represents the brightness of the image, while the A and B
components represent the colour information. We calculate the average luminance value of the
image and compute the target luminance value, which is set to 128. We then compute the scaling
factor by dividing the target luminance value by the average luminance value, and apply this
scaling factor to the luminance channel using the `cv2.convertScaleAbs` function. Finally, we
merge the LAB channels back into a single image, convert it back to the BGR colour space, and
display the output image.

3
CODE
import cv2
import numpy as np
import matplotlib.pyplot as plt

# Load the image


img = cv2.imread('input_image.jpg')

# Convert the image to LAB color space


lab_img = cv2.cvtColor(img, cv2.COLOR_BGR2LAB)

# Split the LAB image into its channels


L, A, B = cv2.split(lab_img)

# Compute the average luminance value


avg_luminance = L.mean()

# Calculate the target luminance value


target_luminance = 128

# Compute the scaling factor


scale = target_luminance / avg_luminance

# Apply the scaling factor to the luminance channel


L = cv2.convertScaleAbs(L, alpha=scale, beta=0)

# Merge the LAB channels back into a single image


lab_img = cv2.merge((L, A, B))

# Convert the LAB image back to the BGR color space


output_img = cv2.cvtColor(lab_img, cv2.COLOR_LAB2BGR)

# Convert the BGR image to RGB format


output_img = cv2.cvtColor(output_img, cv2.COLOR_BGR2RGB)

# Display the input and output images


fig, ax = plt.subplots(1, 2, figsize=(12, 6))
ax[0].imshow(cv2.cvtColor(img, cv2.COLOR_BGR2RGB))
ax[0].set_title('Input Image')
ax[1].imshow(output_img)
ax[1].set_title('Output Image')
plt.show()

4
RESULT

(a) Overexposed

(b) Underexposed

5
APPLICATION
The automatic correction of underexposed and overexposed images has many practical
applications, such as in the field of photography and image processing. This program can be
used to improve the quality of digital images that have been affected by exposure issues. This
project can be further advanced by implementing deep learning algorithms to automatically
detect underexposed and overexposed images and apply the correction algorithm.

CONCLUSION
In conclusion, we have developed a Python program that can automatically correct the exposure
of underexposed and overexposed images using the LAB colour space. The program has
demonstrated its ability to improve the quality of digital images affected by exposure issues. This
project has practical applications in the field of photography and image processing, and can be
further advanced.

You might also like