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
bc3c4951
Commit
bc3c4951
authored
Apr 26, 2012
by
Vadim Pisarevsky
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ok, now positioning seem to work well, at least with ffmpeg 0.10.2 on MacOSX 10.7
parent
c9e6efc2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
56 additions
and
37 deletions
+56
-37
cap_ffmpeg_impl_v2.hpp
modules/highgui/src/cap_ffmpeg_impl_v2.hpp
+0
-0
test_drawing.cpp
modules/highgui/test/test_drawing.cpp
+3
-3
test_ffmpeg.cpp
modules/highgui/test/test_ffmpeg.cpp
+7
-7
test_grfmt.cpp
modules/highgui/test/test_grfmt.cpp
+3
-3
test_positioning.cpp
modules/highgui/test/test_positioning.cpp
+18
-17
test_video_io.cpp
modules/highgui/test/test_video_io.cpp
+7
-3
test_video_pos.cpp
modules/highgui/test/test_video_pos.cpp
+18
-4
No files found.
modules/highgui/src/cap_ffmpeg_impl_v2.hpp
View file @
bc3c4951
This diff is collapsed.
Click to expand it.
modules/highgui/test/test_drawing.cpp
View file @
bc3c4951
...
...
@@ -407,8 +407,8 @@ int CV_DrawingTest_C::checkLineIterator( Mat& _img )
}
#ifdef HAVE_JPEG
TEST
(
Highgui_Drawing
_CPP
,
regression
)
{
CV_DrawingTest_CPP
test
;
test
.
safe_run
();
}
TEST
(
Highgui_Drawing
_C
,
regression
)
{
CV_DrawingTest_C
test
;
test
.
safe_run
();
}
TEST
(
Highgui_Drawing
,
cpp_
regression
)
{
CV_DrawingTest_CPP
test
;
test
.
safe_run
();
}
TEST
(
Highgui_Drawing
,
c_
regression
)
{
CV_DrawingTest_C
test
;
test
.
safe_run
();
}
#endif
class
CV_FillConvexPolyTest
:
public
cvtest
::
BaseTest
...
...
@@ -443,4 +443,4 @@ protected:
}
};
TEST
(
Highgui_Drawing
_FillConvexPoly
,
clipping
)
{
CV_FillConvexPolyTest
test
;
test
.
safe_run
();
}
TEST
(
Highgui_Drawing
,
fillconvexpoly_
clipping
)
{
CV_FillConvexPolyTest
test
;
test
.
safe_run
();
}
modules/highgui/test/test_ffmpeg.cpp
View file @
bc3c4951
...
...
@@ -71,19 +71,19 @@ public:
if
(
tag
!=
MKTAG
(
'H'
,
'2'
,
'6'
,
'3'
)
&&
tag
!=
MKTAG
(
'H'
,
'2'
,
'6'
,
'1'
)
&&
tag
!=
MKTAG
(
'D'
,
'I'
,
'V'
,
'X'
)
&&
//
tag != MKTAG('D', 'I', 'V', 'X') &&
tag
!=
MKTAG
(
'D'
,
'X'
,
'5'
,
'0'
)
&&
tag
!=
MKTAG
(
'X'
,
'V'
,
'I'
,
'D'
)
&&
tag
!=
MKTAG
(
'm'
,
'p'
,
'4'
,
'v'
)
&&
tag
!=
MKTAG
(
'D'
,
'I'
,
'V'
,
'3'
)
&&
tag
!=
MKTAG
(
'W'
,
'M'
,
'V'
,
'1'
)
&&
tag
!=
MKTAG
(
'W'
,
'M'
,
'V'
,
'2'
)
&&
//
tag != MKTAG('D', 'I', 'V', '3') &&
//
tag != MKTAG('W', 'M', 'V', '1') &&
//
tag != MKTAG('W', 'M', 'V', '2') &&
tag
!=
MKTAG
(
'M'
,
'P'
,
'E'
,
'G'
)
&&
tag
!=
MKTAG
(
'M'
,
'J'
,
'P'
,
'G'
)
&&
tag
!=
MKTAG
(
'j'
,
'p'
,
'e'
,
'g'
)
&&
//
tag != MKTAG('j', 'p', 'e', 'g') &&
tag
!=
0
&&
tag
!=
MKTAG
(
'I'
,
'4'
,
'2'
,
'0'
)
&&
tag
!=
MKTAG
(
'Y'
,
'U'
,
'Y'
,
'2'
)
&&
//
tag != MKTAG('Y', 'U', 'Y', '2') &&
tag
!=
MKTAG
(
'F'
,
'L'
,
'V'
,
'1'
)
)
continue
;
...
...
@@ -142,6 +142,6 @@ public:
}
};
TEST
(
Highgui_
FFmpeg_WriteBigVideo
,
regression
)
{
CV_FFmpegWriteBigVideoTest
test
;
test
.
safe_run
();
}
TEST
(
Highgui_
Video
,
ffmpeg_writebig
)
{
CV_FFmpegWriteBigVideoTest
test
;
test
.
safe_run
();
}
#endif
modules/highgui/test/test_grfmt.cpp
View file @
bc3c4951
...
...
@@ -202,12 +202,12 @@ public:
};
#ifdef HAVE_PNG
TEST
(
Highgui_
Grfmt_WriteBigImage
,
regression
)
{
CV_GrfmtWriteBigImageTest
test
;
test
.
safe_run
();
}
TEST
(
Highgui_
Image
,
write_big
)
{
CV_GrfmtWriteBigImageTest
test
;
test
.
safe_run
();
}
#endif
#if defined(HAVE_PNG) && defined(HAVE_TIFF) && defined(HAVE_JPEG)
TEST
(
Highgui_
Grfmt_WriteSequenceImage
,
regression
)
{
CV_GrfmtWriteSequenceImageTest
test
;
test
.
safe_run
();
}
TEST
(
Highgui_
Image
,
write_imageseq
)
{
CV_GrfmtWriteSequenceImageTest
test
;
test
.
safe_run
();
}
#endif
TEST
(
GrfmtReadBMPRLE8
,
regression
)
{
CV_GrfmtReadBMPRLE8Test
test
;
test
.
safe_run
();
}
TEST
(
Highgui_Image
,
read_bmp_rle8
)
{
CV_GrfmtReadBMPRLE8Test
test
;
test
.
safe_run
();
}
modules/highgui/test/test_positioning.cpp
View file @
bc3c4951
...
...
@@ -47,11 +47,11 @@
using
namespace
cv
;
using
namespace
std
;
enum
NAVIGATION_METHOD
{
PROGRESSIVE
,
RANDOM
};
class
CV_VideoPositioningTest
:
public
cvtest
::
BaseTest
{
public
:
enum
{
PROGRESSIVE
,
RANDOM
};
CV_VideoPositioningTest
();
~
CV_VideoPositioningTest
();
virtual
void
run
(
int
)
=
0
;
...
...
@@ -122,14 +122,17 @@ void CV_VideoPositioningTest::run_test(int method)
ts
->
printf
(
cvtest
::
TS
::
LOG
,
"
\n\n
Source files directory: %s
\n
"
,
(
src_dir
+
"video/"
).
c_str
());
const
string
ext
[]
=
{
"avi"
,
"m
p4"
,
"wmv
"
};
const
string
ext
[]
=
{
"avi"
,
"m
ov"
,
"mp4"
,
"mpg
"
};
size_t
n
=
sizeof
(
ext
)
/
sizeof
(
ext
[
0
]
);
int
n
=
(
int
)(
sizeof
(
ext
)
/
sizeof
(
ext
[
0
])
);
int
failed_videos
=
0
;
for
(
size_
t
i
=
0
;
i
<
n
;
++
i
)
for
(
in
t
i
=
0
;
i
<
n
;
++
i
)
{
// skip random positioning test in plain mpegs
if
(
method
==
RANDOM
&&
ext
[
i
]
==
"mpg"
)
continue
;
string
file_path
=
src_dir
+
"video/big_buck_bunny."
+
ext
[
i
];
printf
(
"
\n
Reading video file in %s...
\n
"
,
file_path
.
c_str
());
...
...
@@ -186,20 +189,17 @@ void CV_VideoPositioningTest::run_test(int method)
ts
->
printf
(
cvtest
::
TS
::
LOG
,
"Required pos: %d
\n
Returned pos: %d
\n
"
,
idx
.
at
(
j
),
val
);
ts
->
printf
(
cvtest
::
TS
::
LOG
,
"Error: required and returned positions are not matched.
\n
"
);
ts
->
set_failed_test_info
(
cvtest
::
TS
::
FAIL_INVALID_OUTPUT
);
if
(
!
flag
)
flag
=
!
flag
;
flag
=
true
;
}
if
(
flag
)
failed_iterations
++
;
if
(
flag
)
{
failed_iterations
++
;
failed_videos
++
;
break
;
}
}
ts
->
printf
(
cvtest
::
TS
::
LOG
,
"
\n
Successfull iterations: %d (%d%%)
\n
"
,
idx
.
size
()
-
failed_iterations
,
100
*
(
idx
.
size
()
-
failed_iterations
)
/
idx
.
size
());
ts
->
printf
(
cvtest
::
TS
::
LOG
,
"Failed iterations: %d (%d%%)
\n
"
,
failed_iterations
,
100
*
failed_iterations
/
idx
.
size
());
if
(
failed_frames
||
failed_positions
)
{
ts
->
printf
(
cvtest
::
TS
::
LOG
,
"
\n
FAILED
\n
----------
\n
"
);
failed_videos
++
;
}
cvReleaseCapture
(
&
cap
);
}
...
...
@@ -218,6 +218,6 @@ void CV_VideoRandomPositioningTest::run(int)
}
#if BUILD_WITH_VIDEO_INPUT_SUPPORT
TEST
(
Highgui
Positioning
,
progressive
)
{
CV_VideoProgressivePositioningTest
test
;
test
.
safe_run
();
}
TEST
(
Highgui
Positioning
,
random
)
{
CV_VideoRandomPositioningTest
test
;
test
.
safe_run
();
}
TEST
(
Highgui
_Video
,
seek_
progressive
)
{
CV_VideoProgressivePositioningTest
test
;
test
.
safe_run
();
}
TEST
(
Highgui
_Video
,
seek_
random
)
{
CV_VideoRandomPositioningTest
test
;
test
.
safe_run
();
}
#endif
\ No newline at end of file
modules/highgui/test/test_video_io.cpp
View file @
bc3c4951
...
...
@@ -56,10 +56,14 @@ string fourccToString(int fourcc)
const
VideoFormat
g_specific_fmt_list
[]
=
{
VideoFormat
(
"avi"
,
CV_FOURCC
(
'm'
,
'p'
,
'e'
,
'g'
)),
VideoFormat
(
"avi"
,
CV_FOURCC
(
'X'
,
'V'
,
'I'
,
'D'
)),
VideoFormat
(
"avi"
,
CV_FOURCC
(
'M'
,
'P'
,
'E'
,
'G'
)),
VideoFormat
(
"avi"
,
CV_FOURCC
(
'M'
,
'J'
,
'P'
,
'G'
)),
VideoFormat
(
"avi"
,
CV_FOURCC
(
'I'
,
'Y'
,
'U'
,
'V'
)),
VideoFormat
(
"mkv"
,
CV_FOURCC
(
'X'
,
'V'
,
'I'
,
'D'
)),
VideoFormat
(
"mkv"
,
CV_FOURCC
(
'M'
,
'P'
,
'E'
,
'G'
)),
VideoFormat
(
"mkv"
,
CV_FOURCC
(
'M'
,
'J'
,
'P'
,
'G'
)),
VideoFormat
(
"mov"
,
CV_FOURCC
(
'm'
,
'p'
,
'4'
,
'v'
)),
VideoFormat
()
};
...
...
@@ -516,7 +520,7 @@ TEST(Highgui_Image, regression) { CV_ImageTest test; test.safe_run(); }
#if BUILD_WITH_VIDEO_INPUT_SUPPORT && BUILD_WITH_VIDEO_OUTPUT_SUPPORT
TEST
(
Highgui_Video
,
regression
)
{
CV_VideoTest
test
;
test
.
safe_run
();
}
TEST
(
Highgui_
SpecificVideoFile
,
regression
)
{
CV_SpecificVideoTest
test
;
test
.
safe_run
();
}
TEST
(
Highgui_
Video
,
write_read
)
{
CV_SpecificVideoTest
test
;
test
.
safe_run
();
}
#endif
TEST
(
Highgui_
SpecificImage
,
regression
)
{
CV_SpecificImageTest
test
;
test
.
safe_run
();
}
TEST
(
Highgui_
Image
,
write_read
)
{
CV_SpecificImageTest
test
;
test
.
safe_run
();
}
modules/highgui/test/test_video_pos.cpp
View file @
bc3c4951
...
...
@@ -94,7 +94,8 @@ public:
if
(
fmt
.
empty
()
)
break
;
string
filename
=
getFilename
(
fmt
);
ts
->
printf
(
ts
->
LOG
,
"
\n\n
File: %s
\n
"
,
filename
.
c_str
());
ts
->
printf
(
ts
->
LOG
,
"
\n
File: %s
\n
"
,
filename
.
c_str
());
if
(
!
CreateTestVideo
(
fmt
,
n_frames
)
)
{
ts
->
printf
(
ts
->
LOG
,
"
\n
Error: cannot create video file"
);
...
...
@@ -133,7 +134,21 @@ public:
return
;
}
int
idx1
=
(
int
)
cap
.
get
(
CV_CAP_PROP_POS_FRAMES
);
Mat
img
;
cap
>>
img
;
Mat
img0
=
drawFrame
(
idx
);
if
(
idx
!=
idx1
)
{
ts
->
printf
(
ts
->
LOG
,
"
\n
Error: the current position (%d) after seek is different from specified (%d)
\n
"
,
idx1
,
idx
);
ts
->
printf
(
ts
->
LOG
,
"Saving both frames ...
\n
"
);
ts
->
set_failed_test_info
(
ts
->
FAIL_INVALID_OUTPUT
);
imwrite
(
"opencv_test_highgui_postest_actual.png"
,
img
);
imwrite
(
"opencv_test_highgui_postest_expected.png"
,
img0
);
return
;
}
if
(
img
.
empty
())
{
...
...
@@ -142,10 +157,9 @@ public:
return
;
}
Mat
img0
=
drawFrame
(
idx
);
double
err
=
PSNR
(
img
,
img0
);
if
(
err
<
2
0
)
if
(
err
<
2
5
)
{
ts
->
printf
(
ts
->
LOG
,
"The frame read after positioning to %d is incorrect (PSNR=%g)
\n
"
,
idx
,
err
);
ts
->
printf
(
ts
->
LOG
,
"Saving both frames ...
\n
"
);
...
...
@@ -162,5 +176,5 @@ public:
};
#if BUILD_WITH_VIDEO_INPUT_SUPPORT && BUILD_WITH_VIDEO_OUTPUT_SUPPORT
TEST
(
Highgui_
Positioning
,
regression
)
{
CV_PositioningTest
test
;
test
.
safe_run
();
}
TEST
(
Highgui_
Video
,
seek_random_synthetic
)
{
CV_PositioningTest
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