Main content

Home

Menu

Loading wiki pages...

View
Wiki Version:
# Automated Step Counting ## Citation and Reference This software is accompanied by the paper JM Mahoney, ZE Scalyer, MB Rhudy, "Design and Validation of a Simple Automated Optical Step Counting Method for Treadmill Walking", Journal of Medical Engineering & Technology, Volume 42, Issue 6, December 2018. https://doi.org/10.1080/03091902.2018.1546343 Please cite both the paper and this OSF website ## Instructions This program operates on a video with two coloured markers: one on a static body and one on the toe. The program identifies the coordinates of the points in all frames of the video. Then the horizontal distance is calculated between the points. The peaks of this oscillating value are found. The number of peaks is the same as the number of heel strikes and, thus, the number of steps. 1. Select the video file you want to analyze 2. Click the upper left and bottom right points to make a bounding box. Reducing the region of interest will reduce the artifacts during processing and allow for quicker processing. 3. Click the marker on the treadmill and then the marker on the foot 4. Check results. You may need to adjust the "thresh" and "grsize" below 5. Data is saved to a mat file with the same name as the video This version of the code seeks an audio pulse to locate the time to begin and end counting. This portion of the code and be removed. ![raw][2] Sample frame from raw video ![thresh][3] The same frame after thresholding and identifying "marker" pixels. Red crosses are placed on the centroids. ## Sample Use ### Instructions Two sample videos are included in the "sample video" folder, `AA04_4_30.MP4` and `AA04_4_60.MP4`. The files are of the same trial of a subject ambulating at varying speed. The first is recored at 600x800 at 30 fps and the second at 1080p at 60 fps. The files were syncronized using an audio pulse. This is not needed in general though. Run the m file in Matlab and you will be prompted to select the video file to analyze. Select either file. The software will display the first frame of video and the user should click on the centers of the two markers and then press "Enter". The remaining analysis will be automated. ### Results from Sample After selecting the region of interest and picking the markers, the program will process the video. You will get a plot of the horizontal distance between the markers ![image 1][1] and it will report the number of steps it counted (the total number of peaks detected in the plot) ``Number of Steps 116`` [1]: https://mfr.osf.io/export?url=https://osf.io/sbh75/?action=download%26mode=render%26direct%26public_file=False&initialWidth=848&childId=mfrIframe&parentTitle=OSF+%7C+plot.png&parentUrl=https://osf.io/sbh75/&format=2400x2400.jpeg [2]: https://mfr.osf.io/export?url=https://osf.io/dauq9/?action=download%26mode=render%26direct%26public_file=False&initialWidth=848&childId=mfrIframe&parentTitle=OSF+%7C+raw.png&parentUrl=https://osf.io/dauq9/&format=2400x2400.jpeg [3]: https://mfr.osf.io/export?url=https://osf.io/2f587/?action=download%26mode=render%26direct%26public_file=False&initialWidth=848&childId=mfrIframe&parentTitle=OSF+%7C+thresh.png&parentUrl=https://osf.io/2f587/&format=2400x2400.jpeg
OSF does not support the use of Internet Explorer. For optimal performance, please switch to another browser.
Accept
This website relies on cookies to help provide a better user experience. By clicking Accept or continuing to use the site, you agree. For more information, see our Privacy Policy and information on cookie use.
Accept
×

Start managing your projects on the OSF today.

Free and easy to use, the Open Science Framework supports the entire research lifecycle: planning, execution, reporting, archiving, and discovery.