What are cartoon images?
The specific means have evolved, however, the trendy usage typically refers to either: a picture or series of pictures supposed for humor, caricature, or humor;
What is computer vision?
Computer vision could be a field of computer science that trains computers to interpret and perceive the visual world. mistreatment digital pictures from cameras and videos and deep learning models, machines will accurately determine and classify objects — and so react to what they “see.”
Lets start with python programming
step 1: import cv and numpy libaray
import cv2
import numpy as np
step 2: Read the any images
image =cv2.imread("filepath_name/bili.png")
Step 3: convert images BGR to GRAY and Read Edges of images
gray = cv2.cvtColor(image, cv2.Color_BGR2GRAY)
gray = cv2.medianBlur(gray,6)
What is Adaptive Threshold ?
Like international thresholding, adaptive thresholding is employed to separate fascinating foreground image objects from the background supported the distinction in pel intensities of every region. ... this permits for thresholding of a picture whose international intensity bar chart does not contain distinctive peak
Edge= cv2.adaptiveThreshold(gray,255,
cv2.ADAPTIVE_THRESH_MEAN_C,
CV2.THRESH_BINARY,9,9)
Step 4: covert original images to cartoon images using bilateral filter
What is Bilateral Filter?
A bilateral filter may be a non-linear, edge-preserving, and noise-reducing smoothing filter for pictures. It replaces the intensity of every element with a weighted average of intensity values from close pixels. This weight will be supported by a distribution.
colour=cv2.bilateralFilter(image, 9,250,250)
cartoon_img =cv2.bitwise_and(colour, color, mask=Edge)
Step 5 : show the images using imshow
cv2.imshow("IMAGES", image)
cv2.imshow("EDGES", Edge)
cv2.imshow("CARTOONS", cartoon_img)
Step 6:Hold the screen
cv2.waitKey(0)
cv2.destroyAllWindows()
Step 7: Run this code and enjoy it
Thanks for this precious information
ReplyDelete