Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Opencv
提交
b3f68d29
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,发现更多精彩内容 >>
提交
b3f68d29
编写于
7月 02, 2012
作者:
M
Maria Dimashova
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fixed bow sample
上级
319c20c7
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
6 addition
and
5 deletion
+6
-5
samples/cpp/bagofwords_classification.cpp
samples/cpp/bagofwords_classification.cpp
+6
-5
未找到文件。
samples/cpp/bagofwords_classification.cpp
浏览文件 @
b3f68d29
...
@@ -2014,7 +2014,7 @@ struct VocabTrainParams
...
@@ -2014,7 +2014,7 @@ struct VocabTrainParams
// It shouldn't matter which object class is specified here - visual vocab will still be the same.
// It shouldn't matter which object class is specified here - visual vocab will still be the same.
int
vocabSize
;
//number of visual words in vocabulary to train
int
vocabSize
;
//number of visual words in vocabulary to train
int
memoryUse
;
// Memory to preallocate (in MB) when training vocab.
int
memoryUse
;
// Memory to preallocate (in MB) when training vocab.
// Change this depending on the size of the dataset/available memory.
// Change this depending on the size of the dataset/available memory.
float
descProportion
;
// Specifies the number of descriptors to use from each image as a proportion of the total num descs.
float
descProportion
;
// Specifies the number of descriptors to use from each image as a proportion of the total num descs.
};
};
...
@@ -2126,8 +2126,10 @@ static Mat trainVocabulary( const string& filename, VocData& vocData, const Voca
...
@@ -2126,8 +2126,10 @@ static Mat trainVocabulary( const string& filename, VocData& vocData, const Voca
if
(
!
readVocabulary
(
filename
,
vocabulary
)
)
if
(
!
readVocabulary
(
filename
,
vocabulary
)
)
{
{
CV_Assert
(
dextractor
->
descriptorType
()
==
CV_32FC1
);
CV_Assert
(
dextractor
->
descriptorType
()
==
CV_32FC1
);
const
int
descByteSize
=
dextractor
->
descriptorSize
()
*
4
;
const
int
elemSize
=
CV_ELEM_SIZE
(
dextractor
->
descriptorType
());
const
int
maxDescCount
=
(
trainParams
.
memoryUse
*
1048576
)
/
descByteSize
;
// Total number of descs to use for training.
const
int
descByteSize
=
dextractor
->
descriptorSize
()
*
elemSize
;
const
int
bytesInMB
=
1048576
;
const
int
maxDescCount
=
(
trainParams
.
memoryUse
*
bytesInMB
)
/
descByteSize
;
// Total number of descs to use for training.
cout
<<
"Extracting VOC data..."
<<
endl
;
cout
<<
"Extracting VOC data..."
<<
endl
;
vector
<
ObdImage
>
images
;
vector
<
ObdImage
>
images
;
...
@@ -2142,9 +2144,8 @@ static Mat trainVocabulary( const string& filename, VocData& vocData, const Voca
...
@@ -2142,9 +2144,8 @@ static Mat trainVocabulary( const string& filename, VocData& vocData, const Voca
while
(
images
.
size
()
>
0
)
while
(
images
.
size
()
>
0
)
{
{
if
(
bowTrainer
.
descripotorsCount
()
>
=
maxDescCount
)
if
(
bowTrainer
.
descripotorsCount
()
>
maxDescCount
)
{
{
assert
(
bowTrainer
.
descripotorsCount
()
==
maxDescCount
);
#ifdef DEBUG_DESC_PROGRESS
#ifdef DEBUG_DESC_PROGRESS
cout
<<
"Breaking due to full memory ( descriptors count = "
<<
bowTrainer
.
descripotorsCount
()
cout
<<
"Breaking due to full memory ( descriptors count = "
<<
bowTrainer
.
descripotorsCount
()
<<
"; descriptor size in bytes = "
<<
descByteSize
<<
"; all used memory = "
<<
"; descriptor size in bytes = "
<<
descByteSize
<<
"; all used memory = "
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录