Comments (7)
This probably means OpenCV wasn't able to grab an image from your webcam. Can you try rebooting your computer and running it again?
from face_recognition.
Hi,
Rebooted my Raspberry Pi. I am still get the same error.
from face_recognition.
Oh, this is a raspberry pi. You put macOS in the issue description.
The RPi camera doesn't work with OpenCV like that. There's a separate code example for raspberry pis that uses the picamera module.
from face_recognition.
Is there any separate code module that can do live video processing on Raspberry Pi similar to this? https://github.com/ageitgey/face_recognition/blob/master/examples/facerec_from_webcam_faster.py
from face_recognition.
The examples do almost the same thing. The only difference is the opencv example shows the video in a window while it processes it.
If you want to use the OpenCV example on an RPi, you could modify the OpenCV example to replace the part that captures the image:
# Get a reference to webcam #0 (the default one)
video_capture = cv2.VideoCapture(0)
# .. etc ..
while True:
# Grab a single frame of video
ret, frame = video_capture.read()
# Resize frame of video to 1/4 size for faster face recognition processing
small_frame = cv2.resize(frame, (0, 0), fx=0.25, fy=0.25)
with the equivalent code using picamera:
camera = picamera.PiCamera()
camera.resolution = (320, 240)
small_frame = np.empty((240, 320, 3), dtype=np.uint8)
# ... etc ...
while True:
print("Capturing image.")
# Grab a single frame of video from the RPi camera as a numpy array
camera.capture(small_frame, format="bgr")
camera.close()
And something like that should work.
from face_recognition.
@ageitgey Thanks for your help. Will definitely try this out.
from face_recognition.
Cool! 👍
from face_recognition.
Related Issues (20)
- Doesn't works with ffmpeg 6.0_1
- Doesn't works
- Not working HOT 3
- Not accurate HOT 1
- Problem "ValueError: operands could not be broadcast together with shapes ( , ) (128, )" Solution
- fcaial recognition wrong person
- I want to detect whether the faces in the pictures are complete HOT 1
- Face similiarity for multiple images
- Fr
- test HOT 1
- Windows installation HOT 5
- Windows face_recognition run time error HOT 1
- Facial
- Shared My Dockerfile
- Face recognition in the Voynich manuscript
- face_recognition only works with obama. HOT 3
- kindly integrate face alignment step
- Import gets stuck while using it inside a myfunctions module
- Attribute error HOT 1
- dlib HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from face_recognition.