Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
medienverarbeitung17.projectmood
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
Frank Tjado Ihmels
medienverarbeitung17.projectmood
Commits
bb42fe32
Commit
bb42fe32
authored
Nov 02, 2017
by
tihmels
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Entry Point erstellt
parent
439e443d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
36 additions
and
0 deletions
+36
-0
projectmood/cvhelper.py
projectmood/cvhelper.py
+7
-0
projectmood/main.py
projectmood/main.py
+29
-0
No files found.
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
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