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

Feature: Synchronize Mouse Movements Captured by Camera with On-Screen Cursor Movement #57

Open
KitsuneSemCalda opened this issue May 26, 2024 · 0 comments

Comments

@KitsuneSemCalda
Copy link
Contributor

Implement a system that captures the small movements of a user's hand or face via a webcam and translates these movements to control the cursor on a computer screen. This requires interpolating the smaller, captured movements to a larger scale suitable for screen coordinates.

Like:

def map_coordinates(x, y, src_width, src_height, dst_width, dst_height):
    """
    Map coordinates from source dimensions to destination dimensions.
    
    :param x: X coordinate in source
    :param y: Y coordinate in source
    :param src_width: Width of source
    :param src_height: Height of source
    :param dst_width: Width of destination
    :param dst_height: Height of destination
    :return: (new_x, new_y) in destination
    """
    new_x = int((x / src_width) * dst_width)
    new_y = int((y / src_height) * dst_height)
    return new_x, new_y
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

No branches or pull requests

1 participant