Commit 05057645 authored by Arne Gerdes's avatar Arne Gerdes

Ersten Test mit Face Detection durchgeführt

parent 5b8380fb
<component name="InspectionProjectProfileManager">
<profile version="1.0">
<option name="myName" value="Project Default" />
<inspection_tool class="PyUnresolvedReferencesInspection" enabled="true" level="WARNING" enabled_by_default="true">
<option name="ignoredIdentifiers">
<list>
<option value="ErsterTest.quot" />
</list>
</option>
</inspection_tool>
</profile>
</component>
\ No newline at end of file
......@@ -4,7 +4,7 @@
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/projectmood" isTestSource="false" />
</content>
<orderEntry type="jdk" jdkName="Python 3.6.3 virtualenv at ~/Jetbrains/PyCharm/Medienverarbeitung/medienverarbeitung17.projectmood/venv" jdkType="Python SDK" />
<orderEntry type="jdk" jdkName="Python 3.6.3 virtualenv at C:\Users\arne8\venv" jdkType="Python SDK" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
<component name="PackageRequirementsSettings">
......
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.6.3 virtualenv at ~/Jetbrains/PyCharm/Medienverarbeitung/medienverarbeitung17.projectmood/venv" project-jdk-type="Python SDK" />
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.6.3 virtualenv at C:\Users\arne8\venv" project-jdk-type="Python SDK" />
</project>
\ No newline at end of file
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()
import cv2
import numpy
\ 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