mirror of https://github.com/davisking/dlib.git
Made is so pressing e in imglab toggles between views of the image where the
histogram is equalized or unmodified. This way, if you are looking at particularly dark or badly contrasted images you can toggle this mode and maybe get a better view of what you are labeling.
This commit is contained in:
parent
ba72c2f95c
commit
39be45ada2
|
@ -20,7 +20,7 @@
|
|||
#include <dlib/dir_nav.h>
|
||||
|
||||
|
||||
const char* VERSION = "1.9";
|
||||
const char* VERSION = "1.10";
|
||||
|
||||
const int JPEG_QUALITY = 90;
|
||||
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
#include <dlib/image_io.h>
|
||||
#include <dlib/array2d.h>
|
||||
#include <dlib/pixel.h>
|
||||
#include <dlib/image_transforms.h>
|
||||
#include <sstream>
|
||||
#include <ctime>
|
||||
|
||||
|
@ -341,6 +342,12 @@ on_keydown (
|
|||
remove_selected_images();
|
||||
}
|
||||
|
||||
if (key == 'e' && !overlay_label.has_input_focus())
|
||||
{
|
||||
display_equialized_image = !display_equialized_image;
|
||||
select_image(image_pos);
|
||||
}
|
||||
|
||||
|
||||
return;
|
||||
}
|
||||
|
@ -463,6 +470,8 @@ load_image(
|
|||
message_box("Error loading image", e.what());
|
||||
}
|
||||
|
||||
if (display_equialized_image)
|
||||
equalize_histogram(img);
|
||||
display.set_image(img);
|
||||
display.add_overlay(get_overlays(metadata.images[idx]));
|
||||
}
|
||||
|
@ -509,6 +518,8 @@ load_image_and_set_size(
|
|||
set_size(needed_width, needed_height);
|
||||
|
||||
|
||||
if (display_equialized_image)
|
||||
equalize_histogram(img);
|
||||
display.set_image(img);
|
||||
display.add_overlay(get_overlays(metadata.images[idx]));
|
||||
}
|
||||
|
@ -593,7 +604,11 @@ display_about(
|
|||
"Holding shift + right click and then dragging allows you to move things around. "
|
||||
"Holding ctrl and pressing the up or down keyboard keys will propagate "
|
||||
"rectangle labels from one image to the next and also skip empty images. "
|
||||
"Finally, typing a number on the keyboard will jump you to a specific image.",0,0) << endl;
|
||||
"Finally, typing a number on the keyboard will jump you to a specific image.",0,0) << endl << endl;
|
||||
|
||||
sout << wrap_string("You can also toggle image histogram equalization by pressing the e key."
|
||||
,0,0) << endl;
|
||||
|
||||
|
||||
message_box("About Image Labeler",sout.str());
|
||||
}
|
||||
|
|
|
@ -58,6 +58,7 @@ private:
|
|||
|
||||
unsigned long keyboard_jump_pos;
|
||||
time_t last_keyboard_jump_pos_update;
|
||||
bool display_equialized_image = false;
|
||||
};
|
||||
|
||||
// ----------------------------------------------------------------------------------------
|
||||
|
|
Loading…
Reference in New Issue