@@ -55,6 +55,8 @@ def socket_type_pair(arg):
5555 is_color = True if type in ['c' , 'color' ] else False
5656 return [socket , is_color ]
5757
58+ def string_pair (arg ):
59+ return arg .split ('=' )
5860
5961parser = argparse .ArgumentParser ()
6062parser .add_argument ('-cams' , '--cameras' , type = socket_type_pair , nargs = '+' ,
@@ -78,6 +80,10 @@ def socket_type_pair(arg):
7880 help = "Make OpenCV windows resizable. Note: may introduce some artifacts" )
7981parser .add_argument ('-tun' , '--camera-tuning' , type = Path ,
8082 help = "Path to custom camera tuning database" )
83+ parser .add_argument ('-misc' , '--misc-controls' , type = string_pair , nargs = '+' ,
84+ default = [],
85+ help = "List of miscellaneous camera controls to set initially, "
86+ "as pairs: key1=value1 key2=value2 ..." )
8187parser .add_argument ('-d' , '--device' , default = "" , type = str ,
8288 help = "Optional MX ID of the device to connect to." )
8389
@@ -203,6 +209,10 @@ def get(self):
203209 # cam[c].initialControl.setMisc("downsampling-mode", "binning") # default: "scaling"
204210 # cam[c].initialControl.setMisc("binning-mode", "sum") # default: "avg"
205211 # cam[c].initialControl.setMisc("manual-exposure-handling", "fast") # default: "default"
212+ # cam[c].initialControl.setMisc("hdr-exposure-ratio", 4) # enables HDR when set `> 1`, current options: 2, 4, 8
213+ # cam[c].initialControl.setMisc("hdr-local-tone-weight", 75) # default 75, range 0..100
214+ for kvPair in args .misc_controls :
215+ cam [c ].initialControl .setMisc (* kvPair )
206216 control .out .link (cam [c ].inputControl )
207217 if rotate [c ]:
208218 cam [c ].setImageOrientation (dai .CameraImageOrientation .ROTATE_180_DEG )
0 commit comments