Browse Source

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.
master
Max Sponsel 3 years ago
parent
commit
12dd773020
2 changed files with 11 additions and 11 deletions
  1. 10
    9
      .idea/workspace.xml
  2. 1
    2
      Code/Dyschromasie.py

+ 10
- 9
.idea/workspace.xml View File

@@ -66,6 +66,7 @@
<workItem from="1593601045161" duration="890000" />
<workItem from="1593693652245" duration="183000" />
<workItem from="1593852460532" duration="308000" />
<workItem from="1594452919558" duration="180000" />
</task>
<servers />
</component>
@@ -77,28 +78,28 @@
<screen x="0" y="0" width="1920" height="1040" />
</state>
<state x="739" y="275" key="FileChooserDialogImpl/0.0.1920.1040/-1920.109.1920.1040@0.0.1920.1040" timestamp="1593535189103" />
<state width="1877" height="282" key="GridCell.Tab.0.bottom" timestamp="1594303176442">
<state width="1877" height="282" key="GridCell.Tab.0.bottom" timestamp="1594453055709">
<screen x="0" y="0" width="1920" height="1040" />
</state>
<state width="1877" height="282" key="GridCell.Tab.0.bottom/0.0.1920.1040/-1920.109.1920.1040@0.0.1920.1040" timestamp="1594303176442" />
<state width="1877" height="282" key="GridCell.Tab.0.center" timestamp="1594303176442">
<state width="1877" height="282" key="GridCell.Tab.0.bottom/0.0.1920.1040/-1920.109.1920.1040@0.0.1920.1040" timestamp="1594453055709" />
<state width="1877" height="282" key="GridCell.Tab.0.center" timestamp="1594453055709">
<screen x="0" y="0" width="1920" height="1040" />
</state>
<state width="1877" height="282" key="GridCell.Tab.0.center/0.0.1920.1040/-1920.109.1920.1040@0.0.1920.1040" timestamp="1594303176442" />
<state width="1877" height="282" key="GridCell.Tab.0.left" timestamp="1594303176442">
<state width="1877" height="282" key="GridCell.Tab.0.center/0.0.1920.1040/-1920.109.1920.1040@0.0.1920.1040" timestamp="1594453055709" />
<state width="1877" height="282" key="GridCell.Tab.0.left" timestamp="1594453055708">
<screen x="0" y="0" width="1920" height="1040" />
</state>
<state width="1877" height="282" key="GridCell.Tab.0.left/0.0.1920.1040/-1920.109.1920.1040@0.0.1920.1040" timestamp="1594303176442" />
<state width="1877" height="282" key="GridCell.Tab.0.right" timestamp="1594303176442">
<state width="1877" height="282" key="GridCell.Tab.0.left/0.0.1920.1040/-1920.109.1920.1040@0.0.1920.1040" timestamp="1594453055708" />
<state width="1877" height="282" key="GridCell.Tab.0.right" timestamp="1594453055709">
<screen x="0" y="0" width="1920" height="1040" />
</state>
<state width="1877" height="282" key="GridCell.Tab.0.right/0.0.1920.1040/-1920.109.1920.1040@0.0.1920.1040" timestamp="1594303176442" />
<state width="1877" height="282" key="GridCell.Tab.0.right/0.0.1920.1040/-1920.109.1920.1040@0.0.1920.1040" timestamp="1594453055709" />
<state x="461" y="165" key="SettingsEditor" timestamp="1593535127245">
<screen x="0" y="0" width="1920" height="1040" />
</state>
<state x="461" y="165" key="SettingsEditor/0.0.1920.1040/-1920.109.1920.1040@0.0.1920.1040" timestamp="1593535127245" />
</component>
<component name="com.intellij.coverage.CoverageDataManagerImpl">
<SUITE FILE_PATH="coverage/Projekt_Dyschromasie$Dyschromasie.coverage" NAME="Dyschromasie Coverage Results" MODIFIED="1594303176426" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$/Code" />
<SUITE FILE_PATH="coverage/Projekt_Dyschromasie$Dyschromasie.coverage" NAME="Dyschromasie Coverage Results" MODIFIED="1594453055671" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$/Code" />
</component>
</project>

+ 1
- 2
Code/Dyschromasie.py View File

@@ -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')

Loading…
Cancel
Save