Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
O
opencv
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
opencv
Commits
ee417048
Unverified
Commit
ee417048
authored
Nov 16, 2018
by
Alexander Alekhin
Committed by
GitHub
Nov 16, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #13178 from alalek:fix_samples_python_video_params
parents
a4b21d9e
9ca82cae
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
4 deletions
+6
-4
video.py
samples/python/video.py
+6
-4
No files found.
samples/python/video.py
View file @
ee417048
...
...
@@ -32,6 +32,8 @@ Keys:
# Python 2/3 compatibility
from
__future__
import
print_function
import
re
import
numpy
as
np
from
numpy
import
pi
,
sin
,
cos
...
...
@@ -169,11 +171,11 @@ def create_capture(source = 0, fallback = presets['chess']):
'''source: <int> or '<int>|<filename>|synth [:<param_name>=<value> [:...]]'
'''
source
=
str
(
source
)
.
strip
()
# Win32: handle drive letter ('c:', ...)
source
=
re
.
sub
(
r'(^|=)([a-zA-Z]):([/\\a-zA-Z0-9])'
,
r'\1?disk\2?\3'
,
source
)
chunks
=
source
.
split
(
':'
)
# handle drive letter ('c:', ...)
if
len
(
chunks
)
>
1
and
len
(
chunks
[
0
])
==
1
and
chunks
[
0
]
.
isalpha
():
chunks
[
1
]
=
chunks
[
0
]
+
':'
+
chunks
[
1
]
del
chunks
[
0
]
chunks
=
[
re
.
sub
(
r'\?disk([a-zA-Z])\?'
,
r'\1:'
,
s
)
for
s
in
chunks
]
source
=
chunks
[
0
]
try
:
source
=
int
(
source
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment