Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit fe0d701

Browse files
authored
Update Ghost filter code.py
1 parent 04646ad commit fe0d701

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

‎Ghost filter/Ghost filter code.py‎

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
import matplotlib.pyplot as plt
22
import numpy as np
33
import cv2
4+
import os.path
5+
46
# take path of the image as input
5-
img_path = input() #example -> C:\Users\xyz\OneDrive\Desktop\project\image.jpg
7+
img_path = input("Enter the path here:") #example -> C:\Users\xyz\OneDrive\Desktop\project\image.jpg
68
img = cv2.imread(img_path)
79

810
#plt.imshow(img)
@@ -31,5 +33,9 @@
3133
plt.figure(figsize= (10,10))
3234
plt.imshow(array)
3335
plt.axis('off')
34-
plt.savefig("squares.png")
36+
37+
filename = os.path.basename(img_path)
38+
#print(filename)
39+
40+
plt.savefig(filename+"(Filtered).jpg")
3541
plt.show() #real ghost filtered photo

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /