Commit bb42fe32 authored by tihmels's avatar tihmels

Entry Point erstellt

parent 439e443d
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
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
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment