Questions
- Use the
scikit-image
library's functions to read a collection of images and display them as a montage. - Use the
scipy ndimage
andmisc
modules' functions to zoom, crop, resize, and apply Affine transformation to an image. - Create a Python remake of the Gotham Instagram filter (https://github.com/lukexyz/CV-Instagram-Filters) (hint: manipulate an image with the PIL
split()
,merge()
, andnumpy interp()
functions to create a channel interpolation (https://www.youtube.com/watch?v=otLGDpBglEA&feature=player_embedded)). - Use scikit-image's
warp()
function to implement the swirl transform. Note that theswirl
transform can also be expressed with the following equations:
![](https://static.packt-cdn.com/products/9781789343731/graphics/d33c5e7a-4e8a-483b-885d-26e4275cba7b.png)
![](https://static.packt-cdn.com/products/9781789343731/graphics/2590e017-2e74-4f01-9a95-a136c2656c99.png)
![](https://static.packt-cdn.com/products/9781789343731/graphics/6264cc97-e76f-49ab-afee-e439250df128.png)
![](https://static.packt-cdn.com/products/9781789343731/graphics/00f4cb5b-66d7-4bf5-aad0-9a13ff84665c.png)
- Implement the wave transform (hint: use scikit-image's
warp()
)Â given by the following:
![](https://static.packt-cdn.com/products/9781789343731/graphics/471cfaa5-68f1-4274-b602-3e80364e79a3.png)
![](https://static.packt-cdn.com/products/9781789343731/graphics/9728a705-a40a-433d-93c8-51adb42f8382.png)
- Use PIL to load an RGB
.png
file with a palette and convert into a grayscale image. This problem is taken from this post:Â https://stackoverflow.com/questions/51676447/python-use-pil-to-load-png-file-gives-strange-results/51678271#51678271. Convert the following RGB image (from theVOC2012
dataset) into a grayscale image by indexing the palette:
![](https://static.packt-cdn.com/products/9781789343731/graphics/7afe9687-a9c0-45c5-a9ea-c5200b19a21d.png)
- Make a 3D plot for each of the color channels of the parrot image used in this chapter (hint: use theÂ
mpl_toolkits.mplot3d
module'splot_surface()
function and NumPy'smeshgrid()
function).
- Use scikit-image's
transform
module'sÂProjectiveTransform
to estimate the homography matrix from a source to a destination image and use theinverse()
function to embed the Lena image (or yours) in the blank canvas as shown in the following:
Input Image | Output Image |
![]() | ![]() |
First try to solve the problems on your own. For your reference, the solutions can be found here:Â https://sandipanweb.wordpress.com/2018/07/30/some-image-processing-problems/.