An open API service indexing awesome lists of open source software.

https://github.com/mrquincle/emd-suite

Earth Mover's Distance - Variants
https://github.com/mrquincle/emd-suite

Last synced: 7 months ago
JSON representation

Earth Mover's Distance - Variants

Awesome Lists containing this project

README

          

# Matching

A match.txt file is generated by the file `test_squares_meanshift.cpp`. This file is currently set up to operate on
2D point clouds. It is built up like this:

* approxmatch_cpu takes two point clouds and generates a match matrix as well as two offset vectors, one for each point cloud
* it calls calc_offset that is defined in sort_indices.c
* in sort_indices there are two implementations, one takes fixed neighbours, the other a fixed window
* only a fixed window works, if we shift with only a fixed number of neighbours, the shift does typically not shift the entire object or it does not shift only one object, but multiple to the origin
* the disadvantage of a fixed window is that you have to guess beforehand the extend of an individual object

Build:

mkdir -p build && cd build && cmake .. && make

Run in the `build` directory:

./emd-suite --method shift

This will generate several `.txt` files in the `output/shift` directory. The other method option is `default`.

## Visualization

The `display_match.m` octave script takes two point clouds and a matching file.

The matches are subsequently visualized by drawing lines of various thickness between the two point clouds.

Run in the `analyse` directory:

./display_match.m ../build/cloud1.txt ../build/cloud2.txt ../build/match.txt

The `R` scripts (using `ggplot2`) lead to visualization that are a little bit more beautiful than the `octave` scripts:

./display_match.R ../build/cloud1.txt ../build/cloud2.txt ../build/match.txt

An example of the **EMD** variant using a mean-shift approach is shown here:

![EMD mean-shift](docs/match.png)

Note how the structure is preserved. The source square in the middle maps to the target squares (bottom-left and top-right).
The corners map neatly to the corners of these objects.

# Copyrights

Copyrights belong to A.C. van Rossum (2019)

License: LGPLv3, MIT, Apache License