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
2c9547e3
Commit
2c9547e3
authored
Feb 25, 2015
by
Vadim Pisarevsky
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #3747 from StevenPuttemans:fix_annotationtool_extras
parents
f73a97b5
387a0f26
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
44 additions
and
3 deletions
+44
-3
CMakeLists.txt
apps/CMakeLists.txt
+1
-0
CMakeLists.txt
apps/annotation/CMakeLists.txt
+35
-0
opencv_annotation.cpp
apps/annotation/opencv_annotation.cpp
+8
-3
No files found.
apps/CMakeLists.txt
View file @
2c9547e3
...
...
@@ -2,3 +2,4 @@ link_libraries(${OPENCV_LINKER_LIBS})
add_subdirectory
(
haartraining
)
add_subdirectory
(
traincascade
)
add_subdirectory
(
annotation
)
apps/annotation/CMakeLists.txt
0 → 100644
View file @
2c9547e3
SET
(
deps opencv_core opencv_highgui opencv_imgproc
)
ocv_check_dependencies
(
${
deps
}
)
if
(
NOT OCV_DEPENDENCIES_FOUND
)
return
()
endif
()
project
(
annotation
)
ocv_include_directories
(
"
${
CMAKE_CURRENT_SOURCE_DIR
}
"
"
${
OpenCV_SOURCE_DIR
}
/include/opencv"
)
ocv_include_modules
(
${
deps
}
)
set
(
the_target opencv_annotation
)
add_executable
(
${
the_target
}
opencv_annotation.cpp
)
target_link_libraries
(
${
the_target
}
${
deps
}
)
set_target_properties
(
${
the_target
}
PROPERTIES
DEBUG_POSTFIX
"
${
OPENCV_DEBUG_POSTFIX
}
"
ARCHIVE_OUTPUT_DIRECTORY
${
LIBRARY_OUTPUT_PATH
}
RUNTIME_OUTPUT_DIRECTORY
${
EXECUTABLE_OUTPUT_PATH
}
INSTALL_NAME_DIR lib
OUTPUT_NAME
"opencv_annotation"
)
if
(
ENABLE_SOLUTION_FOLDERS
)
set_target_properties
(
${
the_target
}
PROPERTIES FOLDER
"applications"
)
endif
()
if
(
INSTALL_CREATE_DISTRIB
)
if
(
BUILD_SHARED_LIBS
)
install
(
TARGETS
${
the_target
}
RUNTIME DESTINATION
${
OPENCV_BIN_INSTALL_PATH
}
CONFIGURATIONS Release COMPONENT dev
)
endif
()
else
()
install
(
TARGETS
${
the_target
}
RUNTIME DESTINATION
${
OPENCV_BIN_INSTALL_PATH
}
COMPONENT dev
)
endif
()
apps/annotation/opencv_annotation.cpp
View file @
2c9547e3
...
...
@@ -15,6 +15,11 @@ Created by: Puttemans Steven
using
namespace
std
;
using
namespace
cv
;
// Function prototypes
void
on_mouse
(
int
,
int
,
int
,
int
,
void
*
);
string
int2string
(
int
);
void
get_annotations
(
Mat
,
stringstream
*
);
// Public parameters
Mat
image
;
int
roi_x0
=
0
,
roi_y0
=
0
,
roi_x1
=
0
,
roi_y1
=
0
,
num_of_rec
=
0
;
...
...
@@ -26,7 +31,7 @@ const string window_name="OpenCV Based Annotation Tool";
// FUNCTION : Mouse response for selecting objects in images
// If left button is clicked, start drawing a rectangle as long as mouse moves
// Stop drawing once a new left click is detected by the on_mouse function
void
on_mouse
(
int
event
,
int
x
,
int
y
,
int
flag
,
void
*
param
)
void
on_mouse
(
int
event
,
int
x
,
int
y
,
int
,
void
*
)
{
// Action when left button is clicked
if
(
event
==
CV_EVENT_LBUTTONDOWN
)
...
...
@@ -90,7 +95,7 @@ void get_annotations(Mat input_image, stringstream* output_stream)
// c = 99 add rectangle to current image
// n = 110 save added rectangles and show next image
// <ESC> = 27 exit program
key_pressed
=
waitKey
(
0
);
key_pressed
=
0xFF
&
waitKey
(
0
);
switch
(
key_pressed
)
{
case
27
:
...
...
@@ -173,7 +178,7 @@ int main( int argc, const char** argv )
// Loop through each image stored in the images folder
// Create and temporarily store the annotations
// At the end write everything to the annotations file
for
(
in
t
i
=
0
;
i
<
filenames
.
size
();
i
++
){
for
(
size_
t
i
=
0
;
i
<
filenames
.
size
();
i
++
){
// Read in an image
Mat
current_image
=
imread
(
filenames
[
i
]);
...
...
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