Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Opencv
提交
6fe1898a
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,发现更多精彩内容 >>
提交
6fe1898a
编写于
3月 06, 2017
作者:
A
Alexander Alekhin
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #8294 from alalek:fix_stitching_failure
上级
990e87ef
e65c6270
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
42 addition
and
3 deletion
+42
-3
modules/flann/include/opencv2/flann/kdtree_index.h
modules/flann/include/opencv2/flann/kdtree_index.h
+5
-0
modules/flann/include/opencv2/flann/lsh_table.h
modules/flann/include/opencv2/flann/lsh_table.h
+4
-0
modules/flann/include/opencv2/flann/random.h
modules/flann/include/opencv2/flann/random.h
+25
-3
modules/stitching/perf/perf_stich.cpp
modules/stitching/perf/perf_stich.cpp
+5
-0
modules/stitching/src/matchers.cpp
modules/stitching/src/matchers.cpp
+3
-0
未找到文件。
modules/flann/include/opencv2/flann/kdtree_index.h
浏览文件 @
6fe1898a
...
...
@@ -125,7 +125,12 @@ public:
/* Construct the randomized trees. */
for
(
int
i
=
0
;
i
<
trees_
;
i
++
)
{
/* Randomize the order of vectors to allow for unbiased sampling. */
#ifndef OPENCV_FLANN_USE_STD_RAND
cv
::
randShuffle
(
vind_
);
#else
std
::
random_shuffle
(
vind_
.
begin
(),
vind_
.
end
());
#endif
tree_roots_
[
i
]
=
divideTree
(
&
vind_
[
0
],
int
(
size_
)
);
}
}
...
...
modules/flann/include/opencv2/flann/lsh_table.h
浏览文件 @
6fe1898a
...
...
@@ -350,7 +350,11 @@ inline LshTable<unsigned char>::LshTable(unsigned int feature_size, unsigned int
// A bit brutal but fast to code
std
::
vector
<
size_t
>
indices
(
feature_size
*
CHAR_BIT
);
for
(
size_t
i
=
0
;
i
<
feature_size
*
CHAR_BIT
;
++
i
)
indices
[
i
]
=
i
;
#ifndef OPENCV_FLANN_USE_STD_RAND
cv
::
randShuffle
(
indices
);
#else
std
::
random_shuffle
(
indices
.
begin
(),
indices
.
end
());
#endif
// Generate a random set of order of subsignature_size_ bits
for
(
unsigned
int
i
=
0
;
i
<
key_size_
;
++
i
)
{
...
...
modules/flann/include/opencv2/flann/random.h
浏览文件 @
6fe1898a
...
...
@@ -40,13 +40,31 @@
namespace
cvflann
{
inline
int
rand
()
{
#ifndef OPENCV_FLANN_USE_STD_RAND
# if INT_MAX == RAND_MAX
int
v
=
cv
::
theRNG
().
next
()
&
INT_MAX
;
# else
int
v
=
cv
::
theRNG
().
uniform
(
0
,
RAND_MAX
+
1
);
# endif
#else
int
v
=
std
::
rand
();
#endif // OPENCV_FLANN_USE_STD_RAND
return
v
;
}
/**
* Seeds the random number generator
* @param seed Random seed
*/
inline
void
seed_random
(
unsigned
int
seed
)
{
srand
(
seed
);
#ifndef OPENCV_FLANN_USE_STD_RAND
cv
::
theRNG
()
=
cv
::
RNG
(
seed
);
#else
std
::
srand
(
seed
);
#endif
}
/*
...
...
@@ -60,7 +78,7 @@ inline void seed_random(unsigned int seed)
*/
inline
double
rand_double
(
double
high
=
1.0
,
double
low
=
0
)
{
return
low
+
((
high
-
low
)
*
(
std
::
rand
()
/
(
RAND_MAX
+
1.0
)));
return
low
+
((
high
-
low
)
*
(
rand
()
/
(
RAND_MAX
+
1.0
)));
}
/**
...
...
@@ -71,7 +89,7 @@ inline double rand_double(double high = 1.0, double low = 0)
*/
inline
int
rand_int
(
int
high
=
RAND_MAX
,
int
low
=
0
)
{
return
low
+
(
int
)
(
double
(
high
-
low
)
*
(
std
::
rand
()
/
(
RAND_MAX
+
1.0
)));
return
low
+
(
int
)
(
double
(
high
-
low
)
*
(
rand
()
/
(
RAND_MAX
+
1.0
)));
}
/**
...
...
@@ -107,7 +125,11 @@ public:
for
(
int
i
=
0
;
i
<
size_
;
++
i
)
vals_
[
i
]
=
i
;
// shuffle the elements in the array
#ifndef OPENCV_FLANN_USE_STD_RAND
cv
::
randShuffle
(
vals_
);
#else
std
::
random_shuffle
(
vals_
.
begin
(),
vals_
.
end
());
#endif
counter_
=
0
;
}
...
...
modules/stitching/perf/perf_stich.cpp
浏览文件 @
6fe1898a
...
...
@@ -2,6 +2,8 @@
#include "opencv2/imgcodecs.hpp"
#include "opencv2/opencv_modules.hpp"
#include "opencv2/core/ocl.hpp"
using
namespace
std
;
using
namespace
cv
;
using
namespace
perf
;
...
...
@@ -161,6 +163,9 @@ PERF_TEST_P(stitchDatasets, affine, testing::Combine(AFFINE_DATASETS, TEST_DETEC
Ptr
<
Stitcher
>
stitcher
=
Stitcher
::
create
(
Stitcher
::
SCANS
,
false
);
stitcher
->
setFeaturesFinder
(
featuresFinder
);
if
(
cv
::
ocl
::
useOpenCL
())
cv
::
theRNG
()
=
cv
::
RNG
(
12345
);
// prevent fails of Windows OpenCL builds (see #8294)
startTimer
();
stitcher
->
stitch
(
imgs
,
pano
);
stopTimer
();
...
...
modules/stitching/src/matchers.cpp
浏览文件 @
6fe1898a
...
...
@@ -70,9 +70,12 @@ struct MatchPairsBody : ParallelLoopBody
void
operator
()(
const
Range
&
r
)
const
{
cv
::
RNG
rng
=
cv
::
theRNG
();
// save entry rng state
const
int
num_images
=
static_cast
<
int
>
(
features
.
size
());
for
(
int
i
=
r
.
start
;
i
<
r
.
end
;
++
i
)
{
cv
::
theRNG
()
=
cv
::
RNG
(
rng
.
state
+
i
);
// force "stable" RNG seed for each processed pair
int
from
=
near_pairs
[
i
].
first
;
int
to
=
near_pairs
[
i
].
second
;
int
pair_idx
=
from
*
num_images
+
to
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录