Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
OpenCV with Python By Example

You're reading from  OpenCV with Python By Example

Product type Book
Published in Sep 2015
Publisher Packt
ISBN-13 9781785283932
Pages 296 pages
Edition 1st Edition
Languages
Author (1):
Prateek Joshi Prateek Joshi
Profile icon Prateek Joshi

Table of Contents (19) Chapters

OpenCV with Python By Example
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Applying Geometric Transformations to Images Detecting Edges and Applying Image Filters Cartoonizing an Image Detecting and Tracking Different Body Parts Extracting Features from an Image Creating a Panoramic Image Seam Carving Detecting Shapes and Segmenting an Image Object Tracking Object Recognition Stereo Vision and 3D Reconstruction Augmented Reality Index

Enhancing the contrast in an image


Whenever we capture images in low-light conditions, the images turn out to be dark. This typically happens when you capture images in the evening or in a dimly lit room. You must have seen this happen many times! The reason this happens is because the pixel values tend to concentrate near 0 when we capture the images under such conditions. When this happens, a lot of details in the image are not clearly visible to the human eye. The human eye likes contrast, and so we need to adjust the contrast to make the image look nice and pleasant. A lot of cameras and photo applications implicitly do this already. We use a process called Histogram Equalization to achieve this.

To give an example, this is what it looks like before and after contrast enhancement:

As we can see here, the input image on the left is really dark. To rectify this, we need to adjust the pixel values so that they are spread across the entire spectrum of values, that is, between 0 and 255.

Following...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime}