上QQ阅读APP看书,第一时间看更新
How it works...
We can play with interpolation mode in cv2.resize—it defines how values between pixels are computed. There are quite a few types of interpolation, each with a different outcome. This argument can be passed as the last one and doesn't influence the result's size—only the quality and smoothness of the output.
By default, bilinear interpolation (cv2.INTER_LINEAR) is used. But in some situations, it may be necessary to apply other, more complicated options.
The cv2.flip function is used for mirroring images. It doesn't change the size of an image, but rather swaps the pixels.