I want to compare two 2D paths (arrays of points) for similarity, and, if possible, get a percentage of how similar the paths are (100% is identical, 0% completely different)
A path in this case is:
- an ordered array, of zero or greater length, of coordinates (x, y)
- continuous
- basically a polyline
Paths may overlap and contain a different number of points. Position and scale doesn't matter, i.e. two otherwise identical paths can be far apart, and one can be smaller than the other, and they will be found to be the same.
The only criteria for similarity is the shape the paths make, and the order of the coordinates i.e. a vertical line drawn top to bottom is different to a vertical line drawn bottom to top (although the order is the least important, solutions are welcome without meeting that criteria).
So in the image below, the green path would be found to be identical to the black one, the blue one would be maybe ~80% similar, and the red path would be maybe <1% similar.
I've searched the web and can't find anything that quite fits my criteria and situation - ideally it's not going to be complex like neural networks.
