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
- Host: GitHub
- URL: https://github.com/mrquincle/emd-suite
- Owner: mrquincle
- Created: 2019-08-01T20:08:55.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2019-11-15T21:47:29.000Z (almost 6 years ago)
- Last Synced: 2025-01-22T09:42:52.746Z (9 months ago)
- Language: C++
- Size: 730 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
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 objectBuild:
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:

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