-
Notifications
You must be signed in to change notification settings - Fork 69
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
74f8db6
commit 2b40a65
Showing
2 changed files
with
34 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,7 @@ | |
|
||
# Author : Toby Breckon, [email protected] | ||
|
||
# Copyright (c) 2015 School of Engineering & Computing Science, | ||
# Copyright (c) 2015-2024 Engineering & Computing Science, | ||
# Durham University, UK | ||
# License : LGPL - http://www.gnu.org/licenses/lgpl.html | ||
|
||
|
@@ -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( | ||
'video_file', | ||
metavar='video_file', | ||
|
@@ -100,6 +106,16 @@ def nothing(x): | |
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]) | ||
|
||
print("INFO: input resolution : (", | ||
int(cap.get(cv2.CAP_PROP_FRAME_WIDTH)), "x", | ||
int(cap.get(cv2.CAP_PROP_FRAME_HEIGHT)), ")") | ||
|
||
while (keep_processing): | ||
|
||
# if video file successfully open then read frame from video | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,7 +8,7 @@ | |
|
||
# Author : Toby Breckon, [email protected] | ||
|
||
# Copyright (c) 2016-2021 Toby Breckon | ||
# Copyright (c) 2016-2024 Toby Breckon | ||
# Computer Science, Durham University, UK | ||
# License : LGPL - http://www.gnu.org/licenses/lgpl.html | ||
|
||
|
@@ -63,6 +63,12 @@ def extraOpenCVModulesPresent(): | |
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', | ||
|
@@ -212,6 +218,16 @@ def on_mouse(event, x, y, flags, params): | |
else: | ||
matcher = cv2.BFMatcher() | ||
|
||
# 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): | ||
|
||
# if video file successfully open then read frame from video | ||
|