Korrektur des Algorithmus
Durch die NumPy Funktion numpy.flipud konnte das RGB Array umgedreht, der Algorithmus des Papers angewendet und schließlich eine Rücktransformation der RGB Werte stattfinden. Die erhaltenen Bilder entsprechen nun den Erwartungen.
This commit is contained in:
@@ -32,7 +32,6 @@ def reverseGammaCorrection(v_reverse):
|
||||
print("Ungültiger Wert!!!")
|
||||
return 1
|
||||
|
||||
|
||||
cb_image = np.copy(image) # Kopie des Bildarrays
|
||||
cb_image = cb_image.astype('float64') # Casting des Arrays auf Float
|
||||
|
||||
@@ -78,7 +77,7 @@ S_t = np.array([[1, 0, 0], #Simulationsmatrix fuer Tritanopi
|
||||
#Multiplikation der einzelnen Pixel
|
||||
for i in range(rows):
|
||||
for j in range(cols):
|
||||
cb_image[i,j] = T_reversed.dot(S_p).dot(T).dot(cb_image[i,j]) #ToDo Statt RBG ist noch BGR
|
||||
cb_image[i,j] = np.flipud(T_reversed.dot(S_p).dot(T).dot(np.flipud(cb_image[i,j]))) #ToDo Statt RBG ist noch BGR
|
||||
|
||||
sim_image = np.copy(cb_image)
|
||||
sim_image = sim_image.astype('uint8')
|
||||
|
||||
Reference in New Issue
Block a user