cjekel / similarity_measures

Quantify the difference between two arbitrary curves in space
MIT License
246 stars 41 forks source link

get aligned points between two curve or trajectory #24

Open miladad8 opened 2 years ago

miladad8 commented 2 years ago

is there any way to get aligned and matched points between two compared trajectory or curves in frechet distance?

thank you very much.

cjekel commented 2 years ago

The dtw_path method returns this. Check out the example in the docstring.

On Mon, Sep 5, 2022, 03:34 miladad8 @.***> wrote:

is there any way to get aligned and matched points between two compared trajectory or curves.

thank you very much.

— Reply to this email directly, view it on GitHub https://github.com/cjekel/similarity_measures/issues/24, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADJ5Z4LR4M7KPSKY4YL6OK3V4W5CJANCNFSM6AAAAAAQEZ4544 . You are receiving this because you are subscribed to this thread.Message ID: @.***>

miladad8 commented 2 years ago

Thank you. Are the similarity path in DTW and Frechet the same for a pair of trajectories? I have a couple of trajectories and i want to return the similarity path between my target trajectory and the most similar trajectory( retrieved from frechet distance). Can I use the frechet metric for returning the most similar trajectory, and then use the dtw_path for returning the similarity path?

cjekel commented 2 years ago

It's not a one to one if that makes sense. The frechet distance is like the shortest leash, while DTW is more like a cumulative leash (or distance).

That said, I don't know your use cases. If you need a number to judge similarity, then the frechet distance is fine. If you also need a path trajectory, then the dtw path is fine.

miladad8 commented 2 years ago

I was hoping i could use every metrics separately for similarity score and similarity path. I know it is possible in both DTW and LCSS to get the similarity value and the similarity path separately. But I am not sure it is possible in Frechet distance. So far all the implementations I've seen are just return the similarity value. I don't care for one to one alignments in similarity path and it makes sense that one point aligns to multiple points and that's what I get in DTW right now. I'm looking for a similarity path specific to Frechet.

cjekel commented 2 years ago

I think it's okay to use the metrics separately.

It does not really make sense to get a similarity path specific to Frechet. It is not really a path. It is more like a single point from each curve, because the distance between those two points is the discrete Frechet distance. You can think of those points as the limiting points for the 'shortest leash'.