
OpenCV 3 Computer Vision Application Programming Cookbook
By :

Images often need to be resized (resampled). The process of reducing the size of an image is often called downsampling, while increasing its size is upsampling. The challenge in performing these operations is to ensure that the visual quality of the image is preserved as much as possible. To accomplish this objective, low-pass filters are often used; this recipe explains why.
You might think that you can reduce the size of an image by simply eliminating some of the columns and rows of the image. Unfortunately, the resulting image will not look very nice. The following figure illustrates this fact by showing you a test image that is reduced by a factor of 4
with respect to its original size by simply keeping 1
of every 4
columns and rows.
Note that to make the defects in this image more apparent, we zoom in on the image by displaying it with pixels that are four times larger:
Clearly, one can see that the image quality has degraded. For example...
Change the font size
Change margin width
Change background colour