Skip to content

feat: read signs from the rear camera too - #19

Merged
Endika merged 1 commit into
mainfrom
feat/rear-camera
Aug 5, 2026
Merged

feat: read signs from the rear camera too#19
Endika merged 1 commit into
mainfrom
feat/rear-camera

Conversation

@Endika

@Endika Endika commented Aug 5, 2026

Copy link
Copy Markdown
Owner

The front camera only helps when you are the one signing. If a Deaf person is signing to you — the actual situation this app exists for — you need the rear camera pointed at them.

The part that would have broken quietly

MediaPipe reports handedness for a mirrored view, which is what a selfie camera gives: its Left is the signer's right hand. The rear camera is not mirrored, so that mapping inverts.

Get it wrong and nothing errors. Every hand is silently swapped, and because normalizeHand mirrors left hands into the right hand's space, two-handed signs arrive at the model reflected. Extracted to handednessFor(label, facing) and tested — including a test asserting the two cameras disagree for the same label, so the fix cannot be undone without a red test.

The same reasoning applies to the overlay: the canvas is mirrored to match the video, so both un-mirror together or the skeleton lands on the wrong side of the screen.

Restarting the stream rather than reconfiguring it is deliberate — getUserMedia cannot change facingMode on a live track, and phones expose the two cameras as separate devices.

@Endika
Endika merged commit 3e974f4 into main Aug 5, 2026
7 checks passed
@Endika
Endika deleted the feat/rear-camera branch August 5, 2026 21:21
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