Produce pencil drawing from natural images.
-
The algorithm is mainly based on "Combining Sketch and Tone for Pencil Drawing Production" Cewu Lu, Li Xu, Jiaya Jia, International Symposium on Non-Photorealistic Animation and Rendering (NPAR 2012), June, 2012 (http://www.cse.cuhk.edu.hk/~leojia/projects/pencilsketch/pencil_drawing.htm)
-
In the edge detection step, instead of the gradient method provided in the paper, bilateral filter and Laplacian edge detection are used to generate a less noisy image, which significantly impact the quality of final result in this implementation.
- https://blog.csdn.net/qibofang/article/details/51482431
- https://www.cnblogs.com/Imageshop/p/4285566.html
- https://blog.csdn.net/bluecol/article/details/45422763
- Modules required: numpy, scipy, Pillow, opencv-python, matplotlib.
- Textures of pencil sketch are provide in directory "textures" if required.
Call function pencilSketch() to run the program, you can also specify the parameters to change the looking of out image. For details of parameters please check the comment in source code and the references.
The default directory program looks for input and texture images are "soure_images" and "textures", you can modify the folders' name by specifying them when calling the function. The output colored and grayscale pencil sketch images are saved in folder output. The intermediate images are saved in folder temp.