From d341f88f6d83226c913f785ea5b99ec68a2246a3 Mon Sep 17 00:00:00 2001 From: dronus <paul.geisler@web.de> Date: Tue, 10 Aug 2021 23:21:30 +0200 Subject: [PATCH] v1 show version, presumably. --- conf.json | 3 ++- linescan.py | 7 ++++--- run.sh | 4 +++- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/conf.json b/conf.json index 95b99a0..1b04fb2 100644 --- a/conf.json +++ b/conf.json @@ -1,7 +1,8 @@ { "camera_warmup_time": 2.5, "resolution": [640, 480], - "fps": 20, + "fps": 40, + "shutter_milliseconds":25, "contrast_limit":3.0, "threshold": 3, "bins":14, diff --git a/linescan.py b/linescan.py index a66be9f..c89c976 100755 --- a/linescan.py +++ b/linescan.py @@ -127,7 +127,8 @@ client = None camera = PiCamera() camera.resolution = tuple(conf["resolution"]) camera.framerate = conf["fps"] -camera.shutter_speed=1000000 +camera.exposure_mode='off' +camera.shutter_speed=conf["shutter_milliseconds"]*1000 rawCapture = PiRGBArray(camera, size=tuple(conf["resolution"])) # allow the camera to warmup, then initialize the average frame, last @@ -176,7 +177,7 @@ for f in camera.capture_continuous(rawCapture, format="bgr", use_video_port=True index=0 - for pixel in np.nditer(histogram[1:-1]): + for pixel in np.nditer(histogram[0:-conf['removed_top_bins']]): last_pixel=last_histogram[index] if pixel>=threshold and last_pixel<threshold: @@ -197,7 +198,7 @@ for f in camera.capture_continuous(rawCapture, format="bgr", use_video_port=True cv2.imshow("Security Feed", crop_frame) - cv2.imshow("Security Feed 2", histogram) + #cv2.imshow("Security Feed 2", histogram) key = cv2.waitKey(1) & 0xFF # if the `q` key is pressed, break from the lop diff --git a/run.sh b/run.sh index 9c7b9d1..fd18f54 100755 --- a/run.sh +++ b/run.sh @@ -2,7 +2,7 @@ cd `dirname $0` -export DISPLAY=:0 +export DISPLAY=:0.0 @@ -11,3 +11,5 @@ startBristol -mini -voices 6 & sleep 5 qjackctl & +sleep 5 +/usr/bin/calfjackhost --load calf_setup_for301 & -- GitLab