30
loading...
This website collects cookies to deliver better user experience
This is Day 25 of the #100DaysOfPython challenge.
oil-paint-effect-with-open-cv-python
directory and install Pillow.# Make the `oil-paint-effect-with-open-cv-python` directory
$ mkdir oil-paint-effect-with-open-cv-python
$ cd oil-paint-effect-with-open-cv-python
$ touch main.py
# Init the virtual environment
$ pipenv --three
$ pipenv install opencv-python opencv-contrib-python
# if you have issues with a hanging lockfile, try add the --skip-lock option
base_img.jpg
to the directory (which will be an image from Unsplash).base_img
(assuming you are following the directory structure where the notebook is in the docs
folder).import cv2
img = cv2.imread('./base_img.jpg')
res = cv2.xphoto.oilPainting(img, 7, 1)
cv2.imshow("original", img)
cv2.imshow("res", res)
cv2.waitKey(0)
cv2.destroyAllWindows()
OpenCV
package to programmatically apply an oil painting effect to an image.dancristianp