Python | cv2 imshow() Method

In this tutorial, we will see how to display an image as an output using python by the use of open-cv which is exist as cv2 (computer vision) library.

We can use imshow() method of cv2 library to display an image in a window. In order to use cv2 library, we need to import cv2 library using import statement.

Now let’s see the syntax and return value of cv2 imshow() method, then we will move on the examples.

💻 Awesome Tech Resources:
  • Looking for ⚒️ tech jobs? Go to our job portal.
  • Looking for tech events? Go to tech events 🗓️ Calendar.️



You need to pass two parameters to imwrite() method. Parameters are:
1) win_name: Name of the window in which the image will be displayed.
2) image: Image pixel matrix of that image, which will need to be shown.

Return Value


Return value

Let’s see the python code :

Output :


As you can see, a window is opened to display the image. Window size is dependent on size of the image. If window size is greater than screen resolution, then it displays scaled version of the image.

Related Posts

Leave a Reply

Your email address will not be published. Required fields are marked *

Subscribe to our newletter

Get quality tutorials to your inbox. Subscribe now.