对图像pad+resize
AI-generated summary
This code is for resizing and padding an image using the OpenCV library in Python. It calculates the scale ratio based on the desired width and height, resizes the image accordingly, and then creates a new canvas to place the resized image in the center. It also calculates the transformation matrix for converting coordinates between the original and target coordinate systems. The code then reads an image file, applies the resizing and padding function, and displays the result.