一、cv2.resize() 

import cv2
img = cv2.imread("image1.png")
print(img.shape)
dst = cv2.resize(img,(img.shape[1]//2,img.shape[0]//2),interpolation=cv2.INTER_CUBIC)
print(dst.shape)
cv2.imshow("dst",dst)
cv2.imshow("original",img)
cv2.waitKey(0)

cv2.resize()和imutil.resize()

 cv2.resize()和imutil.resize()

二、imutil.resize()

import cv2
import imutils
img = cv2.imread("image1.png")
print(img.shape)
dst = imutils.resize(img,width=img.shape[1]//2,height=img.shape[0]//2)
print(dst.shape)
cv2.imshow("dst",dst)
cv2.imshow("original",img)
cv2.waitKey(0)

效果同上.

相关文章:

  • 2021-04-28
  • 2021-06-01
  • 2021-05-18
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2023-03-18
  • 2021-06-19
猜你喜欢
  • 2021-06-02
  • 2022-12-23
  • 2021-10-11
  • 2021-06-07
  • 2021-11-14
  • 2021-11-30
  • 2021-05-09
相关资源
相似解决方案