Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Opencv
提交
3085fc63
O
Opencv
项目概览
Greenplum
/
Opencv
9 个月 前同步成功
通知
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,体验更适合开发者的 AI 搜索 >>
未验证
提交
3085fc63
编写于
1月 20, 2023
作者:
A
Alexander Smorkalov
提交者:
GitHub
1月 20, 2023
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #23073 from savuor:fix_graphcut_used_edges_dense
USAC fix: GraphCut fails to allocate big dense matrices
上级
952962a1
dbdd357b
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
10 addition
and
8 deletion
+10
-8
modules/calib3d/src/precomp.hpp
modules/calib3d/src/precomp.hpp
+2
-0
modules/calib3d/src/usac/local_optimization.cpp
modules/calib3d/src/usac/local_optimization.cpp
+7
-7
modules/calib3d/test/test_usac.cpp
modules/calib3d/test/test_usac.cpp
+1
-1
未找到文件。
modules/calib3d/src/precomp.hpp
浏览文件 @
3085fc63
...
...
@@ -53,6 +53,8 @@
#include "opencv2/core/ocl.hpp"
#include <set>
#define GET_OPTIMIZED(func) (func)
...
...
modules/calib3d/src/usac/local_optimization.cpp
浏览文件 @
3085fc63
...
...
@@ -20,7 +20,7 @@ protected:
std
::
vector
<
int
>
labeling_inliers
;
std
::
vector
<
double
>
energies
,
weights
;
std
::
vector
<
bool
>
used_edges
;
std
::
set
<
int
>
used_edges
;
std
::
vector
<
Mat
>
gc_models
;
public:
...
...
@@ -40,7 +40,7 @@ public:
energies
=
std
::
vector
<
double
>
(
points_size
);
labeling_inliers
=
std
::
vector
<
int
>
(
points_size
);
used_edges
=
std
::
vector
<
bool
>
(
points_size
*
points_size
);
used_edges
=
std
::
set
<
int
>
(
);
gc_models
=
std
::
vector
<
Mat
>
(
estimator
->
getMaxNumSolutionsNonMinimal
());
}
...
...
@@ -115,7 +115,7 @@ private:
energies
[
pt
]
=
energy
>
1
?
1
:
energy
;
}
std
::
fill
(
used_edges
.
begin
(),
used_edges
.
end
(),
false
);
used_edges
.
clear
(
);
bool
has_edges
=
false
;
// Iterate through all points and set their edges
...
...
@@ -125,12 +125,12 @@ private:
// Iterate through all neighbors
for
(
int
actual_neighbor_idx
:
neighborhood_graph
->
getNeighbors
(
point_idx
))
{
if
(
actual_neighbor_idx
==
point_idx
||
used_edges
[
actual_neighbor_idx
*
points_size
+
point_idx
]
||
used_edges
[
point_idx
*
points_size
+
actual_neighbor_idx
]
)
used_edges
.
count
(
actual_neighbor_idx
*
points_size
+
point_idx
)
>
0
||
used_edges
.
count
(
point_idx
*
points_size
+
actual_neighbor_idx
)
>
0
)
continue
;
used_edges
[
actual_neighbor_idx
*
points_size
+
point_idx
]
=
true
;
used_edges
[
point_idx
*
points_size
+
actual_neighbor_idx
]
=
true
;
used_edges
.
insert
(
actual_neighbor_idx
*
points_size
+
point_idx
)
;
used_edges
.
insert
(
point_idx
*
points_size
+
actual_neighbor_idx
)
;
double
a
=
(
0.5
*
(
energy
+
energies
[
actual_neighbor_idx
]))
*
spatial_coherence
,
b
=
spatial_coherence
,
c
=
spatial_coherence
,
d
=
0
;
...
...
modules/calib3d/test/test_usac.cpp
浏览文件 @
3085fc63
...
...
@@ -416,7 +416,7 @@ TEST (usac_Affine2D, accuracy) {
TEST
(
usac_testUsacParams
,
accuracy
)
{
std
::
vector
<
int
>
gt_inliers
;
const
int
pts_size
=
1500
;
const
int
pts_size
=
1500
00
;
cv
::
RNG
&
rng
=
cv
::
theRNG
();
const
cv
::
UsacParams
usac_params
=
cv
::
UsacParams
();
cv
::
Mat
pts1
,
pts2
,
K1
,
K2
,
mask
,
model
,
rvec
,
tvec
,
R
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录