Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mouse jumps confusingly when lighting changes #22

Open
1j01 opened this issue Aug 11, 2022 · 1 comment
Open

Mouse jumps confusingly when lighting changes #22

1j01 opened this issue Aug 11, 2022 · 1 comment
Labels
affects:desktop-app Affects the Electron app affects:web-library Affects usage of the tracky-mouse.js library bug Something isn't working

Comments

@1j01
Copy link
Owner

1j01 commented Aug 11, 2022

Even switching between windows often causes the mouse to jump, because the head tracking gets lost, because the lighting changes, because the overall luminosity is different between the windows.
This happens when lighting isn't great, i.e. you don't have a lamp facing you, and the light of the screen is a significant factor in the overall amount of light reflecting off you.

I plan to include some guidance about lighting into the app, but I wonder if this could be improved by normalizing the luminosity histogram, perhaps selectively, like with a vignette for a multiplier of how much each pixel matters, approximating where the user's face likely is, without being too specific / relying on facemesh too much. My reasoning for focusing on the user for lighting normalization is that the user's face is what's important to normalize to keep tracking working, and the background scenery may not change nearly so much, since it's further behind, further away from the screen, and more affected by other light sources. If the background were to be counted equally to the face, the image of the face may not be normalized enough.

@1j01 1j01 added bug Something isn't working affects:web-library Affects usage of the tracky-mouse.js library affects:desktop-app Affects the Electron app labels Aug 11, 2022
@1j01
Copy link
Owner Author

1j01 commented Apr 13, 2024

Theory: if optical flow is tracking a point that exists in a gradient of light and dark on your face, when everything gets brighter, it gets confused and thinks that the point has moved towards a relatively dark part of your face, which is now more similar in absolute lightness to the point that it was tracking.

Thus, normalizing the lighting based on the area around the tracking points may help. And by the way, the vignette multiplier for the histogram could be defined simply by distance to the tracking points rather than the face at large... although, tracking points may come and go, which could affect the histogram in the instant they're added/removed.

At any rate, this is just a theory, and if instead optical flow tracking is disrupted for another reason, such as video compression, normalization may not help at all.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects:desktop-app Affects the Electron app affects:web-library Affects usage of the tracky-mouse.js library bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant