问题
Using the accelerometer output, how do I determine if the user (iphone mounted on waist) is walking?
Looking for a good algorithm to determine if the user is walking to determine activity transitions- standing-to-walking or walking-to-standing.
please help.
Thank you for your time.
回答1:
For a previous project, I tried calculating the magnitude of the acceleration vector, and just setting a threshold of about 2g, and that worked pretty well in testing. A typical (hardware) pedometer will ignore single jolts that happen more than about a second apart, which seems like a good way to filter out occasional movement that isn't "walking".
Additionally, you could automatically adjust the threshold by examining the data for a while.
来源:https://stackoverflow.com/questions/651630/iphone-accelerometer-determine-motion