April 2020
Intermediate to advanced
438 pages
12h 2m
English
There are a few more edge detection techniques, such as Canny (with hysteresis thresholds), that you can try to produce sketches from images. You can try them on your own and compare the sketches obtained using different algorithms. Also, by using OpenCV-Python's pencilSketch() and sylization() functions, you can produce black and white and color pencil sketches, as well as watercolor-like stylized images, with the following few lines of code:
import cv2import matplotlib.pylab as pltsrc = cv2.imread('images/bird.png')#dst = cv2.detailEnhance(src, sigma_s=10, sigma_r=0.15)dst_sketch, dst_color_sketch = cv2.pencilSketch(src, sigma_s=50, sigma_r=0.05, shade_factor=0.05)dst_water_color = cv2.stylization(src, sigma_s=50, sigma_r=0.05) ...Read now
Unlock full access