Aug-27-2019, 12:30 PM
The cv2.imwrite("who.jpg", img) is inside the loop, so every img shown on the screen
is written into that filename. I don´t think that is what you want and i assume the code can´t write that fast.
In addition cv2.imwrite() returns an integer, if i´m not wrong 0 means ok, 1 means error.
Untested and only an idea:
is written into that filename. I don´t think that is what you want and i assume the code can´t write that fast.
In addition cv2.imwrite() returns an integer, if i´m not wrong 0 means ok, 1 means error.
Untested and only an idea:
# Display the resulting frame img = cv2.imshow('Server Room', frame) if cv2.waitKey(1) & 0xFF == ord('q'): break if cv2.waitKey(1) & 0xFF == ord('p'): err = cv2.imwrite("who.jpg", img) print(error) breakShould save an image if you press p key and then quit.