Software Archive
Read-only legacy content
17061 Discussions

Transform hand gestures coordinates to mouse points

codeno47
Beginner
362 Views

How to transform hand gestures coordinates to mouse points?,  i have added some factors to convert it, it works at some extend but not perfect.

I suspect my current code will not work with different screen resolution.

  public class CursorMapping
    {
        /// <summary>
        /// The veritical mapping contant
        /// </summary>
        public const int VeriticalMappingContant = 1500;

        /// <summary>
        /// The horizontal mapping constant
        /// </summary>
        public const int HorizontalMappingConstant = 1500;
    }


 var valueY = (int)(uxEventData.position.y * CursorMapping.VeriticalMappingContant);

  var valueX = (int)(uxEventData.position.x * CursorMapping.HorizontalMappingConstant);

Is there any better way doing it, any help from Realsense SDK?

 

 

 

0 Kudos
1 Solution
Avan_T
Novice
362 Views

Hi codeno47,

1. Access lib System32 (search google mouse system32)

2. Get Screen resolution with x, y

3. Create global variable store current position x,y

4. Get screen size of camera with x,y

5. Set current position = global position + (camera size/screen size)*Speed    (* condition : for best movement)

6. Update global position for store new position.

View solution in original post

0 Kudos
2 Replies
Avan_T
Novice
363 Views

Hi codeno47,

1. Access lib System32 (search google mouse system32)

2. Get Screen resolution with x, y

3. Create global variable store current position x,y

4. Get screen size of camera with x,y

5. Set current position = global position + (camera size/screen size)*Speed    (* condition : for best movement)

6. Update global position for store new position.

0 Kudos
Dagan_E_Intel
Employee
362 Views

or have a look at the TouchlessController module, that will give you what you are looking for, and more.

e.g. mouse-move events, swipe and click events, etc

0 Kudos
Reply