import cv2 import numpy as np
image = cv2.imread('yüz1.jpg')
faceCascade = cv2.CascadeClassifier('haarcascade_frontalface_default.xml')
greyImage = cv2.cvtColor(image,cv2.COLOR_BGR2GRAY)
faces = faceCascade.detectMultiScale(image,1.1,4)
for(x,y,w,h) in faces : cv2.rectangle(image, (x,y), (x+w,y+h),(0,255,0),3)
cv2.imshow('faces', image) cv2.waitKey(0) cv2.destroyAllWindows()
"C:\Users\asus\Documents\Python Çalışma\venv\Scripts\python.exe" "C:/Users/asus/Documents/Python Çalışma/İmageProcessing/faceDetection.py" Traceback (most recent call last): File "C:/Users/asus/Documents/Python Çalışma/İmageProcessing/faceDetection.py", line 8, in <module> greyImage = cv2.cvtColor(image,cv2.COLOR_BGR2GRAY) cv2.error: OpenCV(3.4.3) C:\projects\opencv-python\opencv\modules\imgproc\src\color.cpp:181: error: (-215:Assertion failed) !_src.empty() in function 'cv::cvtColor'