Python OpenCV
About Lesson

In this Python OpenCV lesson we are going to learn about Python OpenCV Reading Image, basically in this lesson we want to learn how you can read an image in OpenCV.



Now let’s create our example.



This line of code is used for giving name of the window.



This is our image, make sure that you have already added an image in your working directory.



You can use imread() for reading the image .



After reading the image you need to show the image using imshow().



cv2.waitKey() is a keyboard binding function. Its argument is the time in milliseconds. The function waits specified milliseconds for any keyboard event. If you press any key in that time, the program continues. If 0 is passed, it waits indefinitely for a key stroke.




Run the complete code and this will be the result.

Python OpenCV Reading Image
Python OpenCV Reading Image