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
62f8240b
Commit
62f8240b
authored
Dec 31, 2014
by
Vladislav Vinogradov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix videostab module compilation
parent
03ae1e5a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
13 deletions
+27
-13
optical_flow.hpp
modules/videostab/include/opencv2/videostab/optical_flow.hpp
+2
-2
optical_flow.cpp
modules/videostab/src/optical_flow.cpp
+25
-11
No files found.
modules/videostab/include/opencv2/videostab/optical_flow.hpp
View file @
62f8240b
...
...
@@ -121,7 +121,7 @@ public:
cuda
::
GpuMat
&
status
);
private
:
cuda
::
PyrLKOpticalFlow
optFlowEstimator_
;
Ptr
<
cuda
::
SparsePyrLKOpticalFlow
>
optFlowEstimator_
;
cuda
::
GpuMat
frame0_
,
frame1_
,
points0_
,
points1_
,
status_
,
errors_
;
};
...
...
@@ -136,7 +136,7 @@ public:
OutputArray
errors
);
private
:
cuda
::
PyrLKOpticalFlow
optFlowEstimator_
;
Ptr
<
cuda
::
DensePyrLKOpticalFlow
>
optFlowEstimator_
;
cuda
::
GpuMat
frame0_
,
frame1_
,
flowX_
,
flowY_
,
errors_
;
};
...
...
modules/videostab/src/optical_flow.cpp
View file @
62f8240b
...
...
@@ -45,6 +45,10 @@
#include "opencv2/videostab/optical_flow.hpp"
#include "opencv2/videostab/ring_buffer.hpp"
#ifdef HAVE_OPENCV_CUDAARITHM
#include "opencv2/cudaarithm.hpp"
#endif
namespace
cv
{
namespace
videostab
...
...
@@ -63,6 +67,7 @@ void SparsePyrLkOptFlowEstimator::run(
SparsePyrLkOptFlowEstimatorGpu
::
SparsePyrLkOptFlowEstimatorGpu
()
{
CV_Assert
(
cuda
::
getCudaEnabledDeviceCount
()
>
0
);
optFlowEstimator_
=
cuda
::
SparsePyrLKOpticalFlow
::
create
();
}
...
...
@@ -91,9 +96,9 @@ void SparsePyrLkOptFlowEstimatorGpu::run(
const
cuda
::
GpuMat
&
frame0
,
const
cuda
::
GpuMat
&
frame1
,
const
cuda
::
GpuMat
&
points0
,
cuda
::
GpuMat
&
points1
,
cuda
::
GpuMat
&
status
,
cuda
::
GpuMat
&
errors
)
{
optFlowEstimator_
.
winSize
=
winSize_
;
optFlowEstimator_
.
maxLevel
=
maxLevel_
;
optFlowEstimator_
.
sparse
(
frame0
,
frame1
,
points0
,
points1
,
status
,
&
errors
);
optFlowEstimator_
->
setWinSize
(
winSize_
)
;
optFlowEstimator_
->
setMaxLevel
(
maxLevel_
)
;
optFlowEstimator_
->
calc
(
frame0
,
frame1
,
points0
,
points1
,
status
,
errors
);
}
...
...
@@ -101,15 +106,16 @@ void SparsePyrLkOptFlowEstimatorGpu::run(
const
cuda
::
GpuMat
&
frame0
,
const
cuda
::
GpuMat
&
frame1
,
const
cuda
::
GpuMat
&
points0
,
cuda
::
GpuMat
&
points1
,
cuda
::
GpuMat
&
status
)
{
optFlowEstimator_
.
winSize
=
winSize_
;
optFlowEstimator_
.
maxLevel
=
maxLevel_
;
optFlowEstimator_
.
sparse
(
frame0
,
frame1
,
points0
,
points1
,
status
);
optFlowEstimator_
->
setWinSize
(
winSize_
)
;
optFlowEstimator_
->
setMaxLevel
(
maxLevel_
)
;
optFlowEstimator_
->
calc
(
frame0
,
frame1
,
points0
,
points1
,
status
);
}
DensePyrLkOptFlowEstimatorGpu
::
DensePyrLkOptFlowEstimatorGpu
()
{
CV_Assert
(
cuda
::
getCudaEnabledDeviceCount
()
>
0
);
optFlowEstimator_
=
cuda
::
DensePyrLKOpticalFlow
::
create
();
}
...
...
@@ -120,16 +126,24 @@ void DensePyrLkOptFlowEstimatorGpu::run(
frame0_
.
upload
(
frame0
.
getMat
());
frame1_
.
upload
(
frame1
.
getMat
());
optFlowEstimator_
.
winSize
=
winSize_
;
optFlowEstimator_
.
maxLevel
=
maxLevel_
;
optFlowEstimator_
->
setWinSize
(
winSize_
)
;
optFlowEstimator_
->
setMaxLevel
(
maxLevel_
)
;
if
(
errors
.
needed
())
{
optFlowEstimator_
.
dense
(
frame0_
,
frame1_
,
flowX_
,
flowY_
,
&
errors_
);
errors_
.
download
(
errors
.
getMatRef
());
CV_Error
(
Error
::
StsNotImplemented
,
"DensePyrLkOptFlowEstimatorGpu doesn't support errors calculation"
);
}
else
optFlowEstimator_
.
dense
(
frame0_
,
frame1_
,
flowX_
,
flowY_
);
{
cuda
::
GpuMat
flow
;
optFlowEstimator_
->
calc
(
frame0_
,
frame1_
,
flow
);
cuda
::
GpuMat
flows
[
2
];
cuda
::
split
(
flow
,
flows
);
flowX_
=
flows
[
0
];
flowY_
=
flows
[
1
];
}
flowX_
.
download
(
flowX
.
getMatRef
());
flowY_
.
download
(
flowY
.
getMatRef
());
...
...
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