(1) Apply a bilateral filter to the original color image, to reduce the color palette of the image, it also reduce the noise and preserve the edge information. Because edge detection is sensitive to noise, it’s important to reduce noise.
(2) Get the gray-scale image which will be used for edge detection. Use three different operators, Canny, Sobel and Laplacian respectively to get three different image edges and then sum them up.
(3)Create an edge mask from the summed edge image using adaptive thresholding.
(4)Combine the blurred color image with the edge mask to get the final image with cartoon effect.