Webcam velocity of object

7 ビュー (過去 30 日間)
Andrew Lewis
Andrew Lewis 2020 年 10 月 3 日
回答済み: Pankhuri Kasliwal 2020 年 10 月 6 日
Hello All,
I already have webcams set up. Are there any matlab functions that would be able to determine the speed of an object that is moving head on towards the camera? I was thinking of using the meters/pixel and having the camera track an image and how many pixels the image takes up to determine how far away it is. It is much work but I thought there would be some function already built into matlab to help this. Any suggestions are welcome.

回答 (1 件)

Pankhuri Kasliwal
Pankhuri Kasliwal 2020 年 10 月 6 日
Hi,
You can save the centroid results into a different variable at the end of every loop - 'centroids_old', and then compute the Euclidean distance between 'centroids_old' and 'centroids' for every row.
distCovered(k) = sqrt(sum((centroids(k,:)-centroids_old(k,:)).^2));
You will have to take care of boundary cases, where a track is lost (a row in centroids deleted) or a track is created (a row added in centroids).
Additionally, you can refer to the following links as well :
  1. https://in.mathworks.com/help/vision/tracking-and-motion-estimation.html
  2. https://in.mathworks.com/help/vision/ug/motion-based-multiple-object-tracking.html

カテゴリ

Help Center および File ExchangeMATLAB Support Package for IP Cameras についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by