Manipulating the exposure of an image
The exposure of an image tells us whether the image is too dark, too light, or balanced. It can be measured with a histogram of the intensity values of all pixels. Improving the exposure of an image is a basic image-editing operation. As we will see in this recipe, it can be done easily with scikit-image.
Getting ready
The scikit-image
command should be included by default in Anaconda. Otherwise, you can always install it manually with conda install scikit-image
.
How to do it...
- Let's import the packages:
>>> import numpy as np import matplotlib.pyplot as plt import skimage.exposure as skie %matplotlib inline
- We open an image with Matplotlib. We only take a single RGB component to have a grayscale image (it is a ...
Get IPython Interactive Computing and Visualization Cookbook - Second Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.