diff --git a/opencv/opencv_composite_stereo.py b/opencv/opencv_composite_stereo.py index 254715d..2476335 100755 --- a/opencv/opencv_composite_stereo.py +++ b/opencv/opencv_composite_stereo.py @@ -18,15 +18,17 @@ # GStreamer string, may be possible to optimize this further? gst_string = ''' -nvarguscamerasrc sensor-id=0 wbmode=0 aelock=true ispdigitalgainrange=\"1 8\" gainrange=\"1 48\" name=left -nvarguscamerasrc sensor-id=1 wbmode=0 aelock=true ispdigitalgainrange=\"1 8\" gainrange=\"1 48\" name=right +nvarguscamerasrc sensor-id=0 wbmode=1 ispdigitalgainrange=\"1 8\" gainrange=\"1 48\" tnr-mode=0 exposuretimerange="2000 20000000" saturation=1.3 name=left +nvarguscamerasrc sensor-id=1 wbmode=1 ispdigitalgainrange=\"1 8\" gainrange=\"1 48\" tnr-mode=0 exposuretimerange="2000 20000000" saturation=1.3 name=right glstereomix name=mix -left. ! video/x-raw(memory:NVMM),width={image_size[1]},height={image_size[0]},framerate={framerate}/1 ! nvvidconv ! video/x-raw ! glupload ! mix. +left. ! video/x-raw(memory:NVMM),width={image_size[1]},height={image_size[0]},framerate={framerate}/1 ! nvvidconv ! video/x-raw ! glupload ! mix. right. ! video/x-raw(memory:NVMM),width={image_size[1]},height={image_size[0]},framerate={framerate}/1 ! nvvidconv ! video/x-raw ! glupload ! mix. -mix. ! video/x-raw(memory:GLMemory),multiview-mode=side-by-side ! glcolorconvert ! gldownload ! - queue ! video/x-raw,format=BGRx ! videoconvert ! video/x-raw,format=BGR ! appsink' +mix. ! video/x-raw(memory:GLMemory),multiview-mode=side-by-side ! glcolorconvert ! gldownload ! + queue ! video/x-raw,format=BGRx ! videoconvert ! video/x-raw,format=BGR ! appsink' ''' +# ! glcolorbalance constrast=0.1 brightness=0.2 saturation=1.2 + gst_string = gst_string.format(image_size=image_size, framerate=framerate) print(gst_string) diff --git a/opencv/opencv_sobel.py b/opencv/opencv_sobel.py index 79feeef..4eb6d91 100755 --- a/opencv/opencv_sobel.py +++ b/opencv/opencv_sobel.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # # Sample script which uses OpenCV to read images from one camera, # then runs some basic image processing ... Gaussian blue and Sobel edges. @@ -17,7 +17,7 @@ framerate = 10 # GStreamer string, may be possible to optimize this further? - gst_string = f"nvarguscamerasrc sensor-id={camera_num} ! video/x-raw(memory:NVMM),width={image_size[1]},height={image_size[0]},framerate={framerate}/1 ! nvvidconv ! queue ! video/x-raw,pixel-format=(string)BGR ! videoconvert ! video/x-raw,pixel-format=(string)BGR ! appsink" + gst_string = f'nvarguscamerasrc sensor-id={camera_num} wbmode=0 aelock=true ispdigitalgainrange="1 8" gainrange="1 48" exposuretimerange="35000 100000000" ! video/x-raw(memory:NVMM),width={image_size[1]},height={image_size[0]},framerate={framerate}/1 ! nvvidconv ! queue ! video/x-raw,pixel-format=(string)BGR ! gamma gamma=0.7 ! videobalance brightness=0.2 ! videoconvert ! video/x-raw,pixel-format=(string)BGR ! appsink' print(f"Using GStreamer configuration: {gst_string}")