Add script to set tiscamera for daylight

spacecruft
Jeff Moe 2022-08-23 19:45:08 -06:00
parent e689e978b0
commit 0698209935
2 changed files with 71 additions and 0 deletions

View File

@ -0,0 +1,71 @@
#!/bin/bash
# Set settings on The Imaging Source camera IMX174
# Set:
# 2x2 binning
# 10 fps
VIDNUM=`grep ^device_id configuration.ini | cut -f 2 -d "=" | sed -e 's/ //g'`
VIDDEV=/dev/video$VIDNUM
set -x
# I don't see where to set this in v4l2
arv-tool-0.8 control AcquisitionFrameRate=30
v4l2-ctl -d $VIDDEV -c brightness=240 # min=0 max=511 step=1 default=240
v4l2-ctl -d $VIDDEV -c gamma=150 # min=1 max=500 step=1 default=100
#v4l2-ctl -d $VIDDEV -c gain=120 # min=0 max=480 step=1 default=0
#v4l2-ctl -d $VIDDEV -c gain=200 # min=0 max=480 step=1 default=0
v4l2-ctl -d $VIDDEV -c gain=0 # min=0 max=480 step=1 default=0
#v4l2-ctl -d $VIDDEV -c gain=480 # min=0 max=480 step=1 default=0
v4l2-ctl -d $VIDDEV -c auto_exposure=1 # 1: Manual, 3: Aperture Priority, default=3
#v4l2-ctl -d $VIDDEV -c exposure_time_absolute=333 # min=20 max=30000000 step=1 default=333
#v4l2-ctl -d $VIDDEV -c exposure_time_absolute=100 # min=20 max=30000000 step=1 default=333
#v4l2-ctl -d $VIDDEV -c exposure_time_absolute=1000 # min=20 max=30000000 step=1 default=333
v4l2-ctl -d $VIDDEV -c exposure_time_absolute=4 # min=20 max=30000000 step=1 default=333
v4l2-ctl -d $VIDDEV -c auto_shutter=0 # bool, default=1
v4l2-ctl -d $VIDDEV -c auto_exposure_reference=128 # min=0 max=255 step=1 default=128
v4l2-ctl -d $VIDDEV -c gain_auto=0 # boot, default=1
v4l2-ctl -d $VIDDEV -c trigger_mode=0 # bool, default=0
#v4l2-ctl -d $VIDDEV -c software_trigger # flags=write-only
v4l2-ctl -d $VIDDEV -c strobe_enable=0 # bool, default=0
v4l2-ctl -d $VIDDEV -c strobe_polarity=0 # boot, default=0
v4l2-ctl -d $VIDDEV -c strobe_operation=1 # 0: Fixed Duration, 1: Exposure, default=1
v4l2-ctl -d $VIDDEV -c strobe_duration=100 # min=0 max=32767 step=1 default=100
v4l2-ctl -d $VIDDEV -c strobe_delay=0 # min=0 max=32767 step=1 default=0
v4l2-ctl -d $VIDDEV -c gpout=0 # bool, default=0
v4l2-ctl -d $VIDDEV -c gpin=0 # bool, default=0
v4l2-ctl -d $VIDDEV -c roi_offset_x=0 # min=0 max=1664 step=2 default=0
v4l2-ctl -d $VIDDEV -c roi_offset_y=0 # min=0 max=1196 step=2 default=0
v4l2-ctl -d $VIDDEV -c roi_auto_center=1 # bool, default=1
v4l2-ctl -d $VIDDEV -c trigger_polarity=0 # 0: Rising Edge, 1: Falling Edge, default=0
v4l2-ctl -d $VIDDEV -c trigger_exposure_mode=0 # 0: Frame Start, 1: Exposure Active, default=0
v4l2-ctl -d $VIDDEV -c trigger_burst_count=1 # min=1 max=1000 step=1 default=1
v4l2-ctl -d $VIDDEV -c trigger_debounce_time_us=0 # min=0 max=1000000 step=1 default=0 value=0
v4l2-ctl -d $VIDDEV -c trigger_mask_time_us=0 # min=0 max=1000000 step=1 default=0
v4l2-ctl -d $VIDDEV -c trigger_noise_suppression_time=0 # min=0 max=1000000 step=1 default=0
v4l2-ctl -d $VIDDEV -c auto_functions_roi_control=1 # bool, default=1
v4l2-ctl -d $VIDDEV -c auto_functions_roi_left=0 # min=0 max=1904 step=1 default=0
v4l2-ctl -d $VIDDEV -c auto_functions_roi_top=0 # min=0 max=1184 step=1 default=0
v4l2-ctl -d $VIDDEV -c auto_functions_roi_width=0 # min=16 max=1920 step=1 default=0
v4l2-ctl -d $VIDDEV -c auto_functions_roi_height=0 # min=16 max=1200 step=1 default=0
v4l2-ctl -d $VIDDEV -c flip_horizontal=0 # bool, default=0
v4l2-ctl -d $VIDDEV -c flip_vertical=0 # bool, default=0
v4l2-ctl -d $VIDDEV -c exposure_auto_upper_limit_auto=1 # bool, default=1
v4l2-ctl -d $VIDDEV -c exposure_auto_lower_limit_us=333 # min=20 max=1000000 step=1 default=333
v4l2-ctl -d $VIDDEV -c exposure_auto_upper_limit_us=333 # min=20 max=1000000 step=1 default=333
v4l2-ctl -d $VIDDEV -c override_scanning_mode=1 # min=1 max=16 step=1 default=1
v4l2-ctl -d $VIDDEV -c auto_functions_roi_preset=2 # 0: Full Sensor, 1: Custom Rectangle, 2: Center 50%, 3: Center 25%, 4: Bottom Half, 5: Top Half, default=2
v4l2-ctl -d $VIDDEV -c trigger_global_reset_release=0 # bool, default=0
v4l2-ctl -d $VIDDEV -c scanning_mode_selector=1 # min=1 max=16 step=1 default=1
v4l2-ctl -d $VIDDEV -c trigger_delay_100ns=0 # min=0 max=1000000 step=1 default=0
echo "XXX READ ONLY ? XXX"
v4l2-ctl -d $VIDDEV -c scanning_mode_identifier=1 # min=1 max=1 step=1 default=1
v4l2-ctl -d $VIDDEV -c scanning_mode_scale_horizontal=1 # min=1 max=1 step=1 default=1
v4l2-ctl -d $VIDDEV -c scanning_mode_scale_vertical=1 # min=1 max=1 step=1 default=1
v4l2-ctl -d $VIDDEV -c scanning_mode_binning_h=1 # min=1 max=1 step=1 default=1
v4l2-ctl -d $VIDDEV -c scanning_mode_binning_v=1 # min=1 max=1 step=1 default=1
v4l2-ctl -d $VIDDEV -c scanning_mode_skipping_h=1 # min=1 max=1 step=1 default=1
v4l2-ctl -d $VIDDEV -c scanning_mode_skipping_v=1 # min=1 max=1 step=1 default=1
v4l2-ctl -d $VIDDEV -c scanning_mode_flags=0 # min=0 max=0 step=0 default=0