-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdark_correction_main.py
62 lines (42 loc) · 1.32 KB
/
dark_correction_main.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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
import imageio
from matplotlib import pyplot as plt
from PIL import Image
from combination_algos import *
def dark_res():
#path = './data/Darks/Darks1.NEF'
#base = './data/Lights/darktable_exported/Lights'
base = './data2/Darks/Darks'
length = 2
paths = [f'{base}{i}.jpg' for i in range(1,length+1)]
rgb_vec = []
for path in paths:
print(path)
rgb = imageio.imread(path)
rgb_vec.append(rgb)
rgb = combination_alogs(rgb_vec, ALGO.TURKEYS_BIWEIGHT)
rgb = rgb.as_type('uint8')
img = Image.fromarray(rgb)
img.show()
def aron_main():
#path = './data/Darks/Darks1.NEF'
#base = './data/Lights/darktable_exported/Lights'
#base = './data2/Darks/Darks'
base = './data2/lights/Lights'
path_dark = './data2/DARK_12_FULL_RES.PNG'
length = 1
paths = [f'{base}{i}.jpg' for i in range(1,length+1)]
rgb_vec = []
for path in paths:
print(path)
rgb = imageio.imread(path)
rgb_vec.append(rgb)
rgb = combination_alogs(rgb_vec, ALGO.NO_REJECTION)
img = Image.fromarray(rgb)
img.show()
dark = imageio.imread(path_dark)
rgb = np.abs(rgb - dark[0:2848,0:4316,:])
img = Image.fromarray(rgb)
img.show()
#plt.imshow(img)
#plt.show()
aron_main()