GithubHelp home page GithubHelp logo

paulwalther / discrete-frechet Goto Github PK

View Code? Open in Web Editor NEW

This project forked from joaofig/discrete-frechet

0.0 0.0 0.0 118 KB

Implementation of the discrete Fréchet distance

License: MIT License

Python 17.69% Jupyter Notebook 82.31%

discrete-frechet's Introduction

discrete-frechet

A dive into the discrete Fréchet distance calculation, from the naïve approach to high-speed and memory-efficient optimizations.

The discrete Fréchet distance measures the similarity between two polygonal curves or polylines.

This repository contains four different implementations of the discrete Fréchet distance calculation.

Medium Articles

How long should your dog leash be?

Fast Discrete Fréchet Distance

Using the Code

The DFD classes live in the distances package. They are:

  • DiscreteFrechet: The classic dynamic programming implementation using recursion and a NumPy array to store the distance data.
  • LinarDiscreteFrechet: The linearized implementation of the previous algorithm avoiding recursion.
  • FastDiscreteFrechetSparse: Implements the improved algorithm and uses a sparse array to store the distance data. The sparse array is implemented as a dictionary.
  • FastDiscreteFrechetMatrix: Same as above but uses a full-sized NumPy array to store the distance data. This is the fastest implementation of all.

To use the code, select the class to instantiate and initialize it with one of the following distance functions:

  • euclidean: Standard euclidean distance
  • haversine: Haversine distance on a unit sphere
  • earth_haversine: Calculates the haversine distance on the Earth's surface in meters

All distance functions take the point parameters as NumPy arrays and return the distance as a single float. The haversine distance functions reverse the parameter indexing order. Instead of (x, y), they take (lat, lon). The hearth_haversine function takes its inputs in decimal degrees.

Use the distance function of your selected class to calculate the DFD.

discrete-frechet's People

Contributors

joaofig avatar dependabot[bot] avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.