Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Opencv
提交
143c5706
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,发现更多精彩内容 >>
提交
143c5706
编写于
6月 25, 2012
作者:
M
Marina Kolpakova
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
LBP classifier represintation in GPU memory
上级
4a0249f8
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
28 addition
and
22 deletion
+28
-22
modules/gpu/include/opencv2/gpu/gpu.hpp
modules/gpu/include/opencv2/gpu/gpu.hpp
+6
-7
modules/gpu/src/cascadeclassifier.cpp
modules/gpu/src/cascadeclassifier.cpp
+22
-15
未找到文件。
modules/gpu/include/opencv2/gpu/gpu.hpp
浏览文件 @
143c5706
...
...
@@ -1450,14 +1450,13 @@ private:
cv
::
Size
NxM
;
bool
isStumps
;
int
ncategories
;
struct
Stage
;
// Stage* stages;
struct
DTree
;
// DTree* classifiers;
struct
DTreeNode
;
// DTreeNode* nodes;
// located on gpu
GpuMat
stage_mat
;
GpuMat
trees_mat
;
GpuMat
nodes_mat
;
GpuMat
leaves_mat
;
GpuMat
subsets_mat
;
};
////////////////////////////////// SURF //////////////////////////////////////////
...
...
modules/gpu/src/cascadeclassifier.cpp
浏览文件 @
143c5706
...
...
@@ -48,7 +48,7 @@ using namespace cv;
using
namespace
cv
::
gpu
;
using
namespace
std
;
struct
cv
::
gpu
::
CascadeClassifier_GPU_LBP
::
Stage
struct
Stage
{
int
first
;
int
ntrees
;
...
...
@@ -56,13 +56,7 @@ struct cv::gpu::CascadeClassifier_GPU_LBP::Stage
Stage
(
int
f
=
0
,
int
n
=
0
,
float
t
=
0.
f
)
:
first
(
f
),
ntrees
(
n
),
threshold
(
t
)
{}
};
struct
cv
::
gpu
::
CascadeClassifier_GPU_LBP
::
DTree
{
int
nodeCount
;
DTree
(
int
n
=
0
)
:
nodeCount
(
n
)
{}
};
struct
cv
::
gpu
::
CascadeClassifier_GPU_LBP
::
DTreeNode
struct
DTreeNode
{
int
featureIdx
;
//float threshold; // for ordered features only
...
...
@@ -162,7 +156,7 @@ bool CascadeClassifier_GPU_LBP::read(const FileNode &root)
std
::
vector
<
Stage
>
stages
;
stages
.
reserve
(
fn
.
size
());
std
::
vector
<
DTree
>
cl_trees
;
std
::
vector
<
int
>
cl_trees
;
std
::
vector
<
DTreeNode
>
cl_nodes
;
std
::
vector
<
float
>
cl_leaves
;
std
::
vector
<
int
>
subsets
;
...
...
@@ -196,15 +190,14 @@ bool CascadeClassifier_GPU_LBP::read(const FileNode &root)
FileNode
leafValues
=
fnw
[
GPU_CC_LEAF_VALUES
];
if
(
internalNodes
.
empty
()
||
leafValues
.
empty
()
)
return
false
;
int
nodeCount
=
(
int
)
internalNodes
.
size
()
/
nodeStep
;
cl_trees
.
push_back
(
nodeCount
);
DTree
tree
((
int
)
internalNodes
.
size
()
/
nodeStep
);
cl_trees
.
push_back
(
tree
);
cl_nodes
.
reserve
(
cl_nodes
.
size
()
+
tree
.
nodeCount
);
cl_nodes
.
reserve
(
cl_nodes
.
size
()
+
nodeCount
);
cl_leaves
.
reserve
(
cl_leaves
.
size
()
+
leafValues
.
size
());
if
(
subsetSize
>
0
)
subsets
.
reserve
(
subsets
.
size
()
+
tree
.
nodeCount
*
subsetSize
);
subsets
.
reserve
(
subsets
.
size
()
+
nodeCount
*
subsetSize
);
// nodes
FileNodeIterator
iIt
=
internalNodes
.
begin
(),
iEnd
=
internalNodes
.
end
();
...
...
@@ -226,7 +219,21 @@ bool CascadeClassifier_GPU_LBP::read(const FileNode &root)
}
}
// copy data structures on gpu
// GpuMat stages;
stage_mat
=
cv
::
gpu
::
GpuMat
(
1
,
(
int
)
stages
.
size
()
*
sizeof
(
Stage
),
CV_8UC1
);
stage_mat
.
upload
(
cv
::
Mat
(
1
,
stages
.
size
()
*
sizeof
(
Stage
),
CV_8UC1
,
&
(
stages
[
0
])
));
trees_mat
=
cv
::
gpu
::
GpuMat
(
1
,
(
int
)
cl_trees
.
size
(),
CV_32SC1
);
stage_mat
.
upload
(
cv
::
Mat
(
cl_trees
));
nodes_mat
=
cv
::
gpu
::
GpuMat
(
1
,
(
int
)
cl_nodes
.
size
()
*
sizeof
(
DTreeNode
),
CV_8UC1
);
stage_mat
.
upload
(
cv
::
Mat
(
1
,
cl_nodes
.
size
()
*
sizeof
(
DTreeNode
),
CV_8UC1
,
&
(
cl_nodes
[
0
])
));
leaves_mat
=
cv
::
gpu
::
GpuMat
(
1
,
(
int
)
cl_leaves
.
size
(),
CV_32FC1
);
stage_mat
.
upload
(
cv
::
Mat
(
cl_leaves
));
subsets_mat
=
cv
::
gpu
::
GpuMat
(
1
,
(
int
)
subsets
.
size
(),
CV_32SC1
);
stage_mat
.
upload
(
cv
::
Mat
(
subsets
));
return
true
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录