Code & Data for the SIGGRAPH 2020 paper PolyFit: Perception-Aligned Vectorization of Raster Clip-art via Intermediate Polygonal Fitting
The code has only been tested on Windows x64 with the Visual Studio 2017 compiler, for other platforms the active issue is here.
We have a pre-release executable available as well.
git clone --recursive https://github.com/dedoardo/polyfit
Open the folder or CMake generated solution in Visual Studio (use a 2017 compiler) and build polyfit.exe in Release(WithDebInfo) mode, the output will be written to the cmake source directory.
polyfit.exe "data/binary_input/pear-32/input.png" "trained/random_forest_paper.txt" curves-fill.svg
The output will be written to curves-fill.svg
If you are interested in visualizing different stages of the algorithm, build polyfit_stages.cpp
instead and uncomment the respective lines relatives to the stages you are interested in visualizing. The usage is identical, except for the last argument which is a directory where the various stages will be written to as svgs.
All the results shown in the paper and used in the user study are contained in the data directory.
If you want to generate all the results as shown in the paper, copy the polyfit.exe executable in the root directory and run the following Python3 script. Alternatively, you can obtain the executable from one of the releases.
python scripts/run_data_baseline.py
The code depends on the following libraries, but they should be handled automatically through git submodule.
- Complex pixel-art will likely not work as the multicolor code hasn't been tested on it.
- Visual Studio 2019 might not work, we encountered some problems with incorrect variable initialization.
- Add instructions for training data
- Debug pixel-art
Feel free to reach out at edoaramis at gmail.com for questions regarding the code.