Welcome to Jetson Orin NANO Developer Kit repository
01.Image reading
Image Reading
OpenCV (Open Source Computer Vision Library) is a library for computer vision and machine learning, which is widely used in image processing, video processing, machine vision, artificial intelligence and other fields.
1. Implementation Principle
Use the cv2.imread() function to read the image file, and the cv2.imshow() function to display the image.
2. Implementation Effect
xxxxxxxxxxcd ~/opencv
xxxxxxxxxxpython3 01.image_read.py
Note: click the image window and press any key to exit.

3. Implementation Code
import cv2def read_image(file_path):image = cv2.imread(file_path)if image is None:print("Error: Unable to open image file.")else:cv2.imshow('Image Preview', image)cv2.waitKey(0)cv2.destroyAllWindows()read_image('/home/jetson/opencv/images/yahboom_logo.png')