Topic: Zero-order hold interpolation is an image interpolation method that can be used to increase the dimensions of an image. It takes a  n_1*n_2 image and transforms it into a  en_1*en_2 one, where  e is an enlarge factor. This is achieved with the formula:

                                                         f_e(n_1,n_2)=f([\frac{n_1}{e}],[\frac{n_2}{e}]) .


Exercise: Create a Python script file and perform the following tasks:

  • Import OpenCV and NumPy libraries.
  • Create a function that takes as input an image and an enlarge factor and performs zero-order hold interpolation. Then, return the resized image. You can add any extra parameters you desire.
  • Read an image.
  • Apply zero-order hold interpolation to the image.
  • Finally, display the resized image.

Instructions and Material for solution: Click Image to download the exercise material.

Help (if needed): Click Pdf to download the exercise help.

Lecture for better understanding: https://icarus.csd.auth.gr/image-filtering-lecture/

This exercise was developed by C. Georgiadis.

————————————————————————————————————–

For the solutions to the exercises, please contact koroniioanna@csd.auth.gr