File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed
Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change 4444 type = float ,
4545 help = "rescale image by this factor" ,
4646 default = 1.0 )
47+ parser .add_argument (
48+ "-s" ,
49+ "--set_resolution" ,
50+ type = int ,
51+ nargs = 2 ,
52+ help = 'override default camera resolution as H W' )
4753parser .add_argument (
4854 "-cbx" ,
4955 "--chessboardx" ,
142148
143149if cap .open (args .camera_to_use ):
144150
151+ # override default camera resolution
152+
153+ if (args .set_resolution is not None ):
154+ cap .set (cv2 .CAP_PROP_FRAME_HEIGHT , args .set_resolution [1 ])
155+ cap .set (cv2 .CAP_PROP_FRAME_WIDTH , args .set_resolution [0 ])
156+
157+ print ("INFO: input resolution : (" ,
158+ int (cap .get (cv2 .CAP_PROP_FRAME_WIDTH )), "x" ,
159+ int (cap .get (cv2 .CAP_PROP_FRAME_HEIGHT )), ")" )
160+
145161 while (not (do_calibration )):
146162
147163 # grab frames from camera
You can’t perform that action at this time.
0 commit comments