-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathgetGBTransmission.py
47 lines (35 loc) · 1.83 KB
/
getGBTransmission.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
import numpy as np
import math
def getGBTransmissionESt(transmissionR,AtomsphericLightTM):
depth_map = np.zeros(transmissionR.shape)
for i in range(0,transmissionR.shape[0]):
for j in range(0, transmissionR.shape[1]):
depth_map[i,j] = math.log(transmissionR[i,j],0.82)
# if(depth_map[i,j]>15):
# depth_map[i, j] = 15
# if (depth_map[i, j] < 1):
# depth_map[i, j] = 1
transmissionG = 0.93 ** depth_map
transmissionB = 0.95 ** depth_map
# transmissionG = np.zeros(transmissionR.shape)
# transmissionB = np.zeros(transmissionR.shape)
# ratioB = (AtomsphericLightTM[2] * (-0.00113 * 450 + 1.62517) )/(AtomsphericLightTM[0] * (-0.00113 * 620 + 1.62517))*1.3
# ratioG = (AtomsphericLightTM[2] * (-0.00113 * 540 + 1.62517) )/(AtomsphericLightTM[1] * (-0.00113 * 620 + 1.62517))*1.2
# print('ratioB',ratioB)
# print('ratioG',ratioG)
# transmissionG = transmissionR ** ratioG
# transmissionB = transmissionR ** ratioB
# print('getGBTransmissionESttransmissionB',transmissionB)
return transmissionB,transmissionG,depth_map
# def getGBTransmissionESt(transmissionR,AtomsphericLightTM):
# # transmissionG = np.zeros(transmissionR.shape)
# # transmissionB = np.zeros(transmissionR.shape)
# ratioB = (AtomsphericLightTM[2] * (-0.00113 * 450 + 1.62517) )/(AtomsphericLightTM[0] * (-0.00113 * 620 + 1.62517))
# ratioG = (AtomsphericLightTM[2] * (-0.00113 * 540 + 1.62517) )/(AtomsphericLightTM[1] * (-0.00113 * 620 + 1.62517))
# print('ratioB',ratioB)
# print('ratioG',ratioG)
# transmissionG = transmissionR ** ratioG
# transmissionB = transmissionR ** ratioB
# print('getGBTransmissionESttransmissionB',transmissionB)
#
# return transmissionB,transmissionG