File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed
Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change 5555 type = float ,
5656 help = "rescale image by this factor" ,
5757 default = 1.0 )
58+ parser .add_argument (
59+ "-s" ,
60+ "--set_resolution" ,
61+ type = int ,
62+ nargs = 2 ,
63+ help = 'override default camera resolution as H W' )
5864parser .add_argument (
5965 "-fs" ,
6066 "--fullscreen" ,
@@ -281,6 +287,12 @@ def getOutputsNames(net):
281287 # create window by name (as resizable)
282288 cv2 .namedWindow (window_name , cv2 .WINDOW_NORMAL )
283289
290+ # override default camera resolution
291+
292+ if (args .set_resolution is not None ):
293+ cap .set (cv2 .CAP_PROP_FRAME_HEIGHT , args .set_resolution [1 ])
294+ cap .set (cv2 .CAP_PROP_FRAME_WIDTH , args .set_resolution [0 ])
295+
284296 while (keep_processing ):
285297
286298 # start a timer (to see how long processing and display takes)
You can’t perform that action at this time.
0 commit comments