Commit 2949b5af authored by André Anjos's avatar André Anjos 💬

[gui] Remove strange histogram normalization available during image loading

parent d8db46ab
Pipeline #26480 passed with stages
in 13 minutes and 4 seconds
......@@ -282,11 +282,8 @@ class AnnotatorApp(tkinter.Tk):
bob_image = bob.io.base.load(self.filelist[self.curr_pos])
if len(bob_image.shape) == 3:
bob_image = bob_image.transpose(1,2,0)
#added a simple image histogram streching:
bob_image = numpy.float32(bob_image)
bob_image = (bob_image - bob_image.min()) / (bob_image.max() - bob_image.min())
bob_image = numpy.uint8(bob_image * 255)
self.image = Image.fromarray(bob_image)
if self.zoom != 1.0:
shape = self.zoom_point((self.image.width, self.image.height))
self.image = self.image.resize(shape, Image.ANTIALIAS)
......@@ -465,13 +462,7 @@ class AnnotatorApp(tkinter.Tk):
#self.option_add("*Dialog.msg.wrapLength", "200p")
# some keyboard and pointer bindings
self.add_keyboard_bindings()
# Capture closing the app -> use to save the file
self.protocol("WM_DELETE_WINDOW", self.on_quit)
self.bind("q", self.on_quit)
self.bind("<Escape>", self.on_quit_no_saving)
self.bind("s", self.save)
self._add_bindings()
else:
......@@ -770,7 +761,7 @@ class AnnotatorApp(tkinter.Tk):
self._rebuild_interface()
def add_keyboard_bindings(self):
def _add_bindings(self):
"""Adds pointer bindings to the given widget"""
# add a given annotation (marked in white)
......@@ -831,3 +822,9 @@ class AnnotatorApp(tkinter.Tk):
self.bind("<KeyRelease-Alt_R>", self.on_hide_all)
self.bind("?", self.on_help)
# Capture closing the app -> use to save the file
self.protocol("WM_DELETE_WINDOW", self.on_quit)
self.bind("q", self.on_quit)
self.bind("<Escape>", self.on_quit_no_saving)
self.bind("s", self.save)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment