Today we continue with the Sketch project. We use the web built-in cam in our opencv app to Sketch the image and display it but today we modify our app in order to have a video.
For doing this we have to follow some specific steps :
1.- Convert our image to gray scale, using cv2 library and cv2.cvtColor(p1,p2) function. Where p1 is the image we want to sketch and p2 is the color Gray in this case.
2.- Clean up resulting image from previous step, using cv2.GuassianBlur(p1,p2,p3) function from cv2 library. Where p1 is the image from previous step, p2 is Gaussian Kernel Size. [height width]. height and width should be odd and can have different values. If ksize is set to [0 0], then ksize is computed from sigma values. p3 is Kernel standard deviation along Y-axis (vertical direction). If sigmaY=0, then sigmaX value is taken for sigmaY
3.- Extract edges using function cv2.Canny(p1,p2,p3) from cv2 library. Where p1 is the image from previous step, p2 is the High threshold value of intensity gradient and p3 is the Low threshold value of intensity gradient.
4.- Invert binarize the image using function cv2.threshold(p1,p2,p3,p4) from cv2 library. Where p1 is the image from previous step, which is a Grayscale Image array, p2 is a value which is used to classify the pixel values, p3 is the value to be given if pixel value is more than (sometimes less than) the threshold value, and p4 is the type of thresholding to be applied.
That’s it you use your built in camera and voila, you should have your image sketch….
Look at the results!!!
Great content! Keep up the good work!
Quality articles is the crucial to attract the viewers
to go to see the web site, that’s what this site is
providing.
Hi there, after reading this amazing post i am as well cheerful to share my
knowledge here with colleagues.
I do trust all of the ideas you’ve presented for your post.
They are very convincing and will definitely work.
Nonetheless, the posts are very quick for beginners.
May just you please prolong them a bit from subsequent time?
Thanks for the post.
Everyone loves what you guys are usually up too. Such clever
work and reporting! Keep up the excellent works guys I’ve added you guys to
our blogroll.