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'
Add those lines after image=cv2.imread('yuz1.jpg')
thank you!
please also make sure, to use ascii filenames only here. no unicode allowed !
But image and code is the same path then it is writing continuous 'Check image path' when I run the code
But image and code is the same path then it is writing continuous 'Check image path' when I run the code
can you help me?
give full path ( and I think you already check that your image is not really empty)
let me restore the original error here !