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
cff117c0
Commit
cff117c0
authored
Mar 28, 2012
by
Alexander Reshetnikov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updated saving paths for highgui tests
parent
56f5fcd2
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
17 deletions
+17
-17
test_ffmpeg.cpp
modules/highgui/test/test_ffmpeg.cpp
+1
-1
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_ffmpeg.cpp
View file @
cff117c0
...
@@ -70,7 +70,7 @@ public:
...
@@ -70,7 +70,7 @@ public:
{
{
stringstream
s
;
s
<<
codec_bmp_tags
[
j
].
tag
;
stringstream
s
;
s
<<
codec_bmp_tags
[
j
].
tag
;
const
string
filename
=
ts
->
get_data_path
()
+
"../../../../
output_"
+
s
.
str
()
+
".avi"
;
const
string
filename
=
"
output_"
+
s
.
str
()
+
".avi"
;
Mat
img
(
img_r
,
img_c
,
CV_8UC3
,
Scalar
::
all
(
0
));
Mat
img
(
img_r
,
img_c
,
CV_8UC3
,
Scalar
::
all
(
0
));
try
try
...
...
modules/highgui/test/test_video_io.cpp
View file @
cff117c0
...
@@ -147,7 +147,7 @@ void CV_HighGuiTest::ImageTest(const string& dir)
...
@@ -147,7 +147,7 @@ void CV_HighGuiTest::ImageTest(const string& dir)
for
(
size_t
i
=
0
;
i
<
ext_num
;
++
i
)
for
(
size_t
i
=
0
;
i
<
ext_num
;
++
i
)
{
{
string
ext
=
exts
[
i
];
string
ext
=
exts
[
i
];
string
full_name
=
dir
+
"../../../../
img."
+
ext
;
string
full_name
=
"
img."
+
ext
;
ts
->
printf
(
ts
->
LOG
,
" full_name : %s
\n
"
,
full_name
.
c_str
());
ts
->
printf
(
ts
->
LOG
,
" full_name : %s
\n
"
,
full_name
.
c_str
());
imwrite
(
full_name
,
image
);
imwrite
(
full_name
,
image
);
...
@@ -216,7 +216,7 @@ void CV_HighGuiTest::ImageTest(const string& dir)
...
@@ -216,7 +216,7 @@ void CV_HighGuiTest::ImageTest(const string& dir)
void
CV_HighGuiTest
::
VideoTest
(
const
string
&
dir
,
int
fourcc
)
void
CV_HighGuiTest
::
VideoTest
(
const
string
&
dir
,
int
fourcc
)
{
{
string
src_file
=
dir
+
"../cv/shared/video_for_test.avi"
;
string
src_file
=
dir
+
"../cv/shared/video_for_test.avi"
;
string
tmp_name
=
dir
+
"../../../../
video.avi"
;
string
tmp_name
=
"
video.avi"
;
ts
->
printf
(
ts
->
LOG
,
"reading video : %s
\n
"
,
src_file
.
c_str
());
ts
->
printf
(
ts
->
LOG
,
"reading video : %s
\n
"
,
src_file
.
c_str
());
...
@@ -310,7 +310,7 @@ void CV_HighGuiTest::SpecificImageTest(const string& dir)
...
@@ -310,7 +310,7 @@ void CV_HighGuiTest::SpecificImageTest(const string& dir)
stringstream
s_digit
;
s_digit
<<
i
;
stringstream
s_digit
;
s_digit
<<
i
;
string
full_name
=
dir
+
"../../../../
img_"
+
s_digit
.
str
()
+
".bmp"
;
string
full_name
=
"
img_"
+
s_digit
.
str
()
+
".bmp"
;
ts
->
printf
(
ts
->
LOG
,
" full_name : %s
\n
"
,
full_name
.
c_str
());
ts
->
printf
(
ts
->
LOG
,
" full_name : %s
\n
"
,
full_name
.
c_str
());
imwrite
(
full_name
,
image
);
imwrite
(
full_name
,
image
);
...
@@ -387,7 +387,7 @@ void CV_HighGuiTest::SpecificVideoFileTest(const string& dir, const char codecch
...
@@ -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"
))
if
(((
ext
[
j
]
!=
"mov"
)
||
(
string
(
&
codecchars
[
0
],
4
)
==
"XVID"
))
&&
(
ext
[
j
]
!=
"mp4"
))
#endif
#endif
{
{
const
string
video_file
=
dir
+
"../../../../
video_"
+
string
(
&
codecchars
[
0
],
4
)
+
"."
+
ext
[
j
];
const
string
video_file
=
"
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
);
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
...
@@ -428,7 +428,7 @@ void CV_HighGuiTest::SpecificVideoFileTest(const string& dir, const char codecch
img
.
at
<
Vec3b
>
(
k
,
l
)
=
Vec3b
(
0
,
255
,
0
);
img
.
at
<
Vec3b
>
(
k
,
l
)
=
Vec3b
(
0
,
255
,
0
);
else
img
.
at
<
Vec3b
>
(
k
,
l
)
=
Vec3b
(
0
,
0
,
255
);
else
img
.
at
<
Vec3b
>
(
k
,
l
)
=
Vec3b
(
0
,
0
,
255
);
imwrite
(
dir
+
"../../../../
QCIF_"
+
s_digit
.
str
()
+
".bmp"
,
img
);
imwrite
(
"
QCIF_"
+
s_digit
.
str
()
+
".bmp"
,
img
);
writer
<<
img
;
writer
<<
img
;
}
}
...
@@ -456,7 +456,7 @@ void CV_HighGuiTest::SpecificVideoFileTest(const string& dir, const char codecch
...
@@ -456,7 +456,7 @@ void CV_HighGuiTest::SpecificVideoFileTest(const string& dir, const char codecch
cv
::
Mat
frame
;
cap
>>
frame
;
cv
::
Mat
frame
;
cap
>>
frame
;
if
(
frame
.
empty
())
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
"
,
"."
);
ts
->
printf
(
ts
->
LOG
,
"File name: video_%s.%s
\n
"
,
string
(
&
codecchars
[
0
],
4
).
c_str
(),
ext
[
j
].
c_str
());
ts
->
printf
(
ts
->
LOG
,
"File name: video_%s.%s
\n
"
,
string
(
&
codecchars
[
0
],
4
).
c_str
(),
ext
[
j
].
c_str
());
ts
->
printf
(
ts
->
LOG
,
"Video codec: %s
\n
"
,
string
(
&
codecchars
[
0
],
4
).
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
);
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
...
@@ -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
;}
if
(
i
+
1
<
10
)
{
s_digit
<<
"0"
;
s_digit
<<
i
+
1
;}
else
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
(
"
QCIF_"
+
s_digit
.
str
()
+
".bmp"
,
CV_LOAD_IMAGE_COLOR
);
if
(
img
.
empty
())
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
"
,
(
"
QCIF_"
+
s_digit
.
str
()
+
".bmp"
).
c_str
());
ts
->
set_failed_test_info
(
ts
->
FAIL_MISMATCH
);
ts
->
set_failed_test_info
(
ts
->
FAIL_MISMATCH
);
continue
;
continue
;
}
}
...
@@ -525,11 +525,11 @@ void CV_HighGuiTest::SpecificVideoCameraTest(const string& dir, const char codec
...
@@ -525,11 +525,11 @@ void CV_HighGuiTest::SpecificVideoCameraTest(const string& dir, const char codec
std
::
vector
<
cv
::
Mat
>
tmp_img
(
IMAGE_COUNT
);
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
(
"
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
())
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
"
,
"."
);
ts
->
printf
(
ts
->
LOG
,
"Video codec: %s
\n
"
,
std
::
string
(
&
codecchars
[
0
],
4
).
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
->
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
);
ts
->
set_failed_test_info
(
ts
->
FAIL_EXCEPTION
);
...
@@ -542,7 +542,7 @@ void CV_HighGuiTest::SpecificVideoCameraTest(const string& dir, const char codec
...
@@ -542,7 +542,7 @@ void CV_HighGuiTest::SpecificVideoCameraTest(const string& dir, const char codec
if
(
frame
.
empty
())
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
"
,
"."
);
ts
->
printf
(
ts
->
LOG
,
"File name: video_%s.%s
\n
"
,
string
(
&
codecchars
[
0
],
4
).
c_str
(),
ext
[
i
].
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
,
"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
);
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
...
@@ -563,7 +563,7 @@ void CV_HighGuiTest::SpecificVideoCameraTest(const string& dir, const char codec
if
(
!
vcap
.
isOpened
())
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
"
,
"."
);
ts
->
printf
(
ts
->
LOG
,
"File name: video_%s.%s
\n
"
,
string
(
&
codecchars
[
0
],
4
).
c_str
(),
ext
[
i
].
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
,
"Video codec: %s
\n
"
,
string
(
&
codecchars
[
0
],
4
).
c_str
());
ts
->
printf
(
ts
->
LOG
,
"Error: cannot open video file.
\n
"
);
ts
->
printf
(
ts
->
LOG
,
"Error: cannot open video file.
\n
"
);
...
@@ -575,7 +575,7 @@ void CV_HighGuiTest::SpecificVideoCameraTest(const string& dir, const char codec
...
@@ -575,7 +575,7 @@ void CV_HighGuiTest::SpecificVideoCameraTest(const string& dir, const char codec
if
(
FRAME_COUNT
!=
IMAGE_COUNT
)
if
(
FRAME_COUNT
!=
IMAGE_COUNT
)
{
{
ts
->
printf
(
ts
->
LOG
,
"
\n
Checking frame count...
\n
"
);
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
"
,
"."
);
ts
->
printf
(
ts
->
LOG
,
"File name: video_%s.%s
\n
"
,
string
(
&
codecchars
[
0
],
4
).
c_str
(),
ext
[
i
].
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
,
"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
);
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
...
@@ -593,7 +593,7 @@ void CV_HighGuiTest::SpecificVideoCameraTest(const string& dir, const char codec
if
(
img
.
empty
())
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
"
,
"."
);
ts
->
printf
(
ts
->
LOG
,
"File name: video_%s.%s
\n
"
,
string
(
&
codecchars
[
0
],
4
).
c_str
(),
ext
[
i
].
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
,
"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
);
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 @
cff117c0
...
@@ -61,7 +61,7 @@ void CV_PositioningTest::CreateTestVideo(const string& format, int codec, int fr
...
@@ -61,7 +61,7 @@ void CV_PositioningTest::CreateTestVideo(const string& format, int codec, int fr
{
{
stringstream
s
;
s
<<
codec
;
stringstream
s
;
s
<<
codec
;
cv
::
VideoWriter
writer
(
ts
->
get_data_path
()
+
"../../../../
test_video_"
+
s
.
str
()
+
"."
+
format
,
codec
,
25
,
cv
::
Size
(
640
,
480
),
false
);
cv
::
VideoWriter
writer
(
"
test_video_"
+
s
.
str
()
+
"."
+
format
,
codec
,
25
,
cv
::
Size
(
640
,
480
),
false
);
for
(
int
i
=
0
;
i
<
framecount
;
++
i
)
for
(
int
i
=
0
;
i
<
framecount
;
++
i
)
{
{
...
@@ -122,7 +122,7 @@ void CV_PositioningTest::run(int)
...
@@ -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;
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
()
+
"../../../../
test_video_"
+
s
.
str
()
+
"."
+
format
[
i
];
const
string
file_path
=
"
test_video_"
+
s
.
str
()
+
"."
+
format
[
i
];
bool
error
=
false
;
int
failed
=
0
;
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