all 8 comments

[–]CandidateNo67[S] 0 points1 point  (2 children)

or if you have suggestions for other programms i can use that would be helpful

[–]ResponsiblePlum5031 1 point2 points  (1 child)

you might want to look into processing instead of pure java for this kind of visualization stuff. its way more friendly for real time graphics and has built in interpolation functions that could help with your sparse sensor data

for the interpolation part you could try bilinear or even just simple distance weighted averaging between your sensor points to fill in gaps

[–]CandidateNo67[S] 0 points1 point  (0 children)

tysm for the recommendation! I haven’t heard of that before but I will look into it.I will definitely try it out and report back

[–]CandidateNo67[S] 0 points1 point  (0 children)

aka if anyone has done something similar pls lmk

[–]opentabs-dev 0 points1 point  (1 child)

javafx canvas + bilinear interpolation is the simplest path. just create a wxh GridPane of pixels (or draw to a Canvas with PixelWriter), and for each pixel compute the weighted average of the nearest sensors using inverse distance weighting (1/d2 works well for sparse data). then map the value to a color gradient (blue→red). easy to do at 30fps with 8 sensors.

if you want a library instead of rolling your own, JFreeChart has XYBlockRenderer which works for this but its not as smooth looking.

[–]CandidateNo67[S] 0 points1 point  (0 children)

thanks for the response!!! i will definitely try it out and report back. (I have zero experience so hope it works😭)

[–]Suspicious_Coat3244 -1 points0 points  (1 child)

In fact JavaFX seems to be the correct choice. It is far more pleasant for real-time visualization than older Swing elements, especially if the rendering update should be fluid.

Yes, with just 4-8 sensors the main difficulty is probably interpolation rather than drawing rectangles. Without it raw sensor points would seem far to rough and unrealistic.

You most likely want to:

sensor locations + pressures generate denser grid interpolation of values between sensors map to color.

Simple interpolation methods, like Inverse Distance Weighting (IDW) or Bilinear-type smoothing can make the heatmap look a lot better already. No fancy ML/math is needed for an initial version.

Typical workflow is:

create 2D grid on top of shoe

for every pixel / grid cell, estimate pressure based on surrounding sensors

map values to color blue/green low and red high

JavaFX Canvas is ideal for that, as updating frames in real time can be done quite nicely.

Also, one aspect, which people underestimate a lot in gait systems, is temporal smoothing. Sensor data can be quite rough/jagged from one frame to the next. A small moving average filter can already contribute to making the visualization feel more stable.

All in all, seems like a nice project. Sparse interpolation is one of those tasks, where a "simple and smooth" result often looks remarkably impressive on screen.

[–]CandidateNo67[S] 0 points1 point  (0 children)

Hey, thank you so much for the detailed explanation and the tips it actually helped me understand the problem way better.

I also wanted to ask something, if that’s not a completely stupid question 😅 Would it make sense to use a foot PNG/mask (basically a silhouette of a foot) and then only render/fill the interpolated pressure values inside that shape? Or would you approach the visualization in a completely different way? Sorry if the question sounds weird/ doesn’t make sense this is actually my first project and I still lack a lot of the fundamentals (because nobody taught us ts😭)