Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Opencv
提交
e9e9e00d
O
Opencv
项目概览
Greenplum
/
Opencv
大约 1 年 前同步成功
通知
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,发现更多精彩内容 >>
提交
e9e9e00d
编写于
1月 16, 2014
作者:
K
Konstantin Matskevich
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
replaced sprintf with cv::format
上级
ab18c2d1
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
21 addition
and
21 deletion
+21
-21
modules/calib3d/test/test_cameracalibration.cpp
modules/calib3d/test/test_cameracalibration.cpp
+14
-14
modules/calib3d/test/test_chesscorners_timing.cpp
modules/calib3d/test/test_chesscorners_timing.cpp
+7
-7
未找到文件。
modules/calib3d/test/test_cameracalibration.cpp
浏览文件 @
e9e9e00d
...
...
@@ -290,8 +290,8 @@ int CV_CameraCalibrationTest::compare(double* val, double* ref_val, int len,
void
CV_CameraCalibrationTest
::
run
(
int
start_from
)
{
int
code
=
cvtest
::
TS
::
OK
;
c
har
filepath
[
200
]
;
c
har
filename
[
200
]
;
c
v
::
String
filepath
;
c
v
::
String
filename
;
CvSize
imageSize
;
CvSize
etalonSize
;
...
...
@@ -337,12 +337,12 @@ void CV_CameraCalibrationTest::run( int start_from )
int
progress
=
0
;
int
values_read
=
-
1
;
sprintf
(
filepath
,
"%scv/cameracalibration/"
,
ts
->
get_data_path
().
c_str
()
);
sprintf
(
filename
,
"%sdatafiles.txt"
,
filepath
);
datafile
=
fopen
(
filename
,
"r"
);
filepath
=
cv
::
format
(
"%scv/cameracalibration/"
,
ts
->
get_data_path
().
c_str
()
);
filename
=
cv
::
format
(
"%sdatafiles.txt"
,
filepath
.
c_str
()
);
datafile
=
fopen
(
filename
.
c_str
()
,
"r"
);
if
(
datafile
==
0
)
{
ts
->
printf
(
cvtest
::
TS
::
LOG
,
"Could not open file with list of test files: %s
\n
"
,
filename
);
ts
->
printf
(
cvtest
::
TS
::
LOG
,
"Could not open file with list of test files: %s
\n
"
,
filename
.
c_str
()
);
code
=
cvtest
::
TS
::
FAIL_MISSING_TEST_DATA
;
goto
_exit_
;
}
...
...
@@ -354,15 +354,15 @@ void CV_CameraCalibrationTest::run( int start_from )
{
values_read
=
fscanf
(
datafile
,
"%s"
,
i_dat_file
);
CV_Assert
(
values_read
==
1
);
sprintf
(
filename
,
"%s%s"
,
filepath
,
i_dat_file
);
file
=
fopen
(
filename
,
"r"
);
filename
=
cv
::
format
(
"%s%s"
,
filepath
.
c_str
()
,
i_dat_file
);
file
=
fopen
(
filename
.
c_str
()
,
"r"
);
ts
->
update_context
(
this
,
currTest
,
true
);
if
(
file
==
0
)
{
ts
->
printf
(
cvtest
::
TS
::
LOG
,
"Can't open current test file: %s
\n
"
,
filename
);
"Can't open current test file: %s
\n
"
,
filename
.
c_str
()
);
if
(
numTests
==
1
)
{
code
=
cvtest
::
TS
::
FAIL_MISSING_TEST_DATA
;
...
...
@@ -1382,16 +1382,16 @@ void CV_StereoCalibrationTest::run( int )
for
(
int
testcase
=
1
;
testcase
<=
ntests
;
testcase
++
)
{
c
har
filepath
[
1000
]
;
c
v
::
String
filepath
;
char
buf
[
1000
];
sprintf
(
filepath
,
"%scv/stereo/case%d/stereo_calib.txt"
,
ts
->
get_data_path
().
c_str
(),
testcase
);
f
=
fopen
(
filepath
,
"rt"
);
filepath
=
cv
::
format
(
"%scv/stereo/case%d/stereo_calib.txt"
,
ts
->
get_data_path
().
c_str
(),
testcase
);
f
=
fopen
(
filepath
.
c_str
()
,
"rt"
);
Size
patternSize
;
vector
<
string
>
imglist
;
if
(
!
f
||
!
fgets
(
buf
,
sizeof
(
buf
)
-
3
,
f
)
||
sscanf
(
buf
,
"%d%d"
,
&
patternSize
.
width
,
&
patternSize
.
height
)
!=
2
)
{
ts
->
printf
(
cvtest
::
TS
::
LOG
,
"The file %s can not be opened or has invalid content
\n
"
,
filepath
);
ts
->
printf
(
cvtest
::
TS
::
LOG
,
"The file %s can not be opened or has invalid content
\n
"
,
filepath
.
c_str
()
);
ts
->
set_failed_test_info
(
f
?
cvtest
::
TS
::
FAIL_INVALID_TEST_DATA
:
cvtest
::
TS
::
FAIL_MISSING_TEST_DATA
);
return
;
}
...
...
@@ -1405,7 +1405,7 @@ void CV_StereoCalibrationTest::run( int )
buf
[
--
len
]
=
'\0'
;
if
(
buf
[
0
]
==
'#'
)
continue
;
sprintf
(
filepath
,
"%scv/stereo/case%d/%s"
,
ts
->
get_data_path
().
c_str
(),
testcase
,
buf
);
filepath
=
cv
::
format
(
"%scv/stereo/case%d/%s"
,
ts
->
get_data_path
().
c_str
(),
testcase
,
buf
);
imglist
.
push_back
(
string
(
filepath
));
}
fclose
(
f
);
...
...
modules/calib3d/test/test_chesscorners_timing.cpp
浏览文件 @
e9e9e00d
...
...
@@ -62,8 +62,8 @@ void CV_ChessboardDetectorTimingTest::run( int start_from )
int
code
=
cvtest
::
TS
::
OK
;
/* test parameters */
char
filepath
[
1000
]
;
char
filename
[
1000
]
;
std
::
string
filepath
;
std
::
string
filename
;
CvMat
*
_v
=
0
;
CvPoint2D32f
*
v
;
...
...
@@ -75,9 +75,9 @@ void CV_ChessboardDetectorTimingTest::run( int start_from )
int
idx
,
max_idx
;
int
progress
=
0
;
sprintf
(
filepath
,
"%scv/cameracalibration/"
,
ts
->
get_data_path
().
c_str
()
);
sprintf
(
filename
,
"%schessboard_timing_list.dat"
,
filepath
);
CvFileStorage
*
fs
=
cvOpenFileStorage
(
filename
,
0
,
CV_STORAGE_READ
);
filepath
=
cv
::
format
(
"%scv/cameracalibration/"
,
ts
->
get_data_path
().
c_str
()
);
filename
=
cv
::
format
(
"%schessboard_timing_list.dat"
,
filepath
.
c_str
()
);
CvFileStorage
*
fs
=
cvOpenFileStorage
(
filename
.
c_str
()
,
0
,
CV_STORAGE_READ
);
CvFileNode
*
board_list
=
fs
?
cvGetFileNodeByName
(
fs
,
0
,
"boards"
)
:
0
;
if
(
!
fs
||
!
board_list
||
!
CV_NODE_IS_SEQ
(
board_list
->
tag
)
||
...
...
@@ -105,14 +105,14 @@ void CV_ChessboardDetectorTimingTest::run( int start_from )
ts
->
update_context
(
this
,
idx
-
1
,
true
);
/* read the image */
sprintf
(
filename
,
"%s%s"
,
filepath
,
imgname
);
filename
=
cv
::
format
(
"%s%s"
,
filepath
.
c_str
()
,
imgname
);
cv
::
Mat
img2
=
cv
::
imread
(
filename
);
img
=
img2
;
if
(
img2
.
empty
()
)
{
ts
->
printf
(
cvtest
::
TS
::
LOG
,
"one of chessboard images can't be read: %s
\n
"
,
filename
);
ts
->
printf
(
cvtest
::
TS
::
LOG
,
"one of chessboard images can't be read: %s
\n
"
,
filename
.
c_str
()
);
if
(
max_idx
==
1
)
{
code
=
cvtest
::
TS
::
FAIL_MISSING_TEST_DATA
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录