0

I need an application which converts any image to pencil drawing (Not sketch ) like artist does. Exactly like the step2 from step 1 in this question. I have tried the following options.

1- What is the best approach for my requirement ?

2- What are we specifying with the argument string 0x1+10%+20% in cany detection ?

3- How can I remove the pencil shades in photocopy and just get the important outline only ?

4- Is there any other image editing tools out there which fits best ?

Community
  • 1
  • 1
Bill Goldberg
  • 1,699
  • 5
  • 26
  • 50

1 Answers1

4

I hope the following helps. The functions used below are readily available in OpenCV. You can give it a try.

This is the image I am using for reference:

enter image description here

Pencil Sketching:

sketch_gray, sketch_color = cv2.pencilSketch(img, sigma_s=60, sigma_r=0.07, shade_factor=0.05)

Output of sketch_gray, which is the pencil sketch of the gray scale image:

enter image description here

Output of sketch_color, which is the pencil sketch of the color image:

enter image description here

You can limit the amount of shade in the output by varying the shade_factor in the function cv2.pencilSketch.

And as a bonus cv2.stylization:

stylize = cv2.stylization(img, sigma_s=60, sigma_r=0.07)

enter image description here

Jeru Luke
  • 20,118
  • 13
  • 80
  • 87
  • You can obtain **pencil drawing** by varying the `shade_factor` as mentioned. – Jeru Luke Feb 06 '17 at 18:21
  • Thanks @Jeru Luke : How about a passport size photograph work with this ? I will switch from image magick to opencv after waiting few more replies. – Bill Goldberg Feb 06 '17 at 19:03
  • @BillGoldberg I have never tried it. Why not give it a shot? Just vary the `shade_factor` as mentioned. :) – Jeru Luke Feb 07 '17 at 04:10