Book Image

Python Image Processing Cookbook

By : Sandipan Dey
Book Image

Python Image Processing Cookbook

By: Sandipan Dey

Overview of this book

With the advancements in wireless devices and mobile technology, there's increasing demand for people with digital image processing skills in order to extract useful information from the ever-growing volume of images. This book provides comprehensive coverage of the relevant tools and algorithms, and guides you through analysis and visualization for image processing. With the help of over 60 cutting-edge recipes, you'll address common challenges in image processing and learn how to perform complex tasks such as object detection, image segmentation, and image reconstruction using large hybrid datasets. Dedicated sections will also take you through implementing various image enhancement and image restoration techniques, such as cartooning, gradient blending, and sparse dictionary learning. As you advance, you'll get to grips with face morphing and image segmentation techniques. With an emphasis on practical solutions, this book will help you apply deep learning techniques such as transfer learning and fine-tuning to solve real-world problems. By the end of this book, you'll be proficient in utilizing the capabilities of the Python ecosystem to implement various image processing techniques effectively.
Table of Contents (11 chapters)

Face morphing

The goal of image/face morphing is to find the average of two objects/faces in the images. It is not an average of two images of objects (faces); rather, it is an image of the average object (face). The very first idea that might come to mind is a two-step process:

  1. Globally align two face images (warping with an affine transformation).
  2. Cross-dissolve (a linear combination of the images with alpha-blending) to create the output image.

But this often does not work. We can again resort to (local) feature matching. For example, to do face morphing, the matching can take place between keypoints such as nose to nose, eye to eye, and so on—this is a local (non-parametric) warp.

Here are the steps of the face morphing implementation with the mesh-warping algorithm:

  1. Defining correspondences: The face morphing algorithm transforms the source face into the target...