April 2020
Intermediate to advanced
438 pages
12h 2m
English
There are many other uses of the Lab color space. For example, you can obtain a more natural inverted image in the Lab space since only the luminosity channel needs to be inverted, as demonstrated in the following code block:
im1 = rgb2lab(im)im1[...,0] = np.max(im1[...,0]) - im1[...,0]im1 = lab2rgb(im1)
If you run the preceding code and display the input image and the inverted images obtained in the RGB and the Lab space, you will get the following screenshot:

As you can see, the Inverted image in the Lab color space appears much more natural than the Inverted image in the RGB color space.
Read now
Unlock full access