I’m working with the ArduCAM B0449, on a Jetson Orin Nano, which works perfectly running it with gst-launch-1.0 nvarguscamerasrc, but when I try to use it with opencv it doesn’t give me a clear image.
this is mi code:
import cv2
cap = cv2.VideoCapture(0)
cap.set(cv2.CAP_PROP_FOURCC, cv2.VideoWriter_fourcc(*‘RG10’))
#[0]: ‘RG10’ (10-bit Bayer RGRG/GBGB)
cv2.namedWindow(‘Frame’, cv2.WINDOW_NORMAL)
cv2.resizeWindow(‘Frame’,640,480)
if not cap.isOpened():
print(“Error al abrir la cámara”)
exit()
while True:
ret, frame = cap.read()
if not ret:
print(“Error al leer el frame”)
break
cv2.imshow('Frame', frame)
if cv2.waitKey(1) & 0xFF == ord('q'):
break
cap.release()
cv2.destroyAllWindows()
and my result is:
whith print(cv2.getBuildInformation()) I get:
Video I/O:
FFMPEG: YES
avcodec: YES (58.134.100)
avformat: YES (58.76.100)
avutil: YES (56.70.100)
swscale: YES (5.9.100)
avresample: NO
GStreamer: YES (1.20.3)
v4l/v4l2: YES (linux/videodev2.h)
How to improve the image to use OpenCV with this camera?
Dion
March 27, 2025, 6:32am
2
Hi,
You might not be able to skip gstreamer to capture the image data from the CSI camera. I’ve attached some Python demos for your review:
# MIT License
# Copyright (c) 2019 JetsonHacks
# See license
# Using a CSI camera (such as the Raspberry Pi Version 2) connected to a
# NVIDIA Jetson Nano Developer Kit using OpenCV
# Drivers for the camera and OpenCV are included in the base image
import cv2
import time
try:
from Queue import Queue
except ModuleNotFoundError:
from queue import Queue
import threading
import signal
import sys
# def signal_handler(sig, frame):
This file has been truncated. show original
# MIT License
# Copyright (c) 2019-2022 JetsonHacks
# Using a CSI camera (such as the Raspberry Pi Version 2) connected to a
# NVIDIA Jetson Nano Developer Kit using OpenCV
# Drivers for the camera and OpenCV are included in the base image
import cv2
"""
gstreamer_pipeline returns a GStreamer pipeline for capturing from the CSI camera
Flip the image by setting the flip_method (most common values: 0 and 2)
display_width and display_height determine the size of each camera pane in the window on the screen
Default 1920x1080 displayd in a 1/4 size window
"""
def gstreamer_pipeline(
sensor_id=0,
capture_width=1920,
capture_height=1080,
This file has been truncated. show original
it works with simple_camera.py
thanks