diff --git a/conf.json b/conf.json index 95b99a0ffa21546234029fc577ddf06ca49e165d..1b04fb2ebb59a695a6d23b1fbe89c3f2dbb74a91 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 a66be9fd6a2ec740cdaa92b19f7acb396b60471c..c89c97612b1c72c92025f27519c06a036481e09f 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 9c7b9d1eb1a90f7e8a5df35a806602645af641f5..fd18f541bd19331aa5278860330127f4acf44046 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 &