A python adaptation from the method described in the paper Sequential image segmentation based on minimum spanning tree representation.
@article{SAGLAM2017155,
title = "Sequential image segmentation based on minimum spanning tree representation",
journal = "Pattern Recognition Letters",
volume = "87",
pages = "155-162",
year = "2017",
issn = "0167-8655",
doi = "https://doi.org/10.1016/j.patrec.2016.06.001",
url = "http://www.sciencedirect.com/science/article/pii/S0167865516301192",
author = "Ali Saglam and Nurdan Akhan Baykan"
}
The code depends on the following third-party libraries:
- fibheap 0.2.1
pip install fibheap
python Demo_clustering.py
m
: The coefficient of the parameters c
that calculated automatically using the differential of the PSR-MST in the source paper. If no value is given, the default value is 3
.
l
: The length of the scanning frame (sub-string) that scans through the PSR-MST. If no value is given, the default value is "scale"
that computed by int( sqrt(datasize) / 2
).
labels = sequential_clustering(data)
-----> m = 3, l = "scale"
labels = sequential_clustering(data, m = 4)
-----> l = "scale"
labels = sequential_clustering(data, m = 4, l = 10)
@article{SAGLAM2017155,
title = "Sequential image segmentation based on minimum spanning tree representation",
journal = "Pattern Recognition Letters",
volume = "87",
pages = "155-162",
year = "2017",
issn = "0167-8655",
doi = "https://doi.org/10.1016/j.patrec.2016.06.001",
url = "http://www.sciencedirect.com/science/article/pii/S0167865516301192",
author = "Ali Saglam and Nurdan Akhan Baykan"
}