8

Good Day,

I have two different paths in a 2D plane. I want to compare these two paths with the Fréchet Distance.

I know some points of the trajectories, each is connected to another point with a straight line.

What's the smartest way to get the Fréchet Distance? Any hints? I'm working in Python.

Gulzar
  • 23,452
  • 27
  • 113
  • 201
Max Kraus
  • 137
  • 3
  • 9

2 Answers2

0

You can use implemetation from here https://pypi.org/project/frechetdist/ or from here https://pypi.org/project/similaritymeasures/

Generally speaking, when you measure Frechet distance you can always (in the terminology of walking person and dog)

  • A. move person further,
  • B. move your dog further,
  • C. move both further,

At each step you can do A, B, C get minimum(A,B,C) and append to results list. After finishing both trajectories get max() of your results list.

s.paszko
  • 633
  • 1
  • 7
  • 21
0

It appears that the implementation in https://pypi.org/project/frechetdist/ is limited to scenarios where the 2 paths must have equal lengths.

I found this repo: https://github.com/joaofig/discrete-frechet where the author made some improvements over the dynamic programming approach.

Jason
  • 2,950
  • 2
  • 30
  • 50