3

I'm working on an Android project. it's goal is to detect predefined movement gesture of the device. if the device rotates 45 degrees over an axis(X,Y or Z) and then rotates back to its first position( the first and second positions are not going to be accurate, I mean if it was rotated 50 degrees instead of 45, not important !!!)then the gesture has happened and the app should detect it.

I tried to do that using Accelerometer and Magnetic sensors of device to continually monitor the orientation of the device and detect gesture but the results weren't acceptable(explained here). any start point or idea please ?

Bhargav Rao
  • 41,091
  • 27
  • 112
  • 129
Soheil
  • 1,610
  • 6
  • 31
  • 63
  • 1
    I think you don't need precise measurements in order to identify a gesture. There are a lot of examples of mouse gestures recognition. User will not be able to rotate phone that fast :) I'll try to find something suitable, but you can take a look as well. – Renat Gilmanov Sep 20 '13 at 07:46
  • 1
    yes, you are completely correct! accuracy is not that much important, the algorithm should be smart enough to detect the gesture ! thanks for your attention :))) – Soheil Sep 20 '13 at 08:25

1 Answers1

10

It doesn't seem like anybody is going to provide a concrete and valuable answer. So let me try to do that.

First of all, even a bit primitive and straightforward approach allows to spot the fact you do not need to process all the data coming from sensors. Moreover humans are not that fast, so there is no need to proceed 10000 values per second in order to identify any specific move as well.

enter image description here

What you actually need is just to identify key points and make your decision. Does it sound like a tanget to you?

enter image description here

What I'm actually suggesting is to test your solution using an ordinary mouse and available gesture recognition framework. Because the actual idea is pretty much the same. So please check:

enter image description here

It such a way it might be easier to develop a proper solution.

Update

Let's imagine I'm holding my phone and I need to rotate it 90 degrees counterclockwise and then 180 degrees clockwise. I hope you will not expect me to do some complex 3D shapes in the air (it will break usability and frankly I do not want to loose my phone), so it is possible to say there might be a point we can track or we can easily simulate it.

enter image description here

Please see my other answer in order to see simple, but working solution of a similar problem:

enter image description here

Community
  • 1
  • 1
Renat Gilmanov
  • 17,223
  • 5
  • 35
  • 54
  • clearly, I must use Android device _sensors_ to detect that gesture, I already have tried a way by using `Accelerometer` and `Magnetic` sensors and I figured out the limitation of them(http://stackoverflow.com/questions/18786694/whats-wrong-with-my-sensor-monitoring-technique/18939292?noredirect=1#comment27982307_18939292) now, the first question would be which sensors to use and then how to implement that...you know, detecting touch gestures, mouse gestures and...is much different from sensor gestures – Soheil Sep 23 '13 at 08:20
  • 1
    `What you actually need is just to identify key points and make your decision`...completely correct, but how ?!! the sensors limitations doesn't allow me reach to that – Soheil Sep 23 '13 at 08:23
  • 1
    Are you developing you program for one particular phone? Buggy sensor has nothing to do with the correct solution. Replace the phone with the new one and continue. `completely correct, but how` - did you look through examples/frameworks I've provided? – Renat Gilmanov Sep 23 '13 at 19:51
  • yeah, thank you. I saw them but do you think the way we detect a mouse gesture can help in detection of a movement gesture ? I don't think so – Soheil Sep 25 '13 at 20:14
  • 1
    I've updated my answer. This is my final contribution and I think you have everything to solve you task. Happy coding. – Renat Gilmanov Sep 29 '13 at 02:29