O'Reilly logo

Mastering SciPy by Francisco J. Blanco-Silva

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Color

In color images, we have many different methods to store the underlying information. The most common method, the one that also provides the easiest computational structures for creating algorithms, is the RGB color space. In this method, an image representation contains at least three layers. For each pixel, we assess the combined information of the amounts of red, green, and blue necessary to achieve the desired color and intensity at the corresponding location. The first layer indicates the intensities of underlying reds. The second and third layers indicate, respectively, the intensities of greens and blues:

In [12]: from skimage.data import coffee
In [13]: coffee().shape
Out[13]: (400, 600, 3)
In [14]: coffee()
Out[14]:
array([[[ 21, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required