How can I display an image using cv2 in Python?

PythonMatplotlibServer Side ProgrammingProgramming

To read an image in Python cv2, we can take the following steps−

• Load an image from a file.
• Display the image in the specified window.
• Wait for a pressed key.
• Destroy all of the HighGUI windows.

Example

import cv2
cv2.destroyAllWindows()