我遇到了TypeError,尝试打印len(faces),但出现错误,在线看到了类似的解决方案,但不符合我的需要。任何帮助 我的代码如下所示:
def findFaceAndStore(image,rollNumber):
face=obj.Face(1.6,5,20,20)
faces=face.getFaces(image)
print ("No of faces found in findFaceAndStore",len(faces))
for f in faces:
simg=cv2.cvtColor(f,cv2.COLOR_BGR2GRAY)
simg=cv2.resize(simg,(600,600),interpolation=cv2.INTER_AREA)
obj1=getStudent(rollNumber)
pImage=saveImageObject(simg,rollNumber)
obj2=ImageData(student=obj1,image=pImage)
obj2.save()