From 050576452c21dabc72a929499075219a107fccba Mon Sep 17 00:00:00 2001 From: Arne Gerdes Date: Thu, 26 Oct 2017 11:15:29 +0200 Subject: [PATCH] =?UTF-8?q?Ersten=20Test=20mit=20Face=20Detection=20durchg?= =?UTF-8?q?ef=C3=BChrt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .idea/inspectionProfiles/Project_Default.xml | 12 ++++++++++++ .idea/medienverarbeitung17.projectmood.iml | 2 +- .idea/misc.xml | 2 +- projectmood/ErsterTest | 19 +++++++++++++++++++ projectmood/main.py | 2 ++ 5 files changed, 35 insertions(+), 2 deletions(-) create mode 100644 .idea/inspectionProfiles/Project_Default.xml create mode 100644 projectmood/ErsterTest diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml new file mode 100644 index 0000000..473feaf --- /dev/null +++ b/.idea/inspectionProfiles/Project_Default.xml @@ -0,0 +1,12 @@ + + + + \ No newline at end of file diff --git a/.idea/medienverarbeitung17.projectmood.iml b/.idea/medienverarbeitung17.projectmood.iml index 337ec92..e73e66c 100644 --- a/.idea/medienverarbeitung17.projectmood.iml +++ b/.idea/medienverarbeitung17.projectmood.iml @@ -4,7 +4,7 @@ - + diff --git a/.idea/misc.xml b/.idea/misc.xml index 8b5945a..71529a9 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -1,4 +1,4 @@ - + \ No newline at end of file diff --git a/projectmood/ErsterTest b/projectmood/ErsterTest new file mode 100644 index 0000000..98ff085 --- /dev/null +++ b/projectmood/ErsterTest @@ -0,0 +1,19 @@ +import numpy as np +import cv2 + +detector = cv2.CascadeClassifier('haarcascade_frontalface_default.xml') +cap = cv2.VideoCapture(0) + +while (True): + ret, img = cap.read() + gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY) + faces = detector.detectMultiScale(gray, 1.3, 5) + for (x, y, w, h) in faces: + cv2.rectangle(img, (x, y), (x + w, y + h), (255, 0, 0), 2) + + cv2.imshow('frame', img) + if cv2.waitKey(1) & 0xFF == ord('q'): + break + +cap.release() +cv2.destroyAllWindows() diff --git a/projectmood/main.py b/projectmood/main.py index e69de29..af9905c 100644 --- a/projectmood/main.py +++ b/projectmood/main.py @@ -0,0 +1,2 @@ +import cv2 +import numpy \ No newline at end of file -- GitLab