Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
O
opencv
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
opencv
Commits
83130957
Commit
83130957
authored
Mar 28, 2012
by
Alexander Reshetnikov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Changed saving paths for another highgui tests
parent
2c2616d4
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
16 deletions
+16
-16
test_video_io.cpp
modules/highgui/test/test_video_io.cpp
+14
-14
test_video_pos.cpp
modules/highgui/test/test_video_pos.cpp
+2
-2
No files found.
modules/highgui/test/test_video_io.cpp
View file @
83130957
...
...
@@ -147,7 +147,7 @@ void CV_HighGuiTest::ImageTest(const string& dir)
for
(
size_t
i
=
0
;
i
<
ext_num
;
++
i
)
{
string
ext
=
exts
[
i
];
string
full_name
=
dir
+
"img."
+
ext
;
string
full_name
=
dir
+
"
../../../../
img."
+
ext
;
ts
->
printf
(
ts
->
LOG
,
" full_name : %s
\n
"
,
full_name
.
c_str
());
imwrite
(
full_name
,
image
);
...
...
@@ -216,7 +216,7 @@ void CV_HighGuiTest::ImageTest(const string& dir)
void
CV_HighGuiTest
::
VideoTest
(
const
string
&
dir
,
int
fourcc
)
{
string
src_file
=
dir
+
"../cv/shared/video_for_test.avi"
;
string
tmp_name
=
dir
+
"video.avi"
;
string
tmp_name
=
dir
+
"
../../../../
video.avi"
;
ts
->
printf
(
ts
->
LOG
,
"reading video : %s
\n
"
,
src_file
.
c_str
());
...
...
@@ -310,7 +310,7 @@ void CV_HighGuiTest::SpecificImageTest(const string& dir)
stringstream
s_digit
;
s_digit
<<
i
;
string
full_name
=
dir
+
"img_"
+
s_digit
.
str
()
+
".bmp"
;
string
full_name
=
dir
+
"
../../../../
img_"
+
s_digit
.
str
()
+
".bmp"
;
ts
->
printf
(
ts
->
LOG
,
" full_name : %s
\n
"
,
full_name
.
c_str
());
imwrite
(
full_name
,
image
);
...
...
@@ -387,7 +387,7 @@ void CV_HighGuiTest::SpecificVideoFileTest(const string& dir, const char codecch
if
(((
ext
[
j
]
!=
"mov"
)
||
(
string
(
&
codecchars
[
0
],
4
)
==
"XVID"
))
&&
(
ext
[
j
]
!=
"mp4"
))
#endif
{
const
string
video_file
=
dir
+
"video_"
+
string
(
&
codecchars
[
0
],
4
)
+
"."
+
ext
[
j
];
const
string
video_file
=
dir
+
"
../../../../
video_"
+
string
(
&
codecchars
[
0
],
4
)
+
"."
+
ext
[
j
];
VideoWriter
writer
=
cv
::
VideoWriter
(
video_file
,
CV_FOURCC
(
codecchars
[
0
],
codecchars
[
1
],
codecchars
[
2
],
codecchars
[
3
]),
25
,
cv
::
Size
(
968
,
757
),
true
);
...
...
@@ -428,7 +428,7 @@ void CV_HighGuiTest::SpecificVideoFileTest(const string& dir, const char codecch
img
.
at
<
Vec3b
>
(
k
,
l
)
=
Vec3b
(
0
,
255
,
0
);
else
img
.
at
<
Vec3b
>
(
k
,
l
)
=
Vec3b
(
0
,
0
,
255
);
imwrite
(
dir
+
"QCIF_"
+
s_digit
.
str
()
+
".bmp"
,
img
);
imwrite
(
dir
+
"
../../../../
QCIF_"
+
s_digit
.
str
()
+
".bmp"
,
img
);
writer
<<
img
;
}
...
...
@@ -456,7 +456,7 @@ void CV_HighGuiTest::SpecificVideoFileTest(const string& dir, const char codecch
cv
::
Mat
frame
;
cap
>>
frame
;
if
(
frame
.
empty
())
{
ts
->
printf
(
ts
->
LOG
,
"
\n
Video file directory: %s
\n
"
,
dir
.
c_str
());
ts
->
printf
(
ts
->
LOG
,
"
\n
Video file directory: %s
\n
"
,
(
dir
+
"../../../../"
)
.
c_str
());
ts
->
printf
(
ts
->
LOG
,
"File name: video_%s.%s
\n
"
,
string
(
&
codecchars
[
0
],
4
).
c_str
(),
ext
[
i
].
c_str
());
ts
->
printf
(
ts
->
LOG
,
"Video codec: %s
\n
"
,
string
(
&
codecchars
[
0
],
4
).
c_str
());
ts
->
printf
(
ts
->
LOG
,
"Error: cannot read the next frame with index %d.
\n
"
,
i
+
1
);
...
...
@@ -468,11 +468,11 @@ void CV_HighGuiTest::SpecificVideoFileTest(const string& dir, const char codecch
if
(
i
+
1
<
10
)
{
s_digit
<<
"0"
;
s_digit
<<
i
+
1
;}
else
s_digit
<<
i
+
1
;
cv
::
Mat
img
=
imread
(
dir
+
"QCIF_"
+
s_digit
.
str
()
+
".bmp"
,
CV_LOAD_IMAGE_COLOR
);
cv
::
Mat
img
=
imread
(
dir
+
"
../../../../
QCIF_"
+
s_digit
.
str
()
+
".bmp"
,
CV_LOAD_IMAGE_COLOR
);
if
(
img
.
empty
())
{
ts
->
printf
(
ts
->
LOG
,
"
\n
Error: cannot read an image from %s.
\n
"
,
(
dir
+
"
QCIF_"
+
s_digit
.
str
()
+
".bmp"
).
c_str
());
ts
->
printf
(
ts
->
LOG
,
"
\n
Error: cannot read an image from %s.
\n
"
,
(
dir
+
"../../../../
QCIF_"
+
s_digit
.
str
()
+
".bmp"
).
c_str
());
ts
->
set_failed_test_info
(
ts
->
FAIL_MISMATCH
);
continue
;
}
...
...
@@ -525,11 +525,11 @@ void CV_HighGuiTest::SpecificVideoCameraTest(const string& dir, const char codec
std
::
vector
<
cv
::
Mat
>
tmp_img
(
IMAGE_COUNT
);
writer
.
open
(
dir
+
"video_"
+
string
(
&
codecchars
[
0
],
4
)
+
"."
+
ext
[
i
],
CV_FOURCC
(
codecchars
[
0
],
codecchars
[
1
],
codecchars
[
2
],
codecchars
[
3
]),
25
,
Size
(
968
,
757
),
true
);
writer
.
open
(
dir
+
"
../../../../
video_"
+
string
(
&
codecchars
[
0
],
4
)
+
"."
+
ext
[
i
],
CV_FOURCC
(
codecchars
[
0
],
codecchars
[
1
],
codecchars
[
2
],
codecchars
[
3
]),
25
,
Size
(
968
,
757
),
true
);
if
(
!
writer
.
isOpened
())
{
ts
->
printf
(
ts
->
LOG
,
"
\n
Video file directory: %s
\n
"
,
dir
.
c_str
());
ts
->
printf
(
ts
->
LOG
,
"
\n
Video file directory: %s
\n
"
,
(
dir
+
"../../../../"
)
.
c_str
());
ts
->
printf
(
ts
->
LOG
,
"Video codec: %s
\n
"
,
std
::
string
(
&
codecchars
[
0
],
4
).
c_str
());
ts
->
printf
(
ts
->
LOG
,
"Error: cannot create VideoWriter object for video_%s.%s.
\n
"
,
string
(
&
codecchars
[
0
]).
c_str
(),
ext
[
i
].
c_str
());
ts
->
set_failed_test_info
(
ts
->
FAIL_EXCEPTION
);
...
...
@@ -542,7 +542,7 @@ void CV_HighGuiTest::SpecificVideoCameraTest(const string& dir, const char codec
if
(
frame
.
empty
())
{
ts
->
printf
(
ts
->
LOG
,
"
\n
Video file directory: %s
\n
"
,
dir
.
c_str
());
ts
->
printf
(
ts
->
LOG
,
"
\n
Video file directory: %s
\n
"
,
(
dir
+
"../../../../"
)
.
c_str
());
ts
->
printf
(
ts
->
LOG
,
"File name: video_%s.%s
\n
"
,
string
(
&
codecchars
[
0
],
4
).
c_str
(),
ext
[
i
].
c_str
());
ts
->
printf
(
ts
->
LOG
,
"Video codec: %s
\n
"
,
string
(
&
codecchars
[
0
],
4
).
c_str
());
ts
->
printf
(
ts
->
LOG
,
"Error: cannot read next frame with index %d from the device.
\n
"
,
framecount
);
...
...
@@ -563,7 +563,7 @@ void CV_HighGuiTest::SpecificVideoCameraTest(const string& dir, const char codec
if
(
!
vcap
.
isOpened
())
{
ts
->
printf
(
ts
->
LOG
,
"
\n
Video file directory: %s
\n
"
,
dir
.
c_str
());
ts
->
printf
(
ts
->
LOG
,
"
\n
Video file directory: %s
\n
"
,
(
dir
+
"../../../../"
)
.
c_str
());
ts
->
printf
(
ts
->
LOG
,
"File name: video_%s.%s
\n
"
,
string
(
&
codecchars
[
0
],
4
).
c_str
(),
ext
[
i
].
c_str
());
ts
->
printf
(
ts
->
LOG
,
"Video codec: %s
\n
"
,
string
(
&
codecchars
[
0
],
4
).
c_str
());
ts
->
printf
(
ts
->
LOG
,
"Error: cannot open video file.
\n
"
);
...
...
@@ -575,7 +575,7 @@ void CV_HighGuiTest::SpecificVideoCameraTest(const string& dir, const char codec
if
(
FRAME_COUNT
!=
IMAGE_COUNT
)
{
ts
->
printf
(
ts
->
LOG
,
"
\n
Checking frame count...
\n
"
);
ts
->
printf
(
ts
->
LOG
,
"Video file directory: %s
\n
"
,
dir
.
c_str
());
ts
->
printf
(
ts
->
LOG
,
"Video file directory: %s
\n
"
,
(
dir
+
"../../../../"
)
.
c_str
());
ts
->
printf
(
ts
->
LOG
,
"File name: video_%s.%s
\n
"
,
string
(
&
codecchars
[
0
],
4
).
c_str
(),
ext
[
i
].
c_str
());
ts
->
printf
(
ts
->
LOG
,
"Video codec: %s
\n
"
,
string
(
&
codecchars
[
0
],
4
).
c_str
());
ts
->
printf
(
ts
->
LOG
,
"Required frame count: %d Returned frame count: %d
\n
"
,
IMAGE_COUNT
,
FRAME_COUNT
);
...
...
@@ -593,7 +593,7 @@ void CV_HighGuiTest::SpecificVideoCameraTest(const string& dir, const char codec
if
(
img
.
empty
())
{
ts
->
printf
(
ts
->
LOG
,
"
\n
Video file directory: %s
\n
"
,
dir
.
c_str
());
ts
->
printf
(
ts
->
LOG
,
"
\n
Video file directory: %s
\n
"
,
(
dir
+
"../../../../"
)
.
c_str
());
ts
->
printf
(
ts
->
LOG
,
"File name: video_%s.%s
\n
"
,
string
(
&
codecchars
[
0
],
4
).
c_str
(),
ext
[
i
].
c_str
());
ts
->
printf
(
ts
->
LOG
,
"Video codec: %s
\n
"
,
string
(
&
codecchars
[
0
],
4
).
c_str
());
ts
->
printf
(
ts
->
LOG
,
"Error: cannot read frame with index %d from the video.
\n
"
,
framecount
);
...
...
modules/highgui/test/test_video_pos.cpp
View file @
83130957
...
...
@@ -61,7 +61,7 @@ void CV_PositioningTest::CreateTestVideo(const string& format, int codec, int fr
{
stringstream
s
;
s
<<
codec
;
cv
::
VideoWriter
writer
(
ts
->
get_data_path
()
+
"
video
/test_video_"
+
s
.
str
()
+
"."
+
format
,
codec
,
25
,
cv
::
Size
(
640
,
480
),
false
);
cv
::
VideoWriter
writer
(
ts
->
get_data_path
()
+
"
../../../..
/test_video_"
+
s
.
str
()
+
"."
+
format
,
codec
,
25
,
cv
::
Size
(
640
,
480
),
false
);
for
(
int
i
=
0
;
i
<
framecount
;
++
i
)
{
...
...
@@ -122,7 +122,7 @@ void CV_PositioningTest::run(int)
stringstream
s
;
s
<<
CV_FOURCC
(
codec
[
j
][
0
],
codec
[
j
][
1
],
codec
[
j
][
2
],
codec
[
j
][
3
]);
//codec_bmp_tags[j].tag;
const
string
file_path
=
ts
->
get_data_path
()
+
"
video
/test_video_"
+
s
.
str
()
+
"."
+
format
[
i
];
const
string
file_path
=
ts
->
get_data_path
()
+
"
../../../..
/test_video_"
+
s
.
str
()
+
"."
+
format
[
i
];
bool
error
=
false
;
int
failed
=
0
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment