Coders Packet

Change Brightness of Images using C++ and OpenCV Library

By Shubham Saxena

A C++ Project to increase or decrease the brightness of the image at the pixel level using OpenCV.

A C++ project to change the brightness of the images.

INTRODUCTION:

This packet can be used to increase or decrease the intensity of brightness in images. This project is based on C++ and OpenCV library. 

ABOUT:

To change the brightness of the image, the value of every pixel in the image should be increased/decreased by a suitable number.

The range of each pixel of the image should lie between 0 and 255.

If the brightness of the image has to be increased, one has to add some positive value to each pixel of the image, keeping this in mind that it should not exceed the maximum permissible limit of the pixel, that is 255 if it is exceeding then set the value of that particular pixel to 255.

If the brightness of the image has to be decreased, one has to subtract some positive value from each pixel of the image, keeping this in mind that it should not cross the minimum permissible limit of the pixel, that is 0 if it is crossing the limit then set the value of that particular pixel to 0.

In this project, I have increased and decreases the brightness of the image by 50, You can choose any desired value, just make sure of maximum and minimum permissible limits of pixels.

REQUIREMENTS:

1. System should have OpenCV installed.
2. System should have GCC installed.
3. Any IDE (preferably Xcode or Visual Studio as setup of OpenCV will be easier in these)
4. Developer must give the correct path of the image that has to be processed.


CONCLUSION:

The output shows the original image and the image with the increased and decreased brightness.
Thanks & Happy Coding :)

Download Complete Code

Comments

No comments yet