Skip to content

Commit

Permalink
add resolution selection
Browse files Browse the repository at this point in the history
  • Loading branch information
tobybreckon committed Jan 13, 2025
1 parent 59af189 commit 1c8d7b5
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions sobel.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,12 @@
type=float,
help="rescale image by this factor",
default=1.0)
parser.add_argument(
"-s",
"--set_resolution",
type=int,
nargs=2,
help='override default camera resolution as H W')
parser.add_argument(
'video_file',
metavar='video_file',
Expand Down Expand Up @@ -101,6 +107,12 @@ def nothing(x):
neighbourhood,
15,
nothing)

# override default camera resolution

if (args.set_resolution is not None):
cap.set(cv2.CAP_PROP_FRAME_HEIGHT, args.set_resolution[1])
cap.set(cv2.CAP_PROP_FRAME_WIDTH, args.set_resolution[0])

while (keep_processing):

Expand Down

0 comments on commit 1c8d7b5

Please sign in to comment.