Skip to content

Commit 4b3d859

Browse files
committed
add set resolution
1 parent 0e0ee93 commit 4b3d859

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

gaussian.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,12 @@
3939
type=float,
4040
help="rescale image by this factor",
4141
default=1.0)
42+
parser.add_argument(
43+
"-s",
44+
"--set_resolution",
45+
type=int,
46+
nargs=2,
47+
help='override default camera resolution as H W')
4248
parser.add_argument(
4349
"-ocl",
4450
"--opencl",
@@ -112,6 +118,16 @@ def nothing(x):
112118
250,
113119
nothing)
114120

121+
# override default camera resolution
122+
123+
if (args.set_resolution is not None):
124+
cap.set(cv2.CAP_PROP_FRAME_HEIGHT, args.set_resolution[1])
125+
cap.set(cv2.CAP_PROP_FRAME_WIDTH, args.set_resolution[0])
126+
127+
print("INFO: input resolution : (",
128+
int(cap.get(cv2.CAP_PROP_FRAME_WIDTH)), "x",
129+
int(cap.get(cv2.CAP_PROP_FRAME_HEIGHT)), ")")
130+
115131
while (keep_processing):
116132

117133
# start a timer (to see how long processing and display takes)

0 commit comments

Comments
 (0)