- Use sqrt to find the distance in pixels it traveled from one frame to the next.
- Multiply by your spatial calibration factor to convert from pixels to centimeters.
- Divide the distance in cm by the frame time.
Speed calculation of a gesture
조회 수: 2 (최근 30일)
이전 댓글 표시
I have a gesture and want to calculate its speed. I have got its x and y axis points. How can speed profile of a gesture can be claculated using trajectory points??
댓글 수: 0
답변 (1개)
Image Analyst
2021년 1월 1일
Something like
distanceInPixels = sqrt(x1 - x2) ^ 2 + (y1 - y2) ^ 2);
distanceInCm = distanceInPixels * cmPerPixel;
speed = distanceInCm / frameTimeInSeconds;
To get the spatial calibration factor, see attached demo.
댓글 수: 2
Image Analyst
2021년 1월 1일
When you open the videoReader, it is the NumberOfFrame property. See the help for videoReader. It might be 1/30 of a second.
frameTimeInSeconds = 1/30; % For standard US (or 1/29.94).
참고 항목
카테고리
Help Center 및 File Exchange에서 Audio and Video Data에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!