Compare commits
No commits in common. "f1348cfef2efa54c796da0dcbc737e09293e6e5e" and "3ee51d0be4412210836e0da3886eb495b917dfdc" have entirely different histories.
f1348cfef2
...
3ee51d0be4
@ -53,8 +53,7 @@ class Protanopie(Dyschromasie):
|
|||||||
# Einzelne Pixelwertberechnung
|
# Einzelne Pixelwertberechnung
|
||||||
for i in range(self.rows):
|
for i in range(self.rows):
|
||||||
for j in range(self.cols):
|
for j in range(self.cols):
|
||||||
self.cb_image[i, j] = np.flipud(
|
self.cb_image[i, j] = np.flipud(self.T_reversed.dot(self.sim_mat).dot(self.T).dot(np.flipud(self.cb_image[i, j])))
|
||||||
self.T_reversed.dot(self.sim_mat).dot(self.T).dot(np.flipud(self.cb_image[i, j])))
|
|
||||||
|
|
||||||
self.sim_image = np.copy(self.cb_image)
|
self.sim_image = np.copy(self.cb_image)
|
||||||
self.sim_image = self.sim_image.astype('uint8')
|
self.sim_image = self.sim_image.astype('uint8')
|
||||||
@ -84,8 +83,7 @@ class Deuteranopie(Dyschromasie):
|
|||||||
# Einzelne Pixelwertberechnung
|
# Einzelne Pixelwertberechnung
|
||||||
for i in range(self.rows):
|
for i in range(self.rows):
|
||||||
for j in range(self.cols):
|
for j in range(self.cols):
|
||||||
self.cb_image[i, j] = np.flipud(
|
self.cb_image[i, j] = np.flipud(self.T_reversed.dot(self.sim_mat).dot(self.T).dot(np.flipud(self.cb_image[i, j])))
|
||||||
self.T_reversed.dot(self.sim_mat).dot(self.T).dot(np.flipud(self.cb_image[i, j])))
|
|
||||||
|
|
||||||
self.sim_image = np.copy(self.cb_image)
|
self.sim_image = np.copy(self.cb_image)
|
||||||
self.sim_image = self.sim_image.astype('uint8')
|
self.sim_image = self.sim_image.astype('uint8')
|
||||||
@ -114,8 +112,7 @@ class Tritanopie(Dyschromasie):
|
|||||||
# Einzelne Pixelwertberechnung
|
# Einzelne Pixelwertberechnung
|
||||||
for i in range(self.rows):
|
for i in range(self.rows):
|
||||||
for j in range(self.cols):
|
for j in range(self.cols):
|
||||||
self.cb_image[i, j] = np.flipud(
|
self.cb_image[i, j] = np.flipud(self.T_reversed.dot(self.sim_mat).dot(self.T).dot(np.flipud(self.cb_image[i, j])))
|
||||||
self.T_reversed.dot(self.sim_mat).dot(self.T).dot(np.flipud(self.cb_image[i, j])))
|
|
||||||
|
|
||||||
self.sim_image = np.copy(self.cb_image)
|
self.sim_image = np.copy(self.cb_image)
|
||||||
self.sim_image = self.sim_image.astype('uint8')
|
self.sim_image = self.sim_image.astype('uint8')
|
||||||
@ -127,7 +124,6 @@ class Tritanopie(Dyschromasie):
|
|||||||
self.sim_image[i, j, x] = self.reverseGammaCorrection(self.cb_image[i, j, x])
|
self.sim_image[i, j, x] = self.reverseGammaCorrection(self.cb_image[i, j, x])
|
||||||
return self.sim_image
|
return self.sim_image
|
||||||
|
|
||||||
|
|
||||||
root = tk.Tk()
|
root = tk.Tk()
|
||||||
root.title("Projekt Dyschromasie")
|
root.title("Projekt Dyschromasie")
|
||||||
|
|
||||||
@ -139,10 +135,6 @@ kanaele = 0
|
|||||||
sim_pro = tk.IntVar(root)
|
sim_pro = tk.IntVar(root)
|
||||||
sim_deut = tk.IntVar(root)
|
sim_deut = tk.IntVar(root)
|
||||||
sim_tri = tk.IntVar(root)
|
sim_tri = tk.IntVar(root)
|
||||||
simGrad = tk.IntVar(root)
|
|
||||||
|
|
||||||
simulationsGradient = tk.Scale(root, from_=0, to_=100, variable=simGrad, orient='horizontal')
|
|
||||||
simulationsGradient.grid(column= 0, row = 1, columnspan=10)
|
|
||||||
|
|
||||||
def browse():
|
def browse():
|
||||||
# Auswahl des FilePaths
|
# Auswahl des FilePaths
|
||||||
@ -208,6 +200,7 @@ def simulate():
|
|||||||
sim_pic_pro.grid(columnspan=5)
|
sim_pic_pro.grid(columnspan=5)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
btn = tk.Button(root, text="Browse", width=25, command=browse, bg='light blue')
|
btn = tk.Button(root, text="Browse", width=25, command=browse, bg='light blue')
|
||||||
btn.grid(column = 0, row = 0,columnspan=2)
|
btn.grid(column = 0, row = 0,columnspan=2)
|
||||||
|
|
||||||
@ -219,8 +212,8 @@ checkButton_p = tk.Checkbutton(root, text="Protanop", variable=sim_pro, onvalue=
|
|||||||
checkButton_d = tk.Checkbutton(root, text="Deutanop", variable=sim_deut, onvalue=1, offvalue=0, height=5, width=20)
|
checkButton_d = tk.Checkbutton(root, text="Deutanop", variable=sim_deut, onvalue=1, offvalue=0, height=5, width=20)
|
||||||
checkButton_t = tk.Checkbutton(root, text="Tritanop", variable=sim_tri, onvalue=1, offvalue=0, height=5, width=20)
|
checkButton_t = tk.Checkbutton(root, text="Tritanop", variable=sim_tri, onvalue=1, offvalue=0, height=5, width=20)
|
||||||
|
|
||||||
checkButton_p.grid(column=0, row=2)
|
checkButton_p.grid(column = 0, row = 1)
|
||||||
checkButton_d.grid(column=1, row=2)
|
checkButton_d.grid(column = 1, row = 1)
|
||||||
checkButton_t.grid(column=2, row=2)
|
checkButton_t.grid(column = 2, row = 1)
|
||||||
|
|
||||||
root.mainloop()
|
root.mainloop()
|
||||||
|
@ -78,6 +78,7 @@ S_t = np.array([[1, 0, 0], #Simulationsmatrix fuer Tritanopi
|
|||||||
for i in range(rows):
|
for i in range(rows):
|
||||||
for j in range(cols):
|
for j in range(cols):
|
||||||
cb_image[i,j] = T_reversed.dot(S_p).dot(T).dot(cb_image[i,j])
|
cb_image[i,j] = T_reversed.dot(S_p).dot(T).dot(cb_image[i,j])
|
||||||
|
# Da OpenCV Pixelwerte in RGB speichert, aber BGR für den Algorithmus nötig ist, muss die Matrix mit flipud gedreht werden
|
||||||
|
|
||||||
sim_image = np.copy(cb_image)
|
sim_image = np.copy(cb_image)
|
||||||
sim_image = sim_image.astype('uint8')
|
sim_image = sim_image.astype('uint8')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user