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
562e4042
Commit
562e4042
authored
Apr 25, 2012
by
Vadim Pisarevsky
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed HighguiFramecount.regression test (and renamed it to Highgui_Video.framecount)
parent
fb292b1b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
27 deletions
+15
-27
test_framecount.cpp
modules/highgui/test/test_framecount.cpp
+15
-27
No files found.
modules/highgui/test/test_framecount.cpp
View file @
562e4042
...
...
@@ -66,6 +66,7 @@ void CV_FramecountTest::run(int)
ts
->
printf
(
cvtest
::
TS
::
LOG
,
"
\n\n
Source files directory: %s
\n
"
,
(
src_dir
+
"video/"
).
c_str
());
int
failed
=
0
;
Ptr
<
CvCapture
>
cap
;
for
(
size_t
i
=
0
;
i
<
n
;
++
i
)
{
...
...
@@ -73,26 +74,25 @@ void CV_FramecountTest::run(int)
string
file_path
=
src_dir
+
"video/big_buck_bunny."
+
ext
[
i
];
printf
(
"
\n
Reading video file in %s...
\n
"
,
file_path
.
c_str
());
CvCapture
*
cap
=
cvCreateFileCapture
(
file_path
.
c_str
());
if
(
!
cap
)
cap
=
cvCreateFileCapture
(
file_path
.
c_str
());
if
(
cap
.
empty
())
{
ts
->
printf
(
cvtest
::
TS
::
LOG
,
"
\n
File information (video %d):
\n\n
Name: big_buck_bunny.%s
\n
FAILED
\n\n
"
,
i
+
1
,
ext
[
i
].
c_str
());
ts
->
printf
(
cvtest
::
TS
::
LOG
,
"Error: cannot read source video file.
\n
"
);
ts
->
set_failed_test_info
(
cvtest
::
TS
::
FAIL_INVALID_TEST_DATA
);
failed
++
;
continue
;
return
;
}
cvSetCaptureProperty
(
cap
,
CV_CAP_PROP_POS_FRAMES
,
0
);
IplImage
*
frame
;
int
FrameCount
=
-
1
;
//
cvSetCaptureProperty(cap, CV_CAP_PROP_POS_FRAMES, 0);
IplImage
*
frame
;
int
FrameCount
=
0
;
do
for
(;;)
{
FrameCount
++
;
frame
=
cvQueryFrame
(
cap
);
if
(
!
frame
)
break
;
FrameCount
++
;
}
while
(
frame
);
int
framecount
=
(
int
)
cvGetCaptureProperty
(
cap
,
CV_CAP_PROP_FRAME_COUNT
);
...
...
@@ -102,28 +102,16 @@ void CV_FramecountTest::run(int)
"Frame count returned by cvGetCaptureProperty function: %d
\n
"
,
i
+
1
,
ext
[
i
].
c_str
(),
time_sec
*
fps
,
FrameCount
,
framecount
);
code
=
FrameCount
!=
time_sec
*
fps
?
cvtest
::
TS
::
FAIL_INVALID_OUTPUT
:
FrameCount
!=
framecount
?
cvtest
::
TS
::
FAIL_INVALID_OUTPUT
:
code
;
if
(
code
)
if
(
(
FrameCount
!=
cvRound
(
time_sec
*
fps
)
||
FrameCount
!=
framecount
)
&&
ext
[
i
]
!=
"mpg"
)
{
ts
->
printf
(
cvtest
::
TS
::
LOG
,
"FAILED
\n
"
);
ts
->
printf
(
cvtest
::
TS
::
LOG
,
"
\n
Error: actual frame count and returned frame count are not matched.
\n
"
);
ts
->
set_failed_test_info
(
c
ode
);
failed
++
;
ts
->
set_failed_test_info
(
c
vtest
::
TS
::
FAIL_INVALID_OUTPUT
);
return
;
}
else
{
ts
->
printf
(
cvtest
::
TS
::
LOG
,
"OK
\n
"
);
ts
->
set_failed_test_info
(
ts
->
OK
);
}
cvReleaseImage
(
&
frame
);
cvReleaseCapture
(
&
cap
);
}
ts
->
printf
(
cvtest
::
TS
::
LOG
,
"
\n
Successfull experiments: %d (%d%%)
\n
"
,
n
-
failed
,
(
n
-
failed
)
*
100
/
n
);
ts
->
printf
(
cvtest
::
TS
::
LOG
,
"Failed experiments: %d (%d%%)
\n
"
,
failed
,
failed
*
100
/
n
);
}
#if BUILD_WITH_VIDEO_INPUT_SUPPORT
TEST
(
Highgui
Framecount
,
regression
)
{
CV_FramecountTest
test
;
test
.
safe_run
();}
TEST
(
Highgui
_Video
,
framecount
)
{
CV_FramecountTest
test
;
test
.
safe_run
();}
#endif
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