How do I calculate and plot the average velocity of a path as a heat map?

4 views (last 30 days)
I have video of animals moving through a bush. I have tracked their position every 5 minutes and calculated the velocity of each animal between each position. I want to try to create a heatmap overlay of the average velocity of each animal in a defined grid space in the image, and eventually the average velocity of all the animals at each grid.
Ex. Say this is the grid I have chosen
- - - - -
|*| | | | |
- - - - -
| | | |*| |
- - - - -
| | | | | |
- - - - -
| | |*| | |
- - - - -
| | | | | |
- - - - -
The problem I have is that I have velocities just at each point and each point is within a larger bin (above is just the large bins). Also, I don't know how to assign the velocity to the squares in between points. I'm wondering how I can easily interpolate this data along the path and for the end points calculate the average velocity of segment 1 and 2.
Below is some sample data.
X Y Velocity 412 180 0 406 172 2 414 174 1.649 424 188 3.441 404 148 8.944
and my bins are 48x36
The only solution I can think of is interpolate linearly for all the points in the image (not the grid) and then bin average them together to get my grid. Is there any easier way?
Sorry very confused.

Answers (1)

Image Analyst
Image Analyst on 24 Feb 2013
Try TriScatteredInterp() to fill in the missing data.

Categories

Find more on Animation in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!