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
a71797c0
Commit
a71797c0
authored
Jun 28, 2012
by
Andrey Kamaev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Reverted some changes in videostab module
parent
5715d9ef
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
60 deletions
+6
-60
CMakeLists.txt
modules/videostab/CMakeLists.txt
+1
-1
frame_source.cpp
modules/videostab/src/frame_source.cpp
+5
-59
No files found.
modules/videostab/CMakeLists.txt
View file @
a71797c0
set
(
the_description
"Video stabilization"
)
set
(
the_description
"Video stabilization"
)
ocv_define_module
(
videostab opencv_imgproc opencv_features2d opencv_video opencv_photo opencv_calib3d
OPTIONAL opencv_gpu opencv_highgui
)
ocv_define_module
(
videostab opencv_imgproc opencv_features2d opencv_video opencv_photo opencv_calib3d
opencv_highgui OPTIONAL opencv_gpu
)
modules/videostab/src/frame_source.cpp
View file @
a71797c0
...
@@ -43,11 +43,6 @@
...
@@ -43,11 +43,6 @@
#include "precomp.hpp"
#include "precomp.hpp"
#include "opencv2/videostab/frame_source.hpp"
#include "opencv2/videostab/frame_source.hpp"
#include "opencv2/opencv_modules.hpp"
#ifdef HAVE_OPENCV_HIGHGUI
# include "opencv2/highgui/highgui.hpp"
#endif
using
namespace
std
;
using
namespace
std
;
namespace
cv
namespace
cv
...
@@ -55,74 +50,25 @@ namespace cv
...
@@ -55,74 +50,25 @@ namespace cv
namespace
videostab
namespace
videostab
{
{
struct
VideoFileSource
::
VideoReader
{
#ifdef HAVE_OPENCV_HIGHGUI
mutable
VideoCapture
vc
;
#endif
};
VideoFileSource
::
VideoFileSource
(
const
string
&
path
,
bool
volatileFrame
)
VideoFileSource
::
VideoFileSource
(
const
string
&
path
,
bool
volatileFrame
)
:
path_
(
path
),
volatileFrame_
(
volatileFrame
)
,
reader_
(
VideoReader
())
{
reset
();
}
:
path_
(
path
),
volatileFrame_
(
volatileFrame
)
{
reset
();
}
void
VideoFileSource
::
reset
()
void
VideoFileSource
::
reset
()
{
{
#ifdef HAVE_OPENCV_HIGHGUI
reader_
.
release
();
reader_
.
vc
.
release
();
reader_
.
open
(
path_
);
reader_
.
vc
.
open
(
path_
);
if
(
!
reader_
.
isOpened
())
if
(
!
reader_
.
vc
.
isOpened
())
throw
runtime_error
(
"can't open file: "
+
path_
);
throw
runtime_error
(
"can't open file: "
+
path_
);
#else
CV_Error
(
CV_StsNotImplemented
,
"OpenCV has been compiled without video I/O support"
);
#endif
}
}
Mat
VideoFileSource
::
nextFrame
()
Mat
VideoFileSource
::
nextFrame
()
{
{
Mat
frame
;
Mat
frame
;
#ifdef HAVE_OPENCV_HIGHGUI
reader_
>>
frame
;
reader_
.
vc
>>
frame
;
#endif
return
volatileFrame_
?
frame
:
frame
.
clone
();
return
volatileFrame_
?
frame
:
frame
.
clone
();
}
}
int
VideoFileSource
::
width
()
{
#ifdef HAVE_OPENCV_HIGHGUI
return
static_cast
<
int
>
(
reader_
.
vc
.
get
(
CV_CAP_PROP_FRAME_WIDTH
));
#else
return
0
;
#endif
}
int
VideoFileSource
::
height
()
{
#ifdef HAVE_OPENCV_HIGHGUI
return
static_cast
<
int
>
(
reader_
.
vc
.
get
(
CV_CAP_PROP_FRAME_HEIGHT
));
#else
return
0
;
#endif
}
int
VideoFileSource
::
count
()
{
#ifdef HAVE_OPENCV_HIGHGUI
return
static_cast
<
int
>
(
reader_
.
vc
.
get
(
CV_CAP_PROP_FRAME_COUNT
));
#else
return
0
;
#endif
}
double
VideoFileSource
::
fps
()
{
#ifdef HAVE_OPENCV_HIGHGUI
return
reader_
.
vc
.
get
(
CV_CAP_PROP_FPS
);
#else
return
0
;
#endif
}
}
// namespace videostab
}
// namespace videostab
}
// namespace cv
}
// namespace cv
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