-
Notifications
You must be signed in to change notification settings - Fork 0
/
Data_Image_Enhancer.py
41 lines (32 loc) · 1.08 KB
/
Data_Image_Enhancer.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# @Author: Atul Sahay <atul>
# @Date: 2018-11-22T14:28:53+05:30
# @Email: atulsahay01@gmail.com
# @Last modified by: nilanjan
# @Last modified time: 2018-11-22T19:01:37+05:30
import os
import matplotlib.pyplot as plt
# from scipy import signal
# from scipy.io import wavfile
import numpy as np
import Enhancer as enh
# Note : First Create a folder name [] under the directory where the python
# file is kept
def image_enhancement(filename,dlen):
#Output for gamma_correction
# OUTPUT = "gamma_corrected_train/"+filename[dLen+1:-4]+".png"
# print("OUTPUT : ",OUTPUT)
# enh.gamma_correction(filename,OUTPUT,0.6)
OUTPUT = "adaptive_sharpened_train/"+filename[dLen+1:-4]+".png"
print("OUTPUT : ",OUTPUT)
enh.sharpness(filename,OUTPUT)
directory = 'validation'
dLen = len(directory)
for filename in os.listdir(directory):
print("filename"+str(filename))
if filename.endswith(".png"):
# print("dir: "+str(directory))
path = directory+"/"+filename
# print("path "+str(path))
image_enhancement(path,dLen)
else:
pass