(img,None,fx=2,fy=0.5)#图像缩放
print("o.shape=",o.shape)
print("rst.shape=",rst.shape)
cv2.imshow("result...",rst)
cv2.waitKey(0)
o.shape= (460, 460, 3)
rst.shape= (230, 920, 3)
-1
算法:图像缩放是对图像大小进行调整的过程。...图像缩放是在处理效率以及平滑度和清晰度上做权衡。...dst=cv2.resize(src, dsize[, fx[, fy[, interpolation]]])
src表示输入图像
dsize表示输出图像大小
fx表示水平方向上(x轴方向)缩放比
fy...), round(fy*src.rows))
注意:参数dsize中第1个参数对应缩放后图像宽度(width,即列数cols,与参数fx相关),第2个参数对应缩放后图像高度(height,即行数rows