Browse Source

Erste Tests mit Slider und Umwandlungsfunktion

Erste Funktionen in den Klassen implementiert; Erste Test gemacht. Ergebnisse noch nicht zufriedenstellend. Auch Implementierung einer Scrollbar nötig!!
master
Max Sponsel 4 years ago
parent
commit
62b16b4a96
1 changed files with 35 additions and 0 deletions
  1. 35
    0
      Code/Dyschromasie-Applikation.py

+ 35
- 0
Code/Dyschromasie-Applikation.py View File

@@ -7,6 +7,7 @@ import numpy as np
class Dyschromasie:
global simGrad
cb_image = np.array([]).astype('float64')
sim_image = np.array([]).astype('uint8')
@@ -65,6 +66,16 @@ class Protanopie(Dyschromasie):
for x in range(3):
self.sim_image[i, j, x] = self.reverseGammaCorrection(self.cb_image[i, j, x])
# Anpassung fuer den Slider
if(simGrad.get() != 0):
for i in range(rows):
for j in range(cols):
for x in range(3):
if self.sim_image[i, j, x] > img[i, j, x]:
self.sim_image[i, j, x] = img[i, j, x] + abs(self.sim_image[i, j, x] - img[i, j, x])* (simGrad.get()/100)
elif self.sim_image[i, j, x] < img[i, j, x]:
self.sim_image[i, j, x] = self.sim_image[i, j, x] + abs(img[i, j, x] - self.sim_image[i, j, x])* (simGrad.get()/100)
return self.sim_image
@@ -95,6 +106,18 @@ class Deuteranopie(Dyschromasie):
for j in range(self.cols):
for x in range(3):
self.sim_image[i, j, x] = self.reverseGammaCorrection(self.cb_image[i, j, x])
# Anpassung fuer den Slider
if (simGrad.get() != 0):
for i in range(rows):
for j in range(cols):
for x in range(3):
if self.sim_image[i, j, x] > img[i, j, x]:
self.sim_image[i, j, x] = img[i, j, x] + abs(self.sim_image[i, j, x] - img[i, j, x]) * (simGrad.get() / 100)
elif self.sim_image[i, j, x] < img[i, j, x]:
self.sim_image[i, j, x] = self.sim_image[i, j, x] + abs(img[i, j, x] - self.sim_image[i, j, x]) * (simGrad.get() / 100)
return self.sim_image
@@ -125,6 +148,18 @@ class Tritanopie(Dyschromasie):
for j in range(self.cols):
for x in range(3):
self.sim_image[i, j, x] = self.reverseGammaCorrection(self.cb_image[i, j, x])
# Anpassung fuer den Slider
if (simGrad.get() != 0):
for i in range(rows):
for j in range(cols):
for x in range(3):
if self.sim_image[i, j, x] > img[i, j, x]:
self.sim_image[i, j, x] = img[i, j, x] + abs(self.sim_image[i, j, x] - img[i, j, x]) * (simGrad.get() / 100)
elif self.sim_image[i, j, x] < img[i, j, x]:
self.sim_image[i, j, x] = self.sim_image[i, j, x] + abs(img[i, j, x] - self.sim_image[i, j, x]) * (simGrad.get() / 100)
return self.sim_image

Loading…
Cancel
Save