Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Frank Tjado Ihmels
medienverarbeitung17.projectmood
Commits
bb42fe32
Commit
bb42fe32
authored
Nov 02, 2017
by
tihmels
Browse files
Entry Point erstellt
parent
439e443d
Changes
2
Hide whitespace changes
Inline
Side-by-side
projectmood/cvhelper.py
0 → 100644
View file @
bb42fe32
import
cv2
def
createwindow
(
name
,
view
,
x
=
70
,
y
=
70
,
width
=
700
,
height
=
700
):
cv2
.
namedWindow
(
name
,
cv2
.
WINDOW_NORMAL
)
cv2
.
resizeWindow
(
name
,
width
,
height
)
cv2
.
moveWindow
(
name
,
x
,
y
)
cv2
.
imshow
(
name
,
view
)
\ No newline at end of file
projectmood/main.py
View file @
bb42fe32
import
cv2
import
sys
import
cvhelper
def
main
():
if
len
(
sys
.
argv
)
>
1
:
cap
=
cv2
.
VideoCapture
(
str
(
sys
.
argv
[
1
]))
else
:
cap
=
cv2
.
VideoCapture
(
0
)
while
(
True
):
# Capture frame-by-frame
ret
,
frame
=
cap
.
read
()
# Our operations on the frame come here
gray
=
cv2
.
cvtColor
(
frame
,
cv2
.
COLOR_BGR2GRAY
)
cvhelper
.
createwindow
(
'Grayscale'
,
gray
)
if
cv2
.
waitKey
(
1
)
&
0xFF
==
ord
(
'q'
):
break
# When everything done, release the capture
cap
.
release
()
cv2
.
destroyAllWindows
()
if
__name__
==
'__main__'
:
main
()
\ No newline at end of file
Write
Preview
Supports
Markdown
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