The cv2.imwrite()method is used to save an image to a specific path. The first
argument is the name of the file and the second is the variable pointing to the image
we want to save. Also, cv2.waitKey() can be used to detect specific keystrokes.
Let's test the usage of both the functions in the following code snippet: