700字范文,内容丰富有趣,生活中的好帮手!
700字范文 > Jetson TX2板载摄像头(一)

Jetson TX2板载摄像头(一)

时间:2019-08-31 17:17:24

相关推荐

Jetson TX2板载摄像头(一)

一、参考资料

How to Capture and Display Camera Video with Python on Jetson TX2

tegra-cam.py

gstreamer基础教程

英伟达Jetson TX2 /NX/AGX上使用 Python 硬解码网络相机h264视频流

二、板载摄像头相关信息

tx2@tx2:~/Desktop$ python tele_gram.py Called with args:Namespace(image_height=1080, image_width=1920, rtsp_latency=200, rtsp_uri=None, use_rtsp=False, use_usb=False, video_dev=1)OpenCV version: 4.4.0GST_ARGUS: Creating output streamCONSUMER: Waiting until producer is connected...GST_ARGUS: Available Sensor modes :GST_ARGUS: 2592 x 1944 FR = 29.999999 fps Duration = 33333334 ; Analog Gain range min 1.000000, max 16.000000; Exposure Range min 34000, max 550385000;GST_ARGUS: 2592 x 1458 FR = 29.999999 fps Duration = 33333334 ; Analog Gain range min 1.000000, max 16.000000; Exposure Range min 34000, max 550385000;GST_ARGUS: 1280 x 720 FR = 120.000005 fps Duration = 8333333 ; Analog Gain range min 1.000000, max 16.000000; Exposure Range min 22000, max 358733000;GST_ARGUS: Running with following settings:Camera index = 0 Camera mode = 1 Output Stream W = 2592 H = 1458 seconds to Run = 0 Frame Rate = 29.999999 GST_ARGUS: Setup Complete, Starting captures for 0 secondsGST_ARGUS: Starting repeat capture requests.CONSUMER: Producer has connected; continuing.[ WARN:0] global /home/tx2/panbo/software/opencv-4.4.0/modules/videoio/src/cap_gstreamer.cpp (935) open OpenCV | GStreamer warning: Cannot query video position: status=0, value=-1, duration=-1Gtk-Message: 17:42:26.830: Failed to load module "canberra-gtk-module"GST_ARGUS: Cleaning upCONSUMER: Done SuccessGST_ARGUS: Done Success

三、打开板载摄像头

def open_cam_onboard(width, height):gst_elements = str(subprocess.check_output('gst-inspect-1.0'))if 'nvcamerasrc' in gst_elements:# On versions of L4T prior to 28.1, add 'flip-method=2' into gst_strgst_str = ('nvcamerasrc ! ''video/x-raw(memory:NVMM), ''width=(int)2592, height=(int)1458, ''format=(string)I420, framerate=(fraction)30/1 ! ''nvvidconv ! ''video/x-raw, width=(int){}, height=(int){}, ''format=(string)BGRx ! ''videoconvert ! appsink').format(width, height)elif 'nvarguscamerasrc' in gst_elements:gst_str = ('nvarguscamerasrc ! ''video/x-raw(memory:NVMM), ''width=(int)1920, height=(int)1080, ''format=(string)NV12, framerate=(fraction)30/1 ! ''nvvidconv flip-method=2 ! ''video/x-raw, width=(int){}, height=(int){}, ''format=(string)BGRx ! ''videoconvert ! appsink').format(width, height)else:raise RuntimeError('onboard camera source not found!')return cv2.VideoCapture(gst_str, cv2.CAP_GSTREAMER)

参数解释:gst_str = ('nvarguscamerasrc ! ''video/x-raw(memory:NVMM), ''width=(int)1920, height=(int)1080, ''format=(string)NV12, framerate=(fraction)30/1 ! ''nvvidconv flip-method=2 ! ''video/x-raw, width=(int){}, height=(int){}, ''format=(string)BGRx ! ''videoconvert ! appsink').format(960, 640)return cv2.VideoCapture(gst_str, cv2.CAP_GSTREAMER)视频流:1920*1080 @30fps显示窗口:960*640

四、板载摄像头工具包

参考博客 Jetson TX2板载摄像头(二)

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。