Skip to content

Commit

Permalink
add set resolution
Browse files Browse the repository at this point in the history
  • Loading branch information
tobybreckon committed Jan 19, 2025
1 parent 0e0ee93 commit 4b3d859
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions gaussian.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,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(
"-ocl",
"--opencl",
Expand Down Expand Up @@ -112,6 +118,16 @@ def nothing(x):
250,
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])

print("INFO: input resolution : (",
int(cap.get(cv2.CAP_PROP_FRAME_WIDTH)), "x",
int(cap.get(cv2.CAP_PROP_FRAME_HEIGHT)), ")")

while (keep_processing):

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

0 comments on commit 4b3d859

Please sign in to comment.