Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenCV
opencv
提交
c9a4775d
O
opencv
项目概览
OpenCV
/
opencv
上一次同步 9 个月
通知
992
Star
71100
Fork
55581
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
O
opencv
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
未验证
提交
c9a4775d
编写于
7月 23, 2023
作者:
A
Alexander Smorkalov
提交者:
GitHub
7月 23, 2023
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #24047 from ivashmak:remove_unused_4.x
Remove unused features in USAC in 4.x
上级
12acf560
0bcd66d5
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
2 addition
and
102 deletion
+2
-102
modules/calib3d/src/usac.hpp
modules/calib3d/src/usac.hpp
+2
-12
modules/calib3d/src/usac/utils.cpp
modules/calib3d/src/usac/utils.cpp
+0
-90
未找到文件。
modules/calib3d/src/usac.hpp
浏览文件 @
c9a4775d
...
...
@@ -176,7 +176,7 @@ public:
//-------------------------- ESSENTIAL MATRIX -----------------------
class
EssentialNonMinimalSolverViaF
:
public
NonMinimalSolver
{
public:
static
Ptr
<
EssentialNonMinimalSolverViaF
>
create
(
const
Mat
&
points_
,
const
cv
::
Mat
&
K1
,
const
Mat
&
K2
);
static
Ptr
<
EssentialNonMinimalSolverViaF
>
create
(
const
Mat
&
points_
,
const
cv
::
Mat
&
K1
,
const
Mat
&
K2
);
};
class
EssentialNonMinimalSolverViaT
:
public
NonMinimalSolver
{
...
...
@@ -432,7 +432,7 @@ public:
};
class
EssentialEstimator
:
public
Estimator
{
public
:
public:
static
Ptr
<
EssentialEstimator
>
create
(
const
Ptr
<
MinimalSolver
>
&
min_solver_
,
const
Ptr
<
NonMinimalSolver
>
&
non_min_solver_
,
const
Ptr
<
Degeneracy
>
&
degeneracy_
);
};
...
...
@@ -542,11 +542,6 @@ public:
int
cell_size_x_img1_
,
int
cell_size_y_img1_
,
int
cell_size_x_img2_
,
int
cell_size_y_img2_
,
int
max_neighbors
);
};
class
GridNeighborhoodGraph2Images
:
public
NeighborhoodGraph
{
public:
static
Ptr
<
GridNeighborhoodGraph2Images
>
create
(
const
Mat
&
points
,
int
points_size
,
float
cell_size_x_img1_
,
float
cell_size_y_img1_
,
float
cell_size_x_img2_
,
float
cell_size_y_img2_
);
};
////////////////////////////////////// UNIFORM SAMPLER ////////////////////////////////////////////
class
UniformSampler
:
public
Sampler
{
...
...
@@ -554,11 +549,6 @@ public:
static
Ptr
<
UniformSampler
>
create
(
int
state
,
int
sample_size_
,
int
points_size_
);
};
class
QuasiUniformSampler
:
public
Sampler
{
public:
static
Ptr
<
QuasiUniformSampler
>
create
(
int
state
,
int
sample_size_
,
int
points_size_
);
};
/////////////////////////////////// PROSAC (SIMPLE) SAMPLER ///////////////////////////////////////
class
ProsacSimpleSampler
:
public
Sampler
{
public:
...
...
modules/calib3d/src/usac/utils.cpp
浏览文件 @
c9a4775d
...
...
@@ -826,94 +826,4 @@ Ptr<GridNeighborhoodGraph> GridNeighborhoodGraph::create(const Mat &points,
return
makePtr
<
GridNeighborhoodGraphImpl
>
(
points
,
points_size
,
cell_size_x_img1_
,
cell_size_y_img1_
,
cell_size_x_img2_
,
cell_size_y_img2_
,
max_neighbors
);
}
class
GridNeighborhoodGraph2ImagesImpl
:
public
GridNeighborhoodGraph2Images
{
private:
// This struct is used for the nearest neighbors search by griding two images.
struct
CellCoord
{
int
c1x
,
c1y
;
CellCoord
(
int
c1x_
,
int
c1y_
)
{
c1x
=
c1x_
;
c1y
=
c1y_
;
}
bool
operator
==
(
const
CellCoord
&
o
)
const
{
return
c1x
==
o
.
c1x
&&
c1y
==
o
.
c1y
;
}
bool
operator
<
(
const
CellCoord
&
o
)
const
{
if
(
c1x
<
o
.
c1x
)
return
true
;
return
c1x
==
o
.
c1x
&&
c1y
<
o
.
c1y
;
}
};
std
::
vector
<
std
::
vector
<
int
>>
graph
;
public:
GridNeighborhoodGraph2ImagesImpl
(
const
Mat
&
container_
,
int
points_size
,
float
cell_size_x_img1
,
float
cell_size_y_img1
,
float
cell_size_x_img2
,
float
cell_size_y_img2
)
{
std
::
map
<
CellCoord
,
std
::
vector
<
int
>>
neighbors_map1
,
neighbors_map2
;
const
auto
*
const
container
=
(
float
*
)
container_
.
data
;
// Key is cell position. The value is indexes of neighbors.
const
auto
cell_sz_x1
=
1.
f
/
cell_size_x_img1
,
cell_sz_y1
=
1.
f
/
cell_size_y_img1
,
cell_sz_x2
=
1.
f
/
cell_size_x_img2
,
cell_sz_y2
=
1.
f
/
cell_size_y_img2
;
const
int
dimension
=
container_
.
cols
;
for
(
int
i
=
0
;
i
<
points_size
;
i
++
)
{
const
int
idx
=
dimension
*
i
;
neighbors_map1
[
CellCoord
((
int
)(
container
[
idx
]
*
cell_sz_x1
),
(
int
)(
container
[
idx
+
1
]
*
cell_sz_y1
))].
emplace_back
(
i
);
neighbors_map2
[
CellCoord
((
int
)(
container
[
idx
+
2
]
*
cell_sz_x2
),
(
int
)(
container
[
idx
+
3
]
*
cell_sz_y2
))].
emplace_back
(
i
);
}
//--------- create a graph ----------
graph
=
std
::
vector
<
std
::
vector
<
int
>>
(
points_size
);
// store neighbors cells into graph (2D vector)
for
(
const
auto
&
cell
:
neighbors_map1
)
{
const
int
neighbors_in_cell
=
static_cast
<
int
>
(
cell
.
second
.
size
());
// only one point in cell -> no neighbors
if
(
neighbors_in_cell
<
2
)
continue
;
const
std
::
vector
<
int
>
&
neighbors
=
cell
.
second
;
// ---------- fill graph -----
// for speed-up we make no symmetric graph, eg, x has a neighbor y, but y does not have x
const
int
v_in_cell
=
neighbors
[
0
];
// there is always at least one neighbor
auto
&
graph_row
=
graph
[
v_in_cell
];
graph_row
.
reserve
(
neighbors_in_cell
);
for
(
int
n
:
neighbors
)
if
(
n
!=
v_in_cell
)
graph_row
.
emplace_back
(
n
);
}
// fill neighbors of a second image
for
(
const
auto
&
cell
:
neighbors_map2
)
{
if
(
cell
.
second
.
size
()
<
2
)
continue
;
const
std
::
vector
<
int
>
&
neighbors
=
cell
.
second
;
const
int
v_in_cell
=
neighbors
[
0
];
auto
&
graph_row
=
graph
[
v_in_cell
];
for
(
const
int
&
n
:
neighbors
)
if
(
n
!=
v_in_cell
)
{
bool
has
=
false
;
for
(
const
int
&
nn
:
graph_row
)
if
(
n
==
nn
)
{
has
=
true
;
break
;
}
if
(
!
has
)
graph_row
.
emplace_back
(
n
);
}
}
}
const
std
::
vector
<
std
::
vector
<
int
>>
&
getGraph
()
const
override
{
return
graph
;
}
inline
const
std
::
vector
<
int
>
&
getNeighbors
(
int
point_idx
)
const
override
{
// Note, neighbors vector also includes point_idx!
return
graph
[
point_idx
];
}
};
Ptr
<
GridNeighborhoodGraph2Images
>
GridNeighborhoodGraph2Images
::
create
(
const
Mat
&
points
,
int
points_size
,
float
cell_size_x_img1_
,
float
cell_size_y_img1_
,
float
cell_size_x_img2_
,
float
cell_size_y_img2_
)
{
return
makePtr
<
GridNeighborhoodGraph2ImagesImpl
>
(
points
,
points_size
,
cell_size_x_img1_
,
cell_size_y_img1_
,
cell_size_x_img2_
,
cell_size_y_img2_
);
}
}}
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录