Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions image_to_sketch/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
## USER GUIDE

### Pre-requisites
```
1) Python Opencv
$ pip install opencv-contrib-python
```
### How to run the script?
1) Please the edit the script with the source file location and the destination file location of the photo to be sketched.
2) Run the python script
```
$ python image_to_sketch.py
```
Once done the script will prompt with the sketched destination folder.
11 changes: 11 additions & 0 deletions image_to_sketch/image_to_sketch.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import cv2

# Add the source file path here
image_source = "<img_source_path/img_name.jpg"
# Add the destination file path here
image_destination = "/img_destination_path/img_name.jpg"

img = cv2.imread(image_source)
dst_gray, dst_color = cv2.pencilSketch(img, sigma_s=60, sigma_r=0.07, shade_factor=0.05)
cv2.imwrite(image_destination, dst_gray)
print("Your Sketched image got saved in" + image_destination + "....")