Skip to content

Latest commit

 

History

History
56 lines (25 loc) · 2.13 KB

File metadata and controls

56 lines (25 loc) · 2.13 KB

Knitting

Duan Gao

Overview

Implementation details

For every candidate path, we need to draw the path (many lines) in a canvas.

There are two types of drawing:

  • Error computation: each pixel value is the number of threads covering the pixel OR the total length of threads covering the pixel. (canvas resolution is the same as input image in error computation)

    I implement these two strategies in Image::DrawLineCount() and Image::DrawLineLength().

  • Visualization (or realization): each pixel is either 1 or 0 (we can adjust the resolution of canvas to get the best visual quality, the default resolution of canvas in visualization is 4k )

Examples

me me

dog dog

From images to GIF:

$ python scripts/img2gif.py --src_path xxx --dst_path [--resolution 200]

Comparison of different gray image as guide:

R channel Average Gray Lumiance
vis_990000 vis_990000 vis_990000 vis_990000

gray = 0.2989 * r + 0.5870 * g + 0.1140 * b

lumiance = 0.212671 * r + 0.715160 * g + 0.072169 * b