Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Opencv
提交
64533009
O
Opencv
项目概览
Greenplum
/
Opencv
11 个月 前同步成功
通知
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,发现更多精彩内容 >>
提交
64533009
编写于
8月 03, 2017
作者:
A
Alexander Alekhin
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
akaze: optimize allocations
上级
8aca8d90
变更
1
显示空白变更内容
内联
并排
Showing
1 changed file
with
20 addition
and
18 deletion
+20
-18
modules/features2d/src/kaze/AKAZEFeatures.cpp
modules/features2d/src/kaze/AKAZEFeatures.cpp
+20
-18
未找到文件。
modules/features2d/src/kaze/AKAZEFeatures.cpp
浏览文件 @
64533009
...
...
@@ -1679,12 +1679,10 @@ void Upright_MLDB_Full_Descriptor_Invoker::Get_Upright_MLDB_Full_Descriptor(cons
const
AKAZEOptions
&
options
=
*
options_
;
const
std
::
vector
<
Evolution
>&
evolution
=
*
evolution_
;
// Matrices for the M-LDB descriptor
Mat
values
[
3
]
=
{
Mat
(
4
,
options
.
descriptor_channels
,
CV_32FC1
),
Mat
(
9
,
options
.
descriptor_channels
,
CV_32FC1
),
Mat
(
16
,
options
.
descriptor_channels
,
CV_32FC1
)
};
// Buffer for the M-LDB descriptor
const
int
max_channels
=
3
;
CV_Assert
(
options
.
descriptor_channels
<=
max_channels
);
float
values
[
16
*
max_channels
];
// Get the information from the keypoint
ratio
=
(
float
)(
1
<<
kpt
.
octave
);
...
...
@@ -1739,7 +1737,7 @@ void Upright_MLDB_Full_Descriptor_Invoker::Get_Upright_MLDB_Full_Descriptor(cons
dx
/=
nsamples
;
dy
/=
nsamples
;
float
*
val
=
values
[
z
].
ptr
<
float
>
(
dcount2
)
;
float
*
val
=
&
values
[
dcount2
*
max_channels
]
;
*
(
val
)
=
di
;
*
(
val
+
1
)
=
dx
;
*
(
val
+
2
)
=
dy
;
...
...
@@ -1751,8 +1749,8 @@ void Upright_MLDB_Full_Descriptor_Invoker::Get_Upright_MLDB_Full_Descriptor(cons
const
int
num
=
(
z
+
2
)
*
(
z
+
2
);
for
(
int
i
=
0
;
i
<
num
;
i
++
)
{
for
(
int
j
=
i
+
1
;
j
<
num
;
j
++
)
{
const
float
*
valI
=
values
[
z
].
ptr
<
float
>
(
i
)
;
const
float
*
valJ
=
values
[
z
].
ptr
<
float
>
(
j
)
;
const
float
*
valI
=
&
values
[
i
*
max_channels
]
;
const
float
*
valJ
=
&
values
[
j
*
max_channels
]
;
for
(
int
k
=
0
;
k
<
3
;
++
k
)
{
if
(
*
(
valI
+
k
)
>
*
(
valJ
+
k
))
{
desc
[
dcount1
/
8
]
|=
(
1
<<
(
dcount1
%
8
));
...
...
@@ -1931,7 +1929,11 @@ void MLDB_Descriptor_Subset_Invoker::Get_MLDB_Descriptor_Subset(const KeyPoint&
float
si
=
sin
(
angle
);
// Allocate memory for the matrix of values
Mat
values
((
4
+
9
+
16
)
*
options
.
descriptor_channels
,
1
,
CV_32FC1
);
// Buffer for the M-LDB descriptor
const
int
max_channels
=
3
;
const
int
channels
=
options
.
descriptor_channels
;
CV_Assert
(
channels
<=
max_channels
);
float
values
[(
4
+
9
+
16
)
*
max_channels
];
// Sample everything, but only do the comparisons
const
int
pattern_size
=
options
.
descriptor_pattern_size
;
...
...
@@ -1978,23 +1980,23 @@ void MLDB_Descriptor_Subset_Invoker::Get_MLDB_Descriptor_Subset(const KeyPoint&
}
}
*
(
values
.
ptr
<
float
>
(
options
.
descriptor_channels
*
i
))
=
di
;
float
*
pValues
=
&
values
[
channels
*
i
];
pValues
[
0
]
=
di
;
if
(
options
.
descriptor_
channels
==
2
)
{
*
(
values
.
ptr
<
float
>
(
options
.
descriptor_channels
*
i
+
1
))
=
dx
;
if
(
channels
==
2
)
{
pValues
[
1
]
=
dx
;
}
else
if
(
options
.
descriptor_
channels
==
3
)
{
*
(
values
.
ptr
<
float
>
(
options
.
descriptor_channels
*
i
+
1
))
=
dx
;
*
(
values
.
ptr
<
float
>
(
options
.
descriptor_channels
*
i
+
2
))
=
dy
;
else
if
(
channels
==
3
)
{
pValues
[
1
]
=
dx
;
pValues
[
2
]
=
dy
;
}
}
// Do the comparisons
const
float
*
vals
=
values
.
ptr
<
float
>
(
0
);
const
int
*
comps
=
descriptorBits_
.
ptr
<
int
>
(
0
);
for
(
int
i
=
0
;
i
<
descriptorBits_
.
rows
;
i
++
)
{
if
(
val
s
[
comps
[
2
*
i
]]
>
val
s
[
comps
[
2
*
i
+
1
]])
{
if
(
val
ues
[
comps
[
2
*
i
]]
>
value
s
[
comps
[
2
*
i
+
1
]])
{
desc
[
i
/
8
]
|=
(
1
<<
(
i
%
8
));
}
else
{
desc
[
i
/
8
]
&=
~
(
1
<<
(
i
%
8
));
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录