Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Opencv
提交
387a0f26
O
Opencv
项目概览
Greenplum
/
Opencv
大约 1 年 前同步成功
通知
7
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
O
Opencv
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
387a0f26
编写于
2月 24, 2015
作者:
S
StevenPuttemans
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix annotation tool, add auto make of tool
上级
2d2ecbf3
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
44 addition
and
3 deletion
+44
-3
apps/CMakeLists.txt
apps/CMakeLists.txt
+1
-0
apps/annotation/CMakeLists.txt
apps/annotation/CMakeLists.txt
+35
-0
apps/annotation/opencv_annotation.cpp
apps/annotation/opencv_annotation.cpp
+8
-3
未找到文件。
apps/CMakeLists.txt
浏览文件 @
387a0f26
...
...
@@ -2,3 +2,4 @@ link_libraries(${OPENCV_LINKER_LIBS})
add_subdirectory
(
haartraining
)
add_subdirectory
(
traincascade
)
add_subdirectory
(
annotation
)
apps/annotation/CMakeLists.txt
0 → 100644
浏览文件 @
387a0f26
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
浏览文件 @
387a0f26
...
...
@@ -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
]);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录