If you are trying to display OpenCV image using matplotlib, use the code below.

import numpy as np
import cv2
import matplotlib.pyplot as plt
%matplotlib inline  # if you are running this code in Jupyter notebook

# reads image 'opencv-logo.png' as grayscale
img = cv2.imread('/path_to_image/opencv-logo.png', 0) 
plt.imshow(img, cmap='gray')
Answer from An unfinished seeker on Stack Overflow
๐ŸŒ
OpenCV
opencv.org โ€บ home โ€บ news โ€บ read, display and write an image using opencv
Read, Display and Write an Image using OpenCV
March 28, 2025 - When working with images in OpenCV, itโ€™s crucial to understand that OpenCV reads and processes color images in BGR (Blue-Green-Red) format rather than the more commonly used RGB (Red-Green-Blue) format used by most other computer vision libraries, such as Matplotlib, PIL (Pillow), TensorFlow, and PyTorch.
๐ŸŒ
GeeksforGeeks
geeksforgeeks.org โ€บ reading-image-opencv-using-python
Reading an image in OpenCV using Python - GeeksforGeeks
August 12, 2024 - Example #1 (Using OpenCV) : ... # Python code to read image import cv2 # To read image from disk, we use # cv2.imread function, in below method, img = cv2.imread("geeksforgeeks.png", cv2.IMREAD_COLOR) # Creating GUI window to display an image ...
๐ŸŒ
LearnOpenCV
learnopencv.com โ€บ home โ€บ image processing โ€บ reading and writing videos using opencv
Reading and Writing Videos using OpenCV | LearnOpenCV
October 15, 2025 - A video is nothing but a series of images that are often referred to as frames. So, all you need to do is loop over all the frames in a video sequence, and then process one frame at a time.
๐ŸŒ
GeeksforGeeks
geeksforgeeks.org โ€บ python โ€บ reading-image-opencv-using-python
Reading and Displaying Images in Python using OpenCV - GeeksforGeeks
November 11, 2025 - OpenCV provides functions like cv2.imread() and cv2.imshow() that make it easy to load images from files and display them in a window.
๐ŸŒ
OpenCV
docs.opencv.org โ€บ 4.13.0 โ€บ d4 โ€บ da8 โ€บ group__imgcodecs.html
OpenCV: Image file reading and writing
The imread function loads an image from the specified file and returns OpenCV matrix. If the image cannot be read (because of a missing file, improper permissions, or unsupported/invalid format), the function returns an empty matrix.
๐ŸŒ
LearnOpenCV
learnopencv.com โ€บ home โ€บ image processing โ€บ read, display and write an image using opencv
Read, Display and Write an Image using OpenCV - LearnOpenCV
July 31, 2026 - Letโ€™s begin by importing the OpenCV library in Python and C++ (as shown below). ... In C++, use #include (as shown below) to accomplish the same. Also specifying the namespaces for it lets you refer to function names directly. No need to prepend them with the namespace (e.g. instead of cv::imread(), you can just directly use read()).
๐ŸŒ
TutorialsPoint
tutorialspoint.com โ€บ opencv โ€บ opencv_reading_images.htm
OpenCV - Reading Images
The read() method of the Imgcodecs class is used to read an image using OpenCV.
Find elsewhere
๐ŸŒ
GeeksforGeeks
geeksforgeeks.org โ€บ python-opencv-cv2-imread-method
cv2.imread() method - Python OpenCV - GeeksforGeeks
April 14, 2025 - OpenCV-Python is a Python library used to solve computer vision tasks. cv2.imread() method loads an image from the specified file. If the image cannot be read because of missing file, improper permissions or an unsupported/invalid format then ...
๐ŸŒ
Medium
medium.com โ€บ @sasaniperera โ€บ opencv-basics-of-reading-and-visualizing-images-6abab99effcf
OpenCV: Basics of Reading and Visualizing Images | by Sasani Perera | Medium
June 22, 2023 - #read the BGR image im = cv2.imread("C:\\Users\Public\Pictures\TestImage.jpg",1) #splitting the color channels b = im[:,:,0] g = im[:,:,1] r = im[:,:,2] #merging into RGB image im2 = cv2.merge([r,g,b]); ... To save the processed image, function cv2.imwrite() is used. #merging into RGB image im2 = cv2.merge([r,g,b]); #saving the image cv2.imwrite("ProcessedImage.jpg",im2) In the next article, we will discuss Image Masking with OpenCV.
๐ŸŒ
LearnOpenCV
learnopencv.com โ€บ home โ€บ read an image in opencv ( python, c++ )
Read an Image in OpenCV ( Python, C++ ) | LearnOpenCV
October 23, 2025 - OpenCV C++ and Python examples for reading images (imread). Load color or grayscale JPG, transparent PNG / TIFF, and 16-bit / channel images.
๐ŸŒ
Medium
medium.com โ€บ analytics-vidhya โ€บ read-image-using-cv2-imread-opencv-python-idiot-developer-4b7401e76c20
Read Image using cv2.imread() โ€” OpenCV Python โ€” Idiot Developer | by Nikhil Tomar | Analytics Vidhya | Medium
January 23, 2024 - To use OpenCV in Python install the following libraries: ... To install the above libraries, use the following command. ... Here, we are going to import all the required libraries. ... To read an image cv2.imread() function is used.
๐ŸŒ
OpenCV
docs.opencv.org โ€บ 3.4.20 โ€บ d8 โ€บ dfe โ€บ classcv_1_1VideoCapture.html
OpenCV: cv::VideoCapture Class Reference
The method/function combines VideoCapture::grab() and VideoCapture::retrieve() in one call. This is the most convenient method for reading video files or capturing data from decode and returns the just grabbed frame.
๐ŸŒ
OpenCV
docs.opencv.org โ€บ 4.13.0 โ€บ db โ€บ deb โ€บ tutorial_display_image.html
OpenCV: Getting Started with Images
As a first step, the OpenCV python library is imported. The proper way to do this is to additionally assign it the name cv, which is used in the following to reference the library. ... Now, let's analyze the main code. As a first step, we read the image "starry_night.jpg" from the OpenCV samples.
๐ŸŒ
Towards Data Science
towardsdatascience.com โ€บ home โ€บ data science โ€บ how to read images, video, webcam and screen in opencv - image analysis for beginners
How to read images, video, webcam and screen in OpenCV - image analysis for beginners | Towards Data Science
January 14, 2022 - Next we go about "filming" our screen. We can use this for analyzing the images we see on the screen (we'll get into this later). Lastly we'll start reading images from our webcam and from a video file. First we import OpenCV on line 1 (cv2 is OpenCV's module name in the Python implementation).
๐ŸŒ
TutorialKart
tutorialkart.com โ€บ opencv โ€บ python โ€บ opencv-python-read-display-image
Read and Display an Image using OpenCV in Python
June 29, 2026 - In this OpenCV Python tutorial, you will learn how to read an image from disk with cv2.imread() and display it in a window with cv2.imshow().
๐ŸŒ
LearnOpenCV
learnopencv.com โ€บ home โ€บ read, write and display a video using opencv
Read, Write and Display a video using OpenCV | LearnOpenCV
July 31, 2026 - In OpenCV, a video can be read either by using the feed from a camera connected to a computer or by reading a video file. The first step towards reading a video file is to create a VideoCapture object.
๐ŸŒ
OpenCV
opencv.org โ€บ home โ€บ news โ€บ reading and writing videos using opencv
Reading and Writing Videos using OpenCV
March 28, 2025 - Reading a video file requires processing each frame individually, and displaying or storing it. OpenCV provides the VideoCapture() function.
๐ŸŒ
Jmgphd
jmgphd.com โ€บ courses โ€บ csc5930 โ€บ lecture-notes โ€บ opencv-images
Opening and Displaying Images with OpenCV โ€“ Jason M. Grant
Use OpenCVโ€™s imread function to read in an image from a file. You can visit this page to see all of the supported image types. Images are stored in NumPy arrays, so all NumPy array operations are available when using the OpenCV library. OpenCV supports several options for reading in images, ...