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
23c22754
Commit
23c22754
authored
Feb 22, 2012
by
Alexander Reshetnikov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added conditional compiling for video i/o tests in highgui.
parent
19ce8c7f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
4 deletions
+14
-4
test_video_io.cpp
modules/highgui/test/test_video_io.cpp
+14
-4
No files found.
modules/highgui/test/test_video_io.cpp
View file @
23c22754
...
...
@@ -379,11 +379,15 @@ void CV_HighGuiTest::SpecificImageTest(const string& dir)
void
CV_HighGuiTest
::
SpecificVideoFileTest
(
const
string
&
dir
,
const
char
codecchars
[
4
])
{
const
string
ext
[]
=
{
"avi"
,
"mov"
,
"mp4"
/*, "mpg", "wmv"*/
};
const
string
ext
[]
=
{
"avi"
,
"mov"
,
"mp4"
,
"mpg"
,
"wmv"
};
const
size_t
n
=
sizeof
(
ext
)
/
sizeof
(
ext
[
0
]);
for
(
size_t
j
=
0
;
j
<
n
;
++
j
)
if
((
ext
[
j
]
!=
"mp4"
)
||
(
string
(
&
codecchars
[
0
],
4
)
!=
"IYUV"
))
for
(
size_t
j
=
0
;
j
<
n
;
++
j
)
if
((
ext
[
j
]
!=
"mp4"
)
||
(
string
(
&
codecchars
[
0
],
4
)
!=
"IYUV"
))
#if defined WIN32 || defined _WIN32
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
];
...
...
@@ -484,6 +488,7 @@ void CV_HighGuiTest::SpecificVideoFileTest(const string& dir, const char codecch
if
(
psnr
>
thresDbell
)
{
ts
->
printf
(
ts
->
LOG
,
"
\n
Reading frame from the file video_%s.%s...
\n
"
,
string
(
&
codecchars
[
0
],
4
).
c_str
(),
ext
[
j
].
c_str
());
ts
->
printf
(
ts
->
LOG
,
"Frame index: %d
\n
"
,
i
+
1
);
ts
->
printf
(
ts
->
LOG
,
"Difference between saved and original images: %g
\n
"
,
psnr
);
ts
->
printf
(
ts
->
LOG
,
"Maximum allowed difference: %g"
,
thresDbell
);
ts
->
printf
(
ts
->
LOG
,
"Error: too big difference between saved and original images.
\n
"
);
...
...
@@ -498,7 +503,7 @@ void CV_HighGuiTest::SpecificVideoFileTest(const string& dir, const char codecch
void
CV_HighGuiTest
::
SpecificVideoCameraTest
(
const
string
&
dir
,
const
char
codecchars
[
4
])
{
const
string
ext
[]
=
{
"avi"
,
"mov"
,
"mp4"
/*, "mpg", "wmv"*/
};
const
string
ext
[]
=
{
"avi"
,
"mov"
,
"mp4"
,
"mpg"
,
"wmv"
};
const
size_t
n
=
sizeof
(
ext
)
/
sizeof
(
ext
[
0
]);
...
...
@@ -513,7 +518,11 @@ void CV_HighGuiTest::SpecificVideoCameraTest(const string& dir, const char codec
return
;
}
for
(
size_t
i
=
0
;
i
<
n
;
++
i
)
if
((
ext
[
i
]
!=
"mp4"
)
||
(
string
(
&
codecchars
[
0
],
4
)
!=
"IYUV"
))
for
(
size_t
i
=
0
;
i
<
n
;
++
i
)
if
((
ext
[
i
]
!=
"mp4"
)
||
(
string
(
&
codecchars
[
0
],
4
)
!=
"IYUV"
))
#if defined WIN32 || defined _WIN32
if
(((
ext
[
i
]
!=
"mov"
)
||
(
string
(
&
codecchars
[
0
],
4
)
==
"XVID"
))
&&
(
ext
[
i
]
!=
"mp4"
))
#endif
{
Mat
frame
;
int
framecount
=
0
;
cv
::
VideoWriter
writer
;
...
...
@@ -603,6 +612,7 @@ void CV_HighGuiTest::SpecificVideoCameraTest(const string& dir, const char codec
if
(
psnr
>
thresDbell
)
{
ts
->
printf
(
ts
->
LOG
,
"
\n
Reading frame from the file video_%s.%s...
\n
"
,
string
(
&
codecchars
[
0
],
4
).
c_str
(),
ext
[
i
].
c_str
());
ts
->
printf
(
ts
->
LOG
,
"Frame index: %d
\n
"
,
framecount
);
ts
->
printf
(
ts
->
LOG
,
"Difference between saved and original images: %g
\n
"
,
psnr
);
ts
->
printf
(
ts
->
LOG
,
"Maximum allowed difference: %g"
,
thresDbell
);
ts
->
printf
(
ts
->
LOG
,
"Error: too big difference between saved and original images.
\n
"
);
...
...
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