Skip to content

Commit 1c8d7b5

Browse files
committed
add resolution selection
1 parent 59af189 commit 1c8d7b5

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

sobel.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,12 @@
3838
type=float,
3939
help="rescale image by this factor",
4040
default=1.0)
41+
parser.add_argument(
42+
"-s",
43+
"--set_resolution",
44+
type=int,
45+
nargs=2,
46+
help='override default camera resolution as H W')
4147
parser.add_argument(
4248
'video_file',
4349
metavar='video_file',
@@ -101,6 +107,12 @@ def nothing(x):
101107
neighbourhood,
102108
15,
103109
nothing)
110+
111+
# override default camera resolution
112+
113+
if (args.set_resolution is not None):
114+
cap.set(cv2.CAP_PROP_FRAME_HEIGHT, args.set_resolution[1])
115+
cap.set(cv2.CAP_PROP_FRAME_WIDTH, args.set_resolution[0])
104116

105117
while (keep_processing):
106118

0 commit comments

Comments
 (0)