Peak detection in a 2D array 2.0

As my experimentations showed yesterday, when calculating the peak detection on the average of all paws (left/right all bunched together) you seem to get 5 toes in most dogs. I’ve started to exclude any dog that didn’t pass test, so that brings down the amount of dogs to about 16.

I decided to see how well it would perform if I only averaged over one measurement (typically 8 or more impacts), rather than having to load multiple measurements.

Average toe location positioned over a paw

As you can see here, to toe locations of the 'average' paw matched right paws very well, but actually needed to be mirrored for the left ones.

Average toes close to toe detections

So my next step became to test whether an impact preferred a left or right alignment of the toes. I did this by taking a slice around the average’s toes and compare the sums of the pressure within these slices (each slice has the size of the white box in the figures above).

Paw's toe's compared with the average locations

Improved toe detection thanks to average

This worked surprisingly well for identifying what kind of toe layout an impact preferred. Here we have four alternation columns comparing the ‘new’ toe detection based on the average paw and next to it, the vanilla toe detection on a standardized paw. As you can see, it found 5 toes in all trials and they even look like a paw!

I then wanted to see how this worked on different dogs.

Not quite perfect

Still not quite perfect

No clue what went wrong here

As you can see, it was still not perfect. For some reason the background filtering doesn’t work great on my standardized paws, which might be caused by the trimming. The standardizing cuts out the paw from anything under 10% of the maximal pressure, so there aren’t that many zero cells to subtract left.I kept tweaking things to try and improve things, like averaging over all paws and then using these toes for all measurements. But alas, nothing seemed to get rid of these unexplainable problems.

After getting fed up with all these ‘ghost’ toes popping up out of nowhere and the quite long processing time (because I had to average everything first before I could start comparing each paw again) I decided a radically different approach.

First I figured that I didn’t need to slice around the ‘average’ toe, because simply using the toe’s coordinate should work good enough. Furthermore, I decided to take a neutral positioning of the toes as a default. From there I would calculate the distance to each toe that was being found for that standardized paw and take the one that was the closest to the toe.

When I ran this over all the measurements, it not only ran pretty quickly, it turned out to find 5 toes in at least 80% of the trials. There were only 4 dogs where it performed sub-optimal at best with a 50% success rate and I haven’t looked into what was going wrong here.

Some other small quirks I have to solve:

  • Not allow the same toe to be picked twice
  • See how the standardizing can be improved to reduce the ‘noise’ that cause the toes on the edges to pop up
  • When picking between two peaks with a similar distance, take the one with the highest value, rather than the first.

Even without it being perfect, I’m very pleased with my current implementation and look forward to recalculate the pressure over time for each toe! As usual, you’ll hear back from me when I have new results and if you have any questions or suggestions: leave a comment!