Skip to content

Conversation

MrJavan
Copy link

@MrJavan MrJavan commented May 18, 2025

Previously, the code used array slicing ([:, :, ::-1]) to convert BGR to RGB, which occasionally caused TypeError in dlib's compute_face_descriptor(). I replaces the slicing method with cv2.cvtColor(small_frame, cv2.COLOR_BGR2RGB) The fix addresses issues where face recognition failed due to incorrect color channel handling.

Previously, the code used array slicing (`[:, :, ::-1]`) to convert BGR to RGB,  
which occasionally caused `TypeError` in `dlib`'s `compute_face_descriptor()`.  
I replaces the slicing method with `cv2.cvtColor(small_frame, cv2.COLOR_BGR2RGB)` 
The fix addresses issues where face recognition failed due to incorrect color channel handling.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant