November 2018
Intermediate to advanced
492 pages
12h 19m
English
As we have already seen, this point transform (the transfer function is of the general form, s=T(r) = c.rγ, where c is a constant) on a grayscale image using the PIL point() function in the Chapter 1, Getting Started with Image Processing, let's apply power-law transform on a RGB color image with scikit-image this time, and then visualize the impact of the transform on the color channel histograms:
im = img_as_float(imread('../images/earthfromsky.jpg'))gamma = 5im1 = im**gammapylab.style.use('ggplot')pylab.figure(figsize=(15,5))pylab.subplot(121), plot_hist(im[...,0], im[...,1], im[...,2], 'histogram for RGB channels (input)')pylab.subplot(122), plot_hist(im1[...,0], im1[...,1], im1[...,2], 'histogram for RGB channels ...Read now
Unlock full access