Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
O
opencv
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
opencv
Commits
e0f19ec4
Commit
e0f19ec4
authored
Jul 27, 2016
by
StevenPuttemans
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
change parameter input to the CommandLineParser interface
parent
9ad0dcb5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
21 deletions
+17
-21
opencv_annotation.cpp
apps/annotation/opencv_annotation.cpp
+17
-21
No files found.
apps/annotation/opencv_annotation.cpp
View file @
e0f19ec4
...
...
@@ -224,28 +224,24 @@ vector<Rect> get_annotations(Mat input_image)
int
main
(
int
argc
,
const
char
**
argv
)
{
// If no arguments are given, then supply some information on how this tool works
if
(
argc
==
1
){
cout
<<
"Usage: "
<<
argv
[
0
]
<<
endl
;
cout
<<
" -images <folder_location> [example - /data/testimages/]"
<<
endl
;
cout
<<
" -annotations <ouput_file> [example - /data/annotations.txt]"
<<
endl
;
cout
<<
"TIP: Use absolute paths to avoid any problems with the software!"
<<
endl
;
return
-
1
;
}
// Use the cmdlineparser to process input arguments
CommandLineParser
parser
(
argc
,
argv
,
"{ help h usage ? | | show this message }"
"{ images i | | (required) path to image folder [example - /data/testimages/] }"
"{ annotations a | | (required) path to annotations txt file [example - /data/annotations.txt] }"
);
// Read in the input arguments
string
image_folder
;
string
annotations_file
;
for
(
int
i
=
1
;
i
<
argc
;
++
i
)
{
if
(
!
strcmp
(
argv
[
i
],
"-images"
)
)
{
image_folder
=
argv
[
++
i
];
}
else
if
(
!
strcmp
(
argv
[
i
],
"-annotations"
)
)
{
annotations_file
=
argv
[
++
i
];
}
if
(
parser
.
has
(
"help"
)){
parser
.
printMessage
();
cerr
<<
"TIP: Use absolute paths to avoid any problems with the software!"
<<
endl
;
return
0
;
}
string
image_folder
(
parser
.
get
<
string
>
(
"images"
));
string
annotations_file
(
parser
.
get
<
string
>
(
"annotations"
));
if
(
image_folder
.
empty
()
||
annotations_file
.
empty
()){
parser
.
printMessage
();
cerr
<<
"TIP: Use absolute paths to avoid any problems with the software!"
<<
endl
;
return
-
1
;
}
// Check if the folder actually exists
...
...
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