distance matrix of curves in python

前端 未结 3 1790
孤街浪徒
孤街浪徒 2020-12-15 00:33

I have a set of curves defined as 2D arrays (number of points, number of coordinates). I am calculating a distance matrix for them using Hausdorff distance. My current code

3条回答
  •  一个人的身影
    2020-12-15 00:46

    I recently replied on a similar quiestion here: Hausdorff distance between 3D grids

    I hope this helps, I faced with 25 x 25.000 points in a pairwise comparison (25 x 25 x 25.000 points in total), and my code runs from 1 min up to 3-4 hours (depending on the number of points). I don't see much options mathemtically for gaining speed.

    Alternatives can be to use different programming languages (C / C++) or bringing this calculation to GPU (CUDA). I am playing with the CUDA approach right now.

    Edit on 03/12/2015:

    I was able to speed up this comparison by doing parallel CPU based computation. That was the quickest way to go. I used the nice example of the pp package (parallel python) and I run on three different computer and phython combination. Unfortunately I had memory errors all the time with the python 2.7 32-bit, so I installed WinPython 2.7 64-bit and some experimental numpy 64-bit packages.

    So to me this effor was quite helpful an it was not as complicated to me as the CUDA.... Good luck

提交回复
热议问题