我正在尝试使用OpenCS和带有网络摄像头的视频进行进一步处理,但一直在获得Failed if statement
from cv2 import *
cam = cv2.VideoCapture(1)
s, img = cam.read()
if s:
nameWindow("cam-test", CV_WINDOW_AUTOSIZE)
ifshow('cam-test',img)
waitKey(0)
destroyWindow("cam-test")
imwrite("filename.jpg", img)
else:
print("Failed if statement")