Hello everyone I just bought a RaspberryPI4 and I'm a beginner.
I'm using Python3.7 and I installed :
sudo pi3 opencv-contrib-python 3.4.4.19 for this code
But I have this problem:
Can you help me please?
Gianluca
I'm using Python3.7 and I installed :
sudo pi3 opencv-contrib-python 3.4.4.19 for this code
import cv2
import os
import numpy as np
import Facerecognition as fr
test_img = cv2.imread('/home/pi/foto1.jpg')
face, gray = fr.faceDetection(test_img)
#faces,facesID=fr.training_data('/home/pi/CV/immagini')
#faceRecognizer=fr.training_classifier(faces,facesID)
#faceRecognizer.save("trainedData.yml")
faceRecognizer=cv2.face.LBPHFaceRecognizer_create()
faceRecognizer.read()
name={0:"Gianluca",1:"Sconosciuto"}
for face in face:
(x,y,w,h)=face
region=gray[y:y+h, x:x+w]
label,confidence=faceRecognizer.predict(region)
print("confidence",confidence)
print("label",label)
fr.draw_rect(test_img,face)
predicted_name=name[label]
if (confidence>60):
continue
fr.put_name(test_img,predicted_name,x,y)
resized=cv2.resize(test_img, None, fx=0.5, fy=0.5)
cv2.imshow('trovata:',resized)
cv2.waitKey(0)
cv2.destroyAllWindows()(functions are in another module)But I have this problem:
Error:Traceback (most recent call last):
File "/home/pi/CV/tester.py", line 1, in <module>
import cv2
File "/usr/local/lib/python3.7/dist-packages/cv2/__init__.py", line 3, in <module>
from .cv2 import *
ImportError: libhdf5_serial.so.103: cannot open shared object file: No such file or directoryHow can i install this library?Can you help me please?
Gianluca
