Coverage for blindness/datasets/machado2010.py: 0%

11 statements  

« prev     ^ index     » next       coverage.py v7.11.0, created at 2025-11-16 22:49 +1300

1""" 

2Pre-Computed Matrices for simulation of CVD - Machado (2009) 

3============================================================ 

4 

5Define the pre-computed matrices for simulation of colour vision deficiency 

6from Machado (2010). 

7 

8References 

9---------- 

10- :cite:`Machado2010a` : Machado, Gustavo Mello. (2010). A model for 

11 simulation of color vision deficiency and a color contrast enhancement 

12 technique for dichromats. (pp. 1-94). 

13 http://www.lume.ufrgs.br/handle/10183/26950 

14""" 

15 

16import numpy as np 

17 

18from colour.utilities import CanonicalMapping 

19 

20__author__ = "Colour Developers" 

21__copyright__ = "Copyright 2013 Colour Developers" 

22__license__ = "BSD-3-Clause - https://opensource.org/licenses/BSD-3-Clause" 

23__maintainer__ = "Colour Developers" 

24__email__ = "colour-developers@colour-science.org" 

25__status__ = "Production" 

26 

27__all__ = [ 

28 "CVD_MATRICES_MACHADO2010", 

29] 

30 

31CVD_MATRICES_MACHADO2010: CanonicalMapping = CanonicalMapping( 

32 { 

33 "Protanomaly": { 

34 0.0: np.array( 

35 [ 

36 [1.000000, 0.000000, -0.000000], 

37 [0.000000, 1.000000, 0.000000], 

38 [-0.000000, -0.000000, 1.000000], 

39 ] 

40 ), 

41 0.1: np.array( 

42 [ 

43 [0.856167, 0.182038, -0.038205], 

44 [0.029342, 0.955115, 0.015544], 

45 [-0.002880, -0.001563, 1.004443], 

46 ] 

47 ), 

48 0.2: np.array( 

49 [ 

50 [0.734766, 0.334872, -0.069637], 

51 [0.051840, 0.919198, 0.028963], 

52 [-0.004928, -0.004209, 1.009137], 

53 ] 

54 ), 

55 0.3: np.array( 

56 [ 

57 [0.630323, 0.465641, -0.095964], 

58 [0.069181, 0.890046, 0.040773], 

59 [-0.006308, -0.007724, 1.014032], 

60 ] 

61 ), 

62 0.4: np.array( 

63 [ 

64 [0.539009, 0.579343, -0.118352], 

65 [0.082546, 0.866121, 0.051332], 

66 [-0.007136, -0.011959, 1.019095], 

67 ] 

68 ), 

69 0.5: np.array( 

70 [ 

71 [0.458064, 0.679578, -0.137642], 

72 [0.092785, 0.846313, 0.060902], 

73 [-0.007494, -0.016807, 1.024301], 

74 ] 

75 ), 

76 0.6: np.array( 

77 [ 

78 [0.385450, 0.769005, -0.154455], 

79 [0.100526, 0.829802, 0.069673], 

80 [-0.007442, -0.022190, 1.029632], 

81 ] 

82 ), 

83 0.7: np.array( 

84 [ 

85 [0.319627, 0.849633, -0.169261], 

86 [0.106241, 0.815969, 0.077790], 

87 [-0.007025, -0.028051, 1.035076], 

88 ] 

89 ), 

90 0.8: np.array( 

91 [ 

92 [0.259411, 0.923008, -0.182420], 

93 [0.110296, 0.804340, 0.085364], 

94 [-0.006276, -0.034346, 1.040622], 

95 ] 

96 ), 

97 0.9: np.array( 

98 [ 

99 [0.203876, 0.990338, -0.194214], 

100 [0.112975, 0.794542, 0.092483], 

101 [-0.005222, -0.041043, 1.046265], 

102 ] 

103 ), 

104 1.0: np.array( 

105 [ 

106 [0.152286, 1.052583, -0.204868], 

107 [0.114503, 0.786281, 0.099216], 

108 [-0.003882, -0.048116, 1.051998], 

109 ] 

110 ), 

111 }, 

112 "Deuteranomaly": { 

113 0.0: np.array( 

114 [ 

115 [1.000000, 0.000000, -0.000000], 

116 [0.000000, 1.000000, 0.000000], 

117 [-0.000000, -0.000000, 1.000000], 

118 ] 

119 ), 

120 0.1: np.array( 

121 [ 

122 [0.866435, 0.177704, -0.044139], 

123 [0.049567, 0.939063, 0.011370], 

124 [-0.003453, 0.007233, 0.996220], 

125 ] 

126 ), 

127 0.2: np.array( 

128 [ 

129 [0.760729, 0.319078, -0.079807], 

130 [0.090568, 0.889315, 0.020117], 

131 [-0.006027, 0.013325, 0.992702], 

132 ] 

133 ), 

134 0.3: np.array( 

135 [ 

136 [0.675425, 0.433850, -0.109275], 

137 [0.125303, 0.847755, 0.026942], 

138 [-0.007950, 0.018572, 0.989378], 

139 ] 

140 ), 

141 0.4: np.array( 

142 [ 

143 [0.605511, 0.528560, -0.134071], 

144 [0.155318, 0.812366, 0.032316], 

145 [-0.009376, 0.023176, 0.986200], 

146 ] 

147 ), 

148 0.5: np.array( 

149 [ 

150 [0.547494, 0.607765, -0.155259], 

151 [0.181692, 0.781742, 0.036566], 

152 [-0.010410, 0.027275, 0.983136], 

153 ] 

154 ), 

155 0.6: np.array( 

156 [ 

157 [0.498864, 0.674741, -0.173604], 

158 [0.205199, 0.754872, 0.039929], 

159 [-0.011131, 0.030969, 0.980162], 

160 ] 

161 ), 

162 0.7: np.array( 

163 [ 

164 [0.457771, 0.731899, -0.189670], 

165 [0.226409, 0.731012, 0.042579], 

166 [-0.011595, 0.034333, 0.977261], 

167 ] 

168 ), 

169 0.8: np.array( 

170 [ 

171 [0.422823, 0.781057, -0.203881], 

172 [0.245752, 0.709602, 0.044646], 

173 [-0.011843, 0.037423, 0.974421], 

174 ] 

175 ), 

176 0.9: np.array( 

177 [ 

178 [0.392952, 0.823610, -0.216562], 

179 [0.263559, 0.690210, 0.046232], 

180 [-0.011910, 0.040281, 0.971630], 

181 ] 

182 ), 

183 1.0: np.array( 

184 [ 

185 [0.367322, 0.860646, -0.227968], 

186 [0.280085, 0.672501, 0.047413], 

187 [-0.011820, 0.042940, 0.968881], 

188 ] 

189 ), 

190 }, 

191 "Tritanomaly": { 

192 0.0: np.array( 

193 [ 

194 [1.000000, 0.000000, -0.000000], 

195 [0.000000, 1.000000, 0.000000], 

196 [-0.000000, -0.000000, 1.000000], 

197 ] 

198 ), 

199 0.1: np.array( 

200 [ 

201 [0.926670, 0.092514, -0.019184], 

202 [0.021191, 0.964503, 0.014306], 

203 [0.008437, 0.054813, 0.936750], 

204 ] 

205 ), 

206 0.2: np.array( 

207 [ 

208 [0.895720, 0.133330, -0.029050], 

209 [0.029997, 0.945400, 0.024603], 

210 [0.013027, 0.104707, 0.882266], 

211 ] 

212 ), 

213 0.3: np.array( 

214 [ 

215 [0.905871, 0.127791, -0.033662], 

216 [0.026856, 0.941251, 0.031893], 

217 [0.013410, 0.148296, 0.838294], 

218 ] 

219 ), 

220 0.4: np.array( 

221 [ 

222 [0.948035, 0.089490, -0.037526], 

223 [0.014364, 0.946792, 0.038844], 

224 [0.010853, 0.193991, 0.795156], 

225 ] 

226 ), 

227 0.5: np.array( 

228 [ 

229 [1.017277, 0.027029, -0.044306], 

230 [-0.006113, 0.958479, 0.047634], 

231 [0.006379, 0.248708, 0.744913], 

232 ] 

233 ), 

234 0.6: np.array( 

235 [ 

236 [1.104996, -0.046633, -0.058363], 

237 [-0.032137, 0.971635, 0.060503], 

238 [0.001336, 0.317922, 0.680742], 

239 ] 

240 ), 

241 0.7: np.array( 

242 [ 

243 [1.193214, -0.109812, -0.083402], 

244 [-0.058496, 0.979410, 0.079086], 

245 [-0.002346, 0.403492, 0.598854], 

246 ] 

247 ), 

248 0.8: np.array( 

249 [ 

250 [1.257728, -0.139648, -0.118081], 

251 [-0.078003, 0.975409, 0.102594], 

252 [-0.003316, 0.501214, 0.502102], 

253 ] 

254 ), 

255 0.9: np.array( 

256 [ 

257 [1.278864, -0.125333, -0.153531], 

258 [-0.084748, 0.957674, 0.127074], 

259 [-0.000989, 0.601151, 0.399838], 

260 ] 

261 ), 

262 1.0: np.array( 

263 [ 

264 [1.255528, -0.076749, -0.178779], 

265 [-0.078411, 0.930809, 0.147602], 

266 [0.004733, 0.691367, 0.303900], 

267 ] 

268 ), 

269 }, 

270 } 

271) 

272CVD_MATRICES_MACHADO2010.__doc__ = """ 

273Machado (2010) Simulation matrices :math:`\\Phi_{CVD}`. 

274"""