How to do Time Series Heatmap?

Hi everyone,
I have body movement time series data (sampling rate 25Hz, 1 hour long) from 9 positions on the human body (head, L/R arm, L/R hand, L/R knee, L/R foot). And I wanted to create a "heat map movie" in Matlab to show how much people move during the 1-hour session.
I was thinking about using imagesc to create the heatmap but wasn't sure about to really apply it, considering that I need to make a movie using immovie. I also wanted to know how exactly I can apply the heatmap to the figure below:
I would really appreciate it if anyone can help with providing ideas.
Thanks much.

9 Comments

Could you upload some sample data?
Hi there,
Please see attached mat file for time and data. Thanks.
Both the data are of same size n*1. How a map can be plotted? I think you need to have location coordinates and the respective heat data wrt to time.
I have the n*1 data from 9 positions. And I think I can assign coordinates of the 9 positions onto the figure above. Then I would have 9 separate heat map. Will that also be feasible?
jonas
jonas on 9 Nov 2018
Edited: jonas on 9 Nov 2018
So this data is only a single position? I still don't know how to make a heatmap from a single column of data. As KSSV said, you need coordinates. Maybe things would be more clear if you explain what
"...show how much people move during the 1-hour session"
means
Are the numbers the x location of the 9 different body parts? If so, have 9 images (one for each body part) and sum the image onto a master canvass at the proper x and y location for that body part.
You guys are right. The data I attached is only for one position.
And I do assign each position a coordinate. And then I use fspecial() and imfilter() to generate density map, and then generate the heatmap using heatmap_overlay().
Using simulated data with a length of only 100, I managed to get a heatmap movie like the pic attached. However, for the real data, with a length of >80000 points, the iteration to generate density map and heatmap was super slow and used up the memory really quickly. My PC ran out of memory when i = 1000 ish, which is way less than 80000.
Any good idea on how to achieve this without exhausting the computer?
Thank you very much.
We can help on this..on knowing the code. If code is shown, we can see how it is and make necessary modifications if any to make the code fast. For this, you need to provide the full code with all variables and data given. Explain your next step in detail.
Hi KSSV,
I attached the main code heatmap_test.m and function heatmap_overlay.m as well as the body picture. I was testing only on one body position so I only enabled one set of coordinate. You can uncomment all other 8 eight sets to test if you'd like.
Please note that you can make a simulated dataset as testdata. It can be an 80000*1 double.
Thanks much for the help.

Sign in to comment.

Answers (0)

Categories

Asked:

on 8 Nov 2018

Commented:

on 14 Nov 2018

Community Treasure Hunt

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

Start Hunting!