Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
dlib
Commits
7df58286
Commit
7df58286
authored
Jun 20, 2011
by
Davis King
Browse files
Added version and about info.
parent
1fd281ff
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
43 additions
and
1 deletion
+43
-1
tools/imglab/src/main.cpp
tools/imglab/src/main.cpp
+13
-0
tools/imglab/src/metadata_editor.cpp
tools/imglab/src/metadata_editor.cpp
+28
-1
tools/imglab/src/metadata_editor.h
tools/imglab/src/metadata_editor.h
+2
-0
No files found.
tools/imglab/src/main.cpp
View file @
7df58286
...
...
@@ -11,6 +11,9 @@
#include <dlib/dir_nav.h>
const
char
*
VERSION
=
"0.1"
;
typedef
dlib
::
cmd_line_parser
<
char
>::
check_1a_c
parser_type
;
using
namespace
std
;
...
...
@@ -151,6 +154,7 @@ int main(int argc, char** argv)
parser
.
add_option
(
"r"
,
"Search directories recursively for images."
);
parser
.
add_option
(
"l"
,
"List all the labels in the given XML file."
);
parser
.
add_option
(
"rename"
,
"Rename all labels of <arg1> to <arg2>."
,
2
);
parser
.
add_option
(
"v"
,
"Display version."
);
parser
.
parse
(
argc
,
argv
);
...
...
@@ -168,6 +172,15 @@ int main(int argc, char** argv)
return
EXIT_SUCCESS
;
}
if
(
parser
.
option
(
"v"
))
{
cout
<<
"imglab v"
<<
VERSION
<<
"
\n
Compiled: "
<<
__TIME__
<<
" "
<<
__DATE__
<<
"
\n
Written by Davis King
\n
"
;
cout
<<
"Check for updates at http://dlib.net
\n\n
"
;
return
EXIT_SUCCESS
;
}
if
(
parser
.
option
(
"c"
))
{
create_new_dataset
(
parser
);
...
...
tools/imglab/src/metadata_editor.cpp
View file @
7df58286
...
...
@@ -9,10 +9,13 @@
#include <dlib/image_io.h>
#include <dlib/array2d.h>
#include <dlib/pixel.h>
#include <sstream>
using
namespace
std
;
using
namespace
dlib
;
extern
const
char
*
VERSION
;
// ----------------------------------------------------------------------------------------
metadata_editor
::
...
...
@@ -53,8 +56,9 @@ metadata_editor(
display
.
set_overlay_rect_selected_handler
(
*
this
,
&
metadata_editor
::
on_overlay_rect_selected
);
overlay_label
.
set_text_modified_handler
(
*
this
,
&
metadata_editor
::
on_overlay_label_changed
);
mbar
.
set_number_of_menus
(
1
);
mbar
.
set_number_of_menus
(
2
);
mbar
.
set_menu_name
(
0
,
"File"
,
'F'
);
mbar
.
set_menu_name
(
1
,
"Help"
,
'H'
);
mbar
.
menu
(
0
).
add_menu_item
(
menu_item_text
(
"Save"
,
*
this
,
&
metadata_editor
::
file_save
,
'S'
));
...
...
@@ -64,6 +68,7 @@ metadata_editor(
mbar
.
menu
(
0
).
add_menu_item
(
menu_item_separator
());
mbar
.
menu
(
0
).
add_menu_item
(
menu_item_text
(
"Exit"
,
static_cast
<
base_window
&>
(
*
this
),
&
drawable_window
::
close_window
,
'x'
));
mbar
.
menu
(
1
).
add_menu_item
(
menu_item_text
(
"About"
,
*
this
,
&
metadata_editor
::
display_about
,
'A'
));
// set the size of this window.
on_window_resized
();
...
...
@@ -398,3 +403,25 @@ on_overlay_rect_selected(
// ----------------------------------------------------------------------------------------
void
metadata_editor
::
display_about
(
)
{
std
::
ostringstream
sout
;
sout
<<
wrap_string
(
"Image Labeler v"
+
string
(
VERSION
)
+
"."
,
0
,
0
)
<<
endl
<<
endl
;
sout
<<
wrap_string
(
"This program is a tool for labeling images with rectangles. "
,
0
,
0
)
<<
endl
<<
endl
;
sout
<<
wrap_string
(
"You can add new rectangles by holding the shift key, left clicking "
"the mouse, and dragging it. Hit tab to give input focus to the next "
"label text field and supply a label for a rectangle. Double clicking "
"a rectangle selects it and the delete key removes it."
,
0
,
0
)
<<
endl
<<
endl
;
sout
<<
wrap_string
(
"Finally, hold ctrl and scroll the mouse wheel to zoom while normal left click "
"and drag allows you to navigate around the image."
,
0
,
0
)
<<
endl
;
message_box
(
"About Image Labeler"
,
sout
.
str
());
}
// ----------------------------------------------------------------------------------------
tools/imglab/src/metadata_editor.h
View file @
7df58286
...
...
@@ -39,6 +39,8 @@ private:
void
on_overlay_label_changed
();
void
on_overlay_rect_selected
(
const
dlib
::
image_display
::
overlay_rect
&
orect
);
void
display_about
();
std
::
string
filename
;
dlib
::
image_dataset_metadata
::
dataset
metadata
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment