Giter VIP home page Giter VIP logo

kinectv2mousecontrol's Introduction

Kinect v2 Mouse Control

Updates:
  • v1.2.1
    May 4th, 2018: Lock control with first tracked person so as to avoid cursor being influenced by other people.

  • v1.2
    Apr 10th, 2018: Added two-hand controls:

    • Move + grip pressing.
    • Move + lift clicking.

    I personlly don't think these control functions are intuitive or good-looking gestures. But they kind of solve cursor jittering when doing a grip gesture, in a quick doable way. Still fine if you are okay with them for your scenarios.

  • v1.1
    Feb 21th, 2018: An update after 3 years since first created. On usages and the looking, the app doesn't seem very different. Features are nearly just the same, but with a big structure change on the code side using MVVM pattern.
    A small improvement on feature is, the cursor will keep following first tracked (lifting-forward) hand regardless of another hand lifting afterwards. Previously, it was set to only follow right hand when both hand are tracked.


Features

Control mode options

  • Disabled
  • Move only
  • Grip to press
  • Hover to click
  • Move + grip pressing *
  • Move + lift clicking *

* P.s. 2-hand control (One hand for moving cursor, another for mouse button control)

Adjustable parameters

  • Movement scale
  • Cursor smoothing
  • Hover-to-click range
  • Hover-to-click duration

Some more descriptions what some classes do:

KinectReader.cs

  • Turns on/off Kinect sensor.
  • Reads data from sensor.
  • Raises OnTrackedBody, OnLostTracking events.

CursorMapper.cs

  • Maps positions from input rect to output rect. Specifically in this case:

    • Input rect: Hand gesture moving area.
    • Output rect: Screen area.
  • Gets position for smoothed cursor movement.

  • Scale alignment available for deciding how movements are scaled from input to output rect with an adjusted proportion. So as to make desired and suitable cursor movements on specific area sizes. There's no visual settings on the current app. And it's set to LongerRange by default in code.

    e.g. If hand gesture moving area is (0, 0, 100, 100), screen area is (0, 0, 800, 600).

    • None. Scale: (1, 1)
    • Both. Scale: (8, 6)
    • Horizontal. Scale: (8, 8)
    • Vertical. Scale: (6, 6)
    • ShorterRange. Scale: (6, 6)
    • LongerRange. Scale: (8, 8)

MapperStructs.cs:

MRect and MVector2 included in MapperStructs.cs are custom Rect and Vector2 struct with an 'M' in the front just to make it more distinguishable from possibly existing namesake structs.

MRect has DeltaX, DeltaY, Width, Height, Center properties that can be used for calculating scale and offset for mapping.

kinectv2mousecontrol's People

Contributors

tangochen avatar jhg543 avatar

Watchers

James Cloos avatar  avatar

Forkers

cherry-coco

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.