3

I would like to build an algorithm that turns a picture into a scribble line that resembles the original picture. An example would be this: enter image description here

into this:

enter image description here

The second image is drawn by hand with one stroke. I am not sure where to begin experiments. My intuition would be to desaturate the image and simulate "drawing" a line with some quasi-randomness that draw more lines in places where the image is darker.

Ideally what I would like to get is a vector image in the end with one path.

Thank you

Disclaimer: I have already asked this question on dsp.stackexchange 3, but there was no answer. I am not sure if that was the right place to ask.

I realise this is not purely programming question, but maybe someone can point me in the right direction?

Community
  • 1
  • 1
Kuba Misiorny
  • 131
  • 1
  • 5
  • One strategy to reproduce the image with a single, continuous line is to stripple it and treat the output as a TSP problem, for which a appropriate solver will generate a path to be smoothed in the final step. In that case, you'll get a non-intersecting path. You could utilize Runge's phenomenon to create some more randomness on the smoothing step, not using spline interpolation. Still, there is some better technique required. – Lars Hadidi Jun 22 '17 at 11:38
  • Sergej Stoppel claims to have written an algorithm which does exactly what you want: https://www.kickstarter.com/projects/871698903/lineslab-custom-made-art-for-everyone?ref=user_menu Unfortunatelly, he hasn't pusblished any paper on that. – Lars Hadidi Jun 22 '17 at 11:38
  • +1 for interesting problem. The image is either cropped or not rendered with single curve (see the left side before left ear) . TSP sounds reasonable but I am not sure if the shortest path will be a good match for this. I would sort the random numbers spatially by the density somehow (or even better generate them in such way) and use as continuous piecewise control point feed for interpolation cubic or BEZIER ... without TSP first – Spektre Jun 23 '17 at 07:35
  • But the result is looking more like segmenting the image to similar intensity regions and fill them with random strokes to match intensity. – Spektre Jun 23 '17 at 08:43

2 Answers2

2

Try this ... not mine, but pretty neat. The 'files' tab of the code page contains the original image file. Processing is a fun language for doing this kind of stuff :-)

https://www.openprocessing.org/sketch/486307

1

Interesting option (less arty than your example =^) :

enter image description here

http://cgv.cs.nthu.edu.tw/projects/Recreational_Graphics/CircularScribbleArtsPoster

https://cgv.cs.nthu.edu.tw/publications

irJvV
  • 892
  • 8
  • 26