1. Image scaling

1. Image scaling1.1. OpenCV image scaling1.2. Actual effect display1.3.matplotlib: Python's 2D plotting library.

1.1. OpenCV image scaling

cv2.resize(InputArray src, OutputArray dst, Size, fx, fy, interpolation)

Parameter meaning:

InputArray src: input image

OutputArray ds: output image

Size: output image size

fx, fy: scaling coefficients along the x-axis and y-axis

interpolation: interpolation method, you can choose INTER_NEAREST (nearest neighbor interpolation), INTER_LINEAR (bilinear interpolation (default setting)), INTER_AREA (resample using pixel area relationship), INTER_CUBIC (bicubic interpolation of 4x4 pixel neighborhood), INTER_LANCZOS4 (Lanczos interpolation of 8x8 pixel neighborhood)

Note:

  1. The output size format is (width, height)
  2. The default interpolation method is: bilinear interpolation

1.2. Actual effect display

Code path:

/home/pi/DOGZILLA_Lite_class/4.Open Source CV/B.Geometric_Transformations/01_Image_Scaling.ipynb

1.3.matplotlib: Python's 2D plotting library.

The following is a small example of matplotlib

Reference tutorial:https://www.runoob.com/numpy/numpy-matplotlib.html