From 12dd7730209bd9175e819450c166997e46923ebf Mon Sep 17 00:00:00 2001 From: Max Sponsel Date: Sat, 11 Jul 2020 09:40:29 +0200 Subject: [PATCH] Korrektur des Algorithmus MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- .idea/workspace.xml | 19 ++++++++++--------- Code/Dyschromasie.py | 3 +-- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 4a3f7ba..3a7529d 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -66,6 +66,7 @@ + @@ -77,28 +78,28 @@ - + - - + + - - + + - - + + - + - + \ No newline at end of file diff --git a/Code/Dyschromasie.py b/Code/Dyschromasie.py index 4060cd5..5fa99ee 100644 --- a/Code/Dyschromasie.py +++ b/Code/Dyschromasie.py @@ -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')