Cartoon Effect
Cartoon Effect
Packages to study.
def cartoonify(ImagePath):
# read the image
originalmage = cv2.imread(ImagePath)
originalmage = cv2.cvtColor(originalmage, cv2.COLOR_BGR2RGB)
#print(image) # image is stored in form of numbers
4. Image Transformation
threshold value is the mean of the neighborhood pixel values area minus the
constant C. C is the constant subtracted from the weighted sum of
neighborhood pixels.
7. Make a mask
9. Sub Plotting
# Plotting the whole transition
images=[ReSized1, ReSized2, ReSized3, ReSized4, ReSized5, ReSized6]
fig, axes = plt.subplots(3,2, figsize=(8,8), subplot_kw={'xticks':[], 'yticks':[]}, gridspec_kw=dict(hspace=0.1,
wspace=0.1))
for i, ax in enumerate(axes.flat):
ax.imshow(images[i], cmap='gray')
//save button code
plt.show()