我只想垂直翻转图像cv2.flip(),但不输出任何图像。我的错误在哪里?
import cv2
import numpy as np
def flipv(imgg):
for i in range(480):
img2= np.zeros([480, 640, 3], np.uint8)
img2[i,:]=imgg[480-i-1,:]
return img2
img = cv2.imread("foto\\test.jpg", 1)
ads= flipv(img)
cv2.imshow("qw",ads)
cv2.waitKey(0)
cv2.destroyAllWindows()
Run Code Online (Sandbox Code Playgroud)