Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Opencv
提交
e8a173bc
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,发现更多精彩内容 >>
提交
e8a173bc
编写于
10月 09, 2012
作者:
K
Kirill Kornyakov
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'master' of
git://5.9.49.245/opencv
上级
9b8c4739
5047f2d6
变更
10
隐藏空白更改
内联
并排
Showing
10 changed file
with
98 addition
and
48 deletion
+98
-48
cmake/OpenCVModule.cmake
cmake/OpenCVModule.cmake
+2
-2
modules/calib3d/perf/perf_pnp.cpp
modules/calib3d/perf/perf_pnp.cpp
+13
-5
modules/calib3d/src/solvepnp.cpp
modules/calib3d/src/solvepnp.cpp
+2
-0
modules/features2d/perf/perf_batchDistance.cpp
modules/features2d/perf/perf_batchDistance.cpp
+21
-31
modules/features2d/perf/perf_fast.cpp
modules/features2d/perf/perf_fast.cpp
+14
-8
modules/features2d/perf/perf_orb.cpp
modules/features2d/perf/perf_orb.cpp
+7
-0
modules/ts/CMakeLists.txt
modules/ts/CMakeLists.txt
+2
-1
modules/ts/include/opencv2/ts/ts_perf.hpp
modules/ts/include/opencv2/ts/ts_perf.hpp
+3
-0
modules/ts/src/ts_perf.cpp
modules/ts/src/ts_perf.cpp
+26
-1
modules/video/perf/perf_optflowpyrlk.cpp
modules/video/perf/perf_optflowpyrlk.cpp
+8
-0
未找到文件。
cmake/OpenCVModule.cmake
浏览文件 @
e8a173bc
...
...
@@ -581,7 +581,7 @@ function(ocv_add_perf_tests)
__ocv_parse_test_sources
(
PERF
${
ARGN
}
)
# opencv_highgui is required for imread/imwrite
set
(
perf_deps
${
the_module
}
opencv_ts opencv_highgui
${
OPENCV_PERF_
${
the_module
}
_DEPS
}
)
set
(
perf_deps
${
the_module
}
opencv_ts opencv_highgui
${
OPENCV_PERF_
${
the_module
}
_DEPS
}
${
OPENCV_MODULE_opencv_ts_DEPS
}
)
ocv_check_dependencies
(
${
perf_deps
}
)
if
(
OCV_DEPENDENCIES_FOUND
)
...
...
@@ -632,7 +632,7 @@ function(ocv_add_accuracy_tests)
__ocv_parse_test_sources
(
TEST
${
ARGN
}
)
# opencv_highgui is required for imread/imwrite
set
(
test_deps
${
the_module
}
opencv_ts opencv_highgui
${
OPENCV_TEST_
${
the_module
}
_DEPS
}
)
set
(
test_deps
${
the_module
}
opencv_ts opencv_highgui
${
OPENCV_TEST_
${
the_module
}
_DEPS
}
${
OPENCV_MODULE_opencv_ts_DEPS
}
)
ocv_check_dependencies
(
${
test_deps
}
)
if
(
OCV_DEPENDENCIES_FOUND
)
...
...
modules/calib3d/perf/perf_pnp.cpp
浏览文件 @
e8a173bc
#include "perf_precomp.hpp"
#include "opencv2/core/internal.hpp"
using
namespace
std
;
using
namespace
cv
;
...
...
@@ -48,7 +49,10 @@ PERF_TEST_P(PointsNum_Algo, solvePnP,
declare
.
in
(
points3d
,
points2d
);
TEST_CYCLE_N
(
1000
)
solvePnP
(
points3d
,
points2d
,
intrinsics
,
distortion
,
rvec
,
tvec
,
false
,
algo
);
TEST_CYCLE_N
(
1000
)
{
solvePnP
(
points3d
,
points2d
,
intrinsics
,
distortion
,
rvec
,
tvec
,
false
,
algo
);
}
SANITY_CHECK
(
rvec
,
1e-6
);
SANITY_CHECK
(
tvec
,
1e-6
);
...
...
@@ -83,7 +87,10 @@ PERF_TEST(PointsNum_Algo, solveP3P)
declare
.
in
(
points3d
,
points2d
);
TEST_CYCLE_N
(
1000
)
solvePnP
(
points3d
,
points2d
,
intrinsics
,
distortion
,
rvec
,
tvec
,
false
,
CV_P3P
);
TEST_CYCLE_N
(
1000
)
{
solvePnP
(
points3d
,
points2d
,
intrinsics
,
distortion
,
rvec
,
tvec
,
false
,
CV_P3P
);
}
SANITY_CHECK
(
rvec
,
1e-6
);
SANITY_CHECK
(
tvec
,
1e-6
);
...
...
@@ -117,9 +124,10 @@ PERF_TEST_P(PointsNum, SolvePnPRansac, testing::Values(4, 3*9, 7*13))
Mat
rvec
;
Mat
tvec
;
solvePnPRansac
(
object
,
image
,
camera_mat
,
dist_coef
,
rvec
,
tvec
);
declare
.
time
(
3.0
);
#ifdef HAVE_TBB
// limit concurrency to get determenistic result
cv
::
Ptr
<
tbb
::
task_scheduler_init
>
one_thread
=
new
tbb
::
task_scheduler_init
(
1
);
#endif
TEST_CYCLE
()
{
...
...
modules/calib3d/src/solvepnp.cpp
浏览文件 @
e8a173bc
...
...
@@ -260,6 +260,8 @@ namespace cv
{
rvec
.
copyTo
(
initRvec
);
tvec
.
copyTo
(
initTvec
);
generator
.
state
=
theRNG
().
state
;
//to control it somehow...
}
private:
PnPSolver
&
operator
=
(
const
PnPSolver
&
);
...
...
modules/features2d/perf/perf_batchDistance.cpp
浏览文件 @
e8a173bc
...
...
@@ -6,17 +6,15 @@ using namespace perf;
using
std
::
tr1
::
make_tuple
;
using
std
::
tr1
::
get
;
CV_FLAGS
(
NormType
,
NORM_L1
,
NORM_L2
,
NORM_L2SQR
,
NORM_HAMMING
,
NORM_HAMMING2
)
CV_ENUM
(
SourceType
,
CV_32F
,
CV_8U
)
CV_ENUM
(
DestinationType
,
CV_32F
,
CV_32S
)
CV_ENUM
(
NormType
,
NORM_L1
,
NORM_L2
,
NORM_L2SQR
,
NORM_HAMMING
,
NORM_HAMMING2
)
typedef
std
::
tr1
::
tuple
<
NormType
,
Destination
Type
,
bool
>
Norm_Destination_CrossCheck_t
;
typedef
std
::
tr1
::
tuple
<
NormType
,
Mat
Type
,
bool
>
Norm_Destination_CrossCheck_t
;
typedef
perf
::
TestBaseWithParam
<
Norm_Destination_CrossCheck_t
>
Norm_Destination_CrossCheck
;
typedef
std
::
tr1
::
tuple
<
NormType
,
bool
>
Norm_CrossCheck_t
;
typedef
perf
::
TestBaseWithParam
<
Norm_CrossCheck_t
>
Norm_CrossCheck
;
typedef
std
::
tr1
::
tuple
<
Source
Type
,
bool
>
Source_CrossCheck_t
;
typedef
std
::
tr1
::
tuple
<
Mat
Type
,
bool
>
Source_CrossCheck_t
;
typedef
perf
::
TestBaseWithParam
<
Source_CrossCheck_t
>
Source_CrossCheck
;
void
generateData
(
Mat
&
query
,
Mat
&
train
,
const
int
sourceType
);
...
...
@@ -29,27 +27,25 @@ PERF_TEST_P(Norm_Destination_CrossCheck, batchDistance_8U,
)
{
NormType
normType
=
get
<
0
>
(
GetParam
());
DestinationType
destinationType
=
get
<
1
>
(
GetParam
());
int
destinationType
=
get
<
1
>
(
GetParam
());
bool
isCrossCheck
=
get
<
2
>
(
GetParam
());
int
knn
=
isCrossCheck
?
1
:
0
;
Mat
queryDescriptors
;
Mat
trainDescriptors
;
Mat
dist
;
Mat
ndix
;
int
knn
=
1
;
generateData
(
queryDescriptors
,
trainDescriptors
,
CV_8U
);
if
(
!
isCrossCheck
)
{
knn
=
0
;
}
declare
.
time
(
30
);
TEST_CYCLE
()
{
batchDistance
(
queryDescriptors
,
trainDescriptors
,
dist
,
destinationType
,
(
isCrossCheck
)
?
ndix
:
noArray
(),
normType
,
knn
,
Mat
(),
0
,
isCrossCheck
);
}
SANITY_CHECK
(
dist
);
if
(
isCrossCheck
)
SANITY_CHECK
(
ndix
);
}
PERF_TEST_P
(
Norm_CrossCheck
,
batchDistance_Dest_32S
,
...
...
@@ -60,25 +56,23 @@ PERF_TEST_P(Norm_CrossCheck, batchDistance_Dest_32S,
{
NormType
normType
=
get
<
0
>
(
GetParam
());
bool
isCrossCheck
=
get
<
1
>
(
GetParam
());
int
knn
=
isCrossCheck
?
1
:
0
;
Mat
queryDescriptors
;
Mat
trainDescriptors
;
Mat
dist
;
Mat
ndix
;
int
knn
=
1
;
generateData
(
queryDescriptors
,
trainDescriptors
,
CV_8U
);
if
(
!
isCrossCheck
)
{
knn
=
0
;
}
declare
.
time
(
30
);
TEST_CYCLE
()
{
batchDistance
(
queryDescriptors
,
trainDescriptors
,
dist
,
CV_32S
,
(
isCrossCheck
)
?
ndix
:
noArray
(),
normType
,
knn
,
Mat
(),
0
,
isCrossCheck
);
}
SANITY_CHECK
(
dist
);
if
(
isCrossCheck
)
SANITY_CHECK
(
ndix
);
}
PERF_TEST_P
(
Source_CrossCheck
,
batchDistance_L2
,
...
...
@@ -87,27 +81,25 @@ PERF_TEST_P(Source_CrossCheck, batchDistance_L2,
)
)
{
SourceType
sourceType
=
get
<
0
>
(
GetParam
());
int
sourceType
=
get
<
0
>
(
GetParam
());
bool
isCrossCheck
=
get
<
1
>
(
GetParam
());
int
knn
=
isCrossCheck
?
1
:
0
;
Mat
queryDescriptors
;
Mat
trainDescriptors
;
Mat
dist
;
Mat
ndix
;
int
knn
=
1
;
generateData
(
queryDescriptors
,
trainDescriptors
,
sourceType
);
if
(
!
isCrossCheck
)
{
knn
=
0
;
}
declare
.
time
(
30
);
TEST_CYCLE
()
{
batchDistance
(
queryDescriptors
,
trainDescriptors
,
dist
,
CV_32F
,
(
isCrossCheck
)
?
ndix
:
noArray
(),
NORM_L2
,
knn
,
Mat
(),
0
,
isCrossCheck
);
}
SANITY_CHECK
(
dist
);
if
(
isCrossCheck
)
SANITY_CHECK
(
ndix
);
}
PERF_TEST_P
(
Norm_CrossCheck
,
batchDistance_32F
,
...
...
@@ -118,25 +110,23 @@ PERF_TEST_P(Norm_CrossCheck, batchDistance_32F,
{
NormType
normType
=
get
<
0
>
(
GetParam
());
bool
isCrossCheck
=
get
<
1
>
(
GetParam
());
int
knn
=
isCrossCheck
?
1
:
0
;
Mat
queryDescriptors
;
Mat
trainDescriptors
;
Mat
dist
;
Mat
ndix
;
int
knn
=
1
;
generateData
(
queryDescriptors
,
trainDescriptors
,
CV_32F
);
if
(
!
isCrossCheck
)
{
knn
=
0
;
}
declare
.
time
(
30
);
TEST_CYCLE
()
{
batchDistance
(
queryDescriptors
,
trainDescriptors
,
dist
,
CV_32F
,
(
isCrossCheck
)
?
ndix
:
noArray
(),
normType
,
knn
,
Mat
(),
0
,
isCrossCheck
);
}
SANITY_CHECK
(
dist
);
if
(
isCrossCheck
)
SANITY_CHECK
(
ndix
);
}
void
generateData
(
Mat
&
query
,
Mat
&
train
,
const
int
sourceType
)
...
...
modules/features2d/perf/perf_fast.cpp
浏览文件 @
e8a173bc
...
...
@@ -6,15 +6,23 @@ using namespace perf;
using
std
::
tr1
::
make_tuple
;
using
std
::
tr1
::
get
;
typedef
perf
::
TestBaseWithParam
<
std
::
string
>
fast
;
enum
{
TYPE_5_8
=
FastFeatureDetector
::
TYPE_5_8
,
TYPE_7_12
=
FastFeatureDetector
::
TYPE_7_12
,
TYPE_9_16
=
FastFeatureDetector
::
TYPE_9_16
};
CV_ENUM
(
FastType
,
TYPE_5_8
,
TYPE_7_12
,
TYPE_9_16
)
typedef
std
::
tr1
::
tuple
<
String
,
FastType
>
File_Type_t
;
typedef
perf
::
TestBaseWithParam
<
File_Type_t
>
fast
;
#define FAST_IMAGES \
"cv/detectors_descriptors_evaluation/images_datasets/leuven/img1.png",\
"stitching/a3.png"
PERF_TEST_P
(
fast
,
detectForORB
,
testing
::
Values
(
FAST_IMAGES
))
PERF_TEST_P
(
fast
,
detect
,
testing
::
Combine
(
testing
::
Values
(
FAST_IMAGES
),
testing
::
ValuesIn
(
FastType
::
all
())
))
{
String
filename
=
getDataPath
(
GetParam
());
String
filename
=
getDataPath
(
get
<
0
>
(
GetParam
()));
int
type
=
get
<
1
>
(
GetParam
());
Mat
frame
=
imread
(
filename
,
IMREAD_GRAYSCALE
);
if
(
frame
.
empty
())
...
...
@@ -22,13 +30,11 @@ PERF_TEST_P(fast, detectForORB, testing::Values(FAST_IMAGES))
declare
.
in
(
frame
);
FastFeatureDetector
fd
(
20
,
true
,
FastFeatureDetector
::
TYPE_5_8
);
FastFeatureDetector
fd
(
20
,
true
,
type
);
vector
<
KeyPoint
>
points
;
TEST_CYCLE
()
fd
.
detect
(
frame
,
points
);
fd
=
FastFeatureDetector
(
20
,
true
,
FastFeatureDetector
::
TYPE_7_12
);
TEST_CYCLE
()
fd
.
detect
(
frame
,
points
);
fd
=
FastFeatureDetector
(
20
,
true
,
FastFeatureDetector
::
TYPE_9_16
);
TEST_CYCLE
()
fd
.
detect
(
frame
,
points
);
SANITY_CHECK_KEYPOINTS
(
points
);
}
modules/features2d/perf/perf_orb.cpp
浏览文件 @
e8a173bc
...
...
@@ -26,6 +26,8 @@ PERF_TEST_P(orb, detect, testing::Values(ORB_IMAGES))
vector
<
KeyPoint
>
points
;
TEST_CYCLE
()
detector
(
frame
,
mask
,
points
);
SANITY_CHECK_KEYPOINTS
(
points
);
}
PERF_TEST_P
(
orb
,
extract
,
testing
::
Values
(
ORB_IMAGES
))
...
...
@@ -46,6 +48,8 @@ PERF_TEST_P(orb, extract, testing::Values(ORB_IMAGES))
Mat
descriptors
;
TEST_CYCLE
()
detector
(
frame
,
mask
,
points
,
descriptors
,
true
);
SANITY_CHECK
(
descriptors
);
}
PERF_TEST_P
(
orb
,
full
,
testing
::
Values
(
ORB_IMAGES
))
...
...
@@ -64,4 +68,7 @@ PERF_TEST_P(orb, full, testing::Values(ORB_IMAGES))
Mat
descriptors
;
TEST_CYCLE
()
detector
(
frame
,
mask
,
points
,
descriptors
,
false
);
SANITY_CHECK_KEYPOINTS
(
points
);
SANITY_CHECK
(
descriptors
);
}
modules/ts/CMakeLists.txt
浏览文件 @
e8a173bc
...
...
@@ -10,7 +10,8 @@ endif()
set
(
OPENCV_MODULE_IS_PART_OF_WORLD FALSE
)
ocv_add_module
(
ts opencv_core
)
ocv_add_module
(
ts opencv_core opencv_features2d
)
ocv_glob_module_sources
()
ocv_module_include_directories
()
ocv_create_module
()
...
...
modules/ts/include/opencv2/ts/ts_perf.hpp
浏览文件 @
e8a173bc
...
...
@@ -2,6 +2,7 @@
#define __OPENCV_TS_PERF_HPP__
#include "opencv2/core/core.hpp"
#include "opencv2/features2d/features2d.hpp"
#include "ts_gtest.h"
#ifdef HAVE_TBB
...
...
@@ -165,6 +166,7 @@ class CV_EXPORTS Regression
{
public:
static
Regression
&
add
(
TestBase
*
test
,
const
std
::
string
&
name
,
cv
::
InputArray
array
,
double
eps
=
DBL_EPSILON
,
ERROR_TYPE
err
=
ERROR_ABSOLUTE
);
static
Regression
&
addKeypoints
(
TestBase
*
test
,
const
std
::
string
&
name
,
const
std
::
vector
<
cv
::
KeyPoint
>&
array
,
double
eps
=
DBL_EPSILON
,
ERROR_TYPE
err
=
ERROR_ABSOLUTE
);
static
void
Init
(
const
std
::
string
&
testSuitName
,
const
std
::
string
&
ext
=
".xml"
);
Regression
&
operator
()
(
const
std
::
string
&
name
,
cv
::
InputArray
array
,
double
eps
=
DBL_EPSILON
,
ERROR_TYPE
err
=
ERROR_ABSOLUTE
);
...
...
@@ -199,6 +201,7 @@ private:
};
#define SANITY_CHECK(array, ...) ::perf::Regression::add(this, #array, array , ## __VA_ARGS__)
#define SANITY_CHECK_KEYPOINTS(array, ...) ::perf::Regression::addKeypoints(this, #array, array , ## __VA_ARGS__)
/*****************************************************************************************\
...
...
modules/ts/src/ts_perf.cpp
浏览文件 @
e8a173bc
...
...
@@ -103,6 +103,24 @@ Regression& Regression::add(TestBase* test, const std::string& name, cv::InputAr
return
instance
()(
name
,
array
,
eps
,
err
);
}
Regression
&
Regression
::
addKeypoints
(
TestBase
*
test
,
const
std
::
string
&
name
,
const
std
::
vector
<
cv
::
KeyPoint
>&
array
,
double
eps
,
ERROR_TYPE
err
)
{
int
len
=
(
int
)
array
.
size
();
cv
::
Mat
pt
(
len
,
1
,
CV_32FC2
,
(
void
*
)
&
array
[
0
].
pt
,
sizeof
(
cv
::
KeyPoint
));
cv
::
Mat
size
(
len
,
1
,
CV_32FC1
,
(
void
*
)
&
array
[
0
].
size
,
sizeof
(
cv
::
KeyPoint
));
cv
::
Mat
angle
(
len
,
1
,
CV_32FC1
,
(
void
*
)
&
array
[
0
].
angle
,
sizeof
(
cv
::
KeyPoint
));
cv
::
Mat
response
(
len
,
1
,
CV_32FC1
,
(
void
*
)
&
array
[
0
].
response
,
sizeof
(
cv
::
KeyPoint
));
cv
::
Mat
octave
(
len
,
1
,
CV_32SC1
,
(
void
*
)
&
array
[
0
].
octave
,
sizeof
(
cv
::
KeyPoint
));
cv
::
Mat
class_id
(
len
,
1
,
CV_32SC1
,
(
void
*
)
&
array
[
0
].
class_id
,
sizeof
(
cv
::
KeyPoint
));
return
Regression
::
add
(
test
,
name
+
"-pt"
,
pt
,
eps
,
ERROR_ABSOLUTE
)
(
name
+
"-size"
,
size
,
eps
,
ERROR_ABSOLUTE
)
(
name
+
"-angle"
,
angle
,
eps
,
ERROR_ABSOLUTE
)
(
name
+
"-response"
,
response
,
eps
,
err
)
(
name
+
"-octave"
,
octave
,
eps
,
ERROR_ABSOLUTE
)
(
name
+
"-class_id"
,
class_id
,
eps
,
ERROR_ABSOLUTE
);
}
void
Regression
::
Init
(
const
std
::
string
&
testSuitName
,
const
std
::
string
&
ext
)
{
instance
().
init
(
testSuitName
,
ext
);
...
...
@@ -490,6 +508,12 @@ void Regression::verify(cv::FileNode node, cv::InputArray array, double eps, ERR
Regression
&
Regression
::
operator
()
(
const
std
::
string
&
name
,
cv
::
InputArray
array
,
double
eps
,
ERROR_TYPE
err
)
{
if
(
!
array
.
empty
()
&&
array
.
depth
()
==
CV_USRTYPE1
)
{
ADD_FAILURE
()
<<
" Can not check regression for CV_USRTYPE1 data type for "
<<
name
;
return
*
this
;
}
std
::
string
nodename
=
getCurrentTestNodeName
();
cv
::
FileNode
n
=
rootIn
[
nodename
];
...
...
@@ -674,6 +698,8 @@ cv::Size TestBase::getSize(cv::InputArray a)
bool
TestBase
::
next
()
{
bool
has_next
=
++
currentIter
<
nIters
&&
totalTime
<
timeLimit
;
cv
::
theRNG
().
state
=
param_seed
;
//this rng should generate same numbers for each run
#ifdef ANDROID
if
(
log_power_checkpoints
)
{
...
...
@@ -948,7 +974,6 @@ void TestBase::SetUp()
currentIter
=
(
unsigned
int
)
-
1
;
timeLimit
=
timeLimitDefault
;
times
.
clear
();
cv
::
theRNG
().
state
=
param_seed
;
//this rng should generate same numbers for each run
}
void
TestBase
::
TearDown
()
...
...
modules/video/perf/perf_optflowpyrlk.cpp
浏览文件 @
e8a173bc
...
...
@@ -91,6 +91,10 @@ PERF_TEST_P(Path_Idx_Cn_NPoints_WSize, OpticalFlowPyrLK_full, testing::Combine(
Size
(
winSize
,
winSize
),
maxLevel
,
criteria
,
flags
,
minEigThreshold
);
}
SANITY_CHECK
(
outPoints
);
SANITY_CHECK
(
status
);
SANITY_CHECK
(
err
,
1e-5
);
}
typedef
tr1
::
tuple
<
std
::
string
,
int
,
int
,
tr1
::
tuple
<
int
,
int
>
,
int
,
bool
>
Path_Idx_Cn_NPoints_WSize_Deriv_t
;
...
...
@@ -166,6 +170,10 @@ PERF_TEST_P(Path_Idx_Cn_NPoints_WSize_Deriv, OpticalFlowPyrLK_self, testing::Com
Size
(
winSize
,
winSize
),
maxLevel
,
criteria
,
flags
,
minEigThreshold
);
}
SANITY_CHECK
(
outPoints
);
SANITY_CHECK
(
status
);
SANITY_CHECK
(
err
,
1e-5
);
}
CV_ENUM
(
PyrBorderMode
,
BORDER_DEFAULT
,
BORDER_TRANSPARENT
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录