Welcome to Jetson ORIN NANO SUPER repository
当製品の日本語版マニュアル資料は、こちらからご取得ください。
18.Preview CSI camera image
Preview CSI camera image
1. Implementation principle
Use the CSICamera() function to capture the image from the CSI camera.
2. Implementation effect
cd ~/opencv
xxxxxxxxxxpython3 18.camera_preview_csi.py # The program opens video0 by default, open other cameras and modify the device number by yourself
Note: Select the camera image and press q to exit the program!

3. Implementation code
ximport cv2from jetcam.csi_camera import CSICameradef preview_usb_camera():cap = CSICamera(capture_device=0, width=640, height=480)while True:frame = cap.read()if frame is not None:cv2.imshow('CSI Camera Preview', cv2.resize(frame, (640, 480)))if cv2.waitKey(1) & 0xFF == ord('q'):breakelse:print("Error: Could not open CSI camera.")breakcap.release()cv2.destroyAllWindows()preview_usb_camera()