diff --git a/examples/facerec_from_webcam_faster.py b/examples/facerec_from_webcam_faster.py index e4a7bbd47..a22728072 100644 --- a/examples/facerec_from_webcam_faster.py +++ b/examples/facerec_from_webcam_faster.py @@ -48,7 +48,8 @@ small_frame = cv2.resize(frame, (0, 0), fx=0.25, fy=0.25) # Convert the image from BGR color (which OpenCV uses) to RGB color (which face_recognition uses) - rgb_small_frame = small_frame[:, :, ::-1] + code = cv2.COLOR_BGR2RGB + rgb_small_frame = cv2.cvtColor(small_frame, code) # Find all the faces and face encodings in the current frame of video face_locations = face_recognition.face_locations(rgb_small_frame)