Long time no see. I posted about 9 months, thinking that it would be bad if I didn't post it soon. This time, I wrote the code of'Beauty'using OpenCV of python and tried it. Please try it and compare before and after the image'Beauty'.
import cv2
image = cv2.imread('photo.jpg')
value = 20
image_dst = cv2.bilateralFilter(image,value,value * 2,value / 2)
cv2.imwrite('new_photo.png',image_dst)
cv2.namedWindow('image')
cv2.imshow('image',image_dst)
cv2.waitKey(0)
cv2.destroyAllWindows()
import cv2
image = cv2.imread('photo.jpg')
value = 20
image_dst = cv2.bilateralFilter(image,value,value * 2,value / 2)
cv2.imwrite('new_photo.png',image_dst)
If you want to create a window in advance and display the image read later. Use cv2.namedWindow (window_name, flag)
cv2.namedWindow('image')
cv2.imshow('image',image_dst)
Input wait time in milliseconds
cv2.waitKey(0)
A function that closes all windows created so far. If you want to close only a specific window, specify the window name you want to close in the cv2.destroyWindow () function.
cv2.destroyAllWindows()
This is the end of this "I tried'Beauty'with OpenCV". Thank you very much for reading.
Recommended Posts