In this article, a few image processing/computer vision problems and their solutions with python libraries (scikit-image, PIL, opencv-python) will be discussed. Some of the problems are from the exercises from this book (available on Amazon). Here is the GitHub repository with the codes from the book and my blog on WordPress and a playlist on youtube. Also, here is the github repository of the codes for my new book (available on Amazon).

Wave Transform

  1. Use scikit-image’s warp() function to implement the _wave _transform.
  2. Note that wave transform can be expressed with the following equations:

Image for post

We shall use the mandrill image to implement the wave transform. The next python code fragment shows how to do it:

**from** skimage.io **import** imread

**from** skimage.transform **import** warp

**import** matplotlib.pylab as plt

**def** wave(xy):

xy[:, 1] **+=** 20*****np.sin(2*****np.pi*****xy[:, 0]**/**64)

**return** xy

im **=** imread('images/mandrill.jpg')

im **=** warp(im, wave)

plt.imshow(im)

plt.show()

The next figure shows the original mandrill input image and the output image obtained after applying the wave transform.

Image for post

Image for post

2. Swirl Transform

  1. Use scikit-image’s warp() function to implement the swirl transform.
  2. Note that swirl transform can be expressed with the following equations

Image for post

We shall use the mandrill image to implement the wave transform. The next python code fragment shows how to do it:

#computer-vision #machine-learning #image-processing

Solving Some Image Processing,Computer Vision Problems With Python Libraries
3.05 GEEK