Home

Awesome

PolyFit: Clip-art vectorization

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.

Building

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.

Running

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.

Data

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

Dependencies

The code depends on the following libraries, but they should be handled automatically through git submodule.

Some of the known problems

TODOs

Contact

Feel free to reach out at edoaramis at gmail.com for questions regarding the code.