- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to read an image in Python OpenCV?
To read an image in Python OpenCV, 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 img = cv2.imread("baseball.png", cv2.IMREAD_COLOR) cv2.imshow("baseball", img) cv2.waitKey(0) cv2.destroyAllWindows()
Output
- Related Articles
- OpenCV Python program to read and save an Image
- How to flip an image in OpenCV Python?
- How to mask an image in OpenCV Python?
- How to normalize an image in OpenCV Python?
- How to rotate an image in OpenCV Python?
- How to resize an image in OpenCV using Python?
- How to detect humans in an image in OpenCV Python?
- OpenCV Python – How to add borders to an image?
- How to blur faces in an image using OpenCV Python?
- How to detect eyes in an image using OpenCV Python?
- How to convert an RGB image to HSV image using OpenCV Python?
- Using OpenCV in Python to Cartoonize an Image
- How to draw an arrowed line on an image in OpenCV Python?
- OpenCV Python Program to blur an image?
- How to apply Affine Transformation on an image in OpenCV Python?

Advertisements