Drawing picture with straight lines (Petros Vrellis's Art)

radon = Radon[ColorNegate@ColorConvert[img, "Grayscale"]]

enter image description here

{w, h} = ImageDimensions[radon];
lhalf = Table[N@Sin[π i/h], {i, 0, h - 1}, {j, 0, w - 1}];
inverseDualRadon = 
  Image@Chop@InverseFourier[lhalf Fourier[ImageData[radon]]];
k = 50;
lines = ImageApply[
  With[{p = Clip[k #, {0, 1}]}, RandomChoice[{1 - p, p} -> {0, 1}]] &,
   inverseDualRadon]

enter image description here

ColorNegate@
 ImageAdjust[
  InverseRadon[lines, ImageDimensions[img], Method -> None], 
  0, {0, k}]

enter image description here


Abstractly, you might consider using the Radon transform in some way.

It is closely related to what you are looking for mathematically:

I would first simplify the image considerably before working with it:

simpler = MeanShiftFilter[monalisa, 2, .05, MaxIterations -> 100]

We then want to make it grey and run InverseRadon on it (after switching black with white unless you want to do white thread on a black background)

toPoints = 
 InverseRadon[ColorNegate@ColorConvert[simpler, "GrayScale"]]

We can then binarize the image. This is like choosing some points to represent lines we will draw. Then we use the Randon Transform to bring it back into an image.

ImageAdjust@ColorNegate@Radon@Binarize[toPoints]

enter image description here

So the job here is to turn this into something concrete where you can get the actual lines. You'll probably want to do some kind of discrete version of this.


I think the coolest thing would be to write a genetic algorithm approach like this guy's where you would start with a random set of lines with coordinates that change in a way that "evolves" and let it do its thing.

The next best thing would be to look for a builtin and ImageLines kinda works here.

try = EdgeDetect[GaussianFilter[ColorConvert[img, "GrayScale"], 3], 4];
Graphics@({Opacity[.04], Line@#} & /@ ImageLines[try, .06, .004])

enter image description here

I say "kinda" because both the image I produced and the results of my experimentation with the function look more like a girl-ghost from a Korean horror film than a masterpiece depicting a dame with an ambiguous smile. Having said that, with some experimentation you might find a good combination of feature extraction before applying ImageLines and I am guessing that's the right direction.