Awesome
Boruvka Superpixel
This code is a reimplementation of the superpixel segmentation based on Boruvka's minimum spanning tree algorithm: Xing Wei, Qingxiong Yang, Yihong Gong, Narendra Ahuja, and Ming-Hsuan Yang: Superpixel Hierarchy, IEEE Transactions on Image Processing 27, 4838 (2018) journal arXiv
build python module
- make module (in root directory of the repo)
this createspybuild/boruvka_superpixel.*.so
, which is to be imported from python
test python module
- ./src/boruvkasupix.py <input_img_path> <output_img_path> <n_supix>
example:- ./src/boruvkasupix.py test.png test_out.png 100
library interface
- c++ and python
- Data types supported: uint8, uint16, int8, int16, int32, float32, float64.
In all cases the internal data type is float32 as a compromise between precision and memory use. The data type of the arraysfeature
andborder_strength
inbuild_2d()
orbuild_3d()
should be the same, but it can be independent of the data type ofdata
inaverage()
.
dependencies
- python3
- numpy
- cython 0.28
- gcc/g++