Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
O
opencv_contrib
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_contrib
Commits
1764f924
Commit
1764f924
authored
Jul 26, 2016
by
Vladislav Samsonov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed OpenCL check behavior
parent
55f093a4
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
4 deletions
+11
-4
pcaflow.hpp
modules/optflow/include/opencv2/optflow/pcaflow.hpp
+1
-0
optical_flow_evaluation.cpp
modules/optflow/samples/optical_flow_evaluation.cpp
+6
-1
pcaflow.cpp
modules/optflow/src/pcaflow.cpp
+4
-3
No files found.
modules/optflow/include/opencv2/optflow/pcaflow.hpp
View file @
1764f924
...
...
@@ -100,6 +100,7 @@ protected:
const
float
occlusionsThreshold
;
const
float
dampingFactor
;
const
float
claheClip
;
bool
useOpenCL
;
public
:
OpticalFlowPCAFlow
(
Ptr
<
const
PCAPrior
>
_prior
=
Ptr
<
const
PCAPrior
>
(),
const
Size
_basisSize
=
Size
(
18
,
14
),
...
...
modules/optflow/samples/optical_flow_evaluation.cpp
View file @
1764f924
...
...
@@ -283,7 +283,12 @@ int main( int argc, char** argv )
double
startTick
,
time
;
startTick
=
(
double
)
getTickCount
();
// measure time
algorithm
->
calc
(
i1
,
i2
,
flow
);
if
(
useGpu
)
algorithm
->
calc
(
i1
,
i2
,
flow
.
getUMat
(
ACCESS_RW
));
else
algorithm
->
calc
(
i1
,
i2
,
flow
);
time
=
((
double
)
getTickCount
()
-
startTick
)
/
getTickFrequency
();
printf
(
"
\n
Time [s]: %.3f
\n
"
,
time
);
if
(
display_images
)
...
...
modules/optflow/src/pcaflow.cpp
View file @
1764f924
...
...
@@ -321,7 +321,7 @@ void OpticalFlowPCAFlow::getSystem( OutputArray AOut, OutputArray b1Out, OutputA
AOut
.
create
(
features
.
size
(),
basisSize
.
area
(),
CV_32F
);
b1Out
.
create
(
features
.
size
(),
1
,
CV_32F
);
b2Out
.
create
(
features
.
size
(),
1
,
CV_32F
);
if
(
ocl
::
useOpenCL
()
)
if
(
useOpenCL
)
{
UMat
A
=
AOut
.
getUMat
();
Mat
b1
=
b1Out
.
getMat
();
...
...
@@ -369,7 +369,7 @@ void OpticalFlowPCAFlow::getSystem( OutputArray A1Out, OutputArray A2Out, Output
b1Out
.
create
(
features
.
size
()
+
prior
->
getPadding
(),
1
,
CV_32F
);
b2Out
.
create
(
features
.
size
()
+
prior
->
getPadding
(),
1
,
CV_32F
);
if
(
ocl
::
useOpenCL
()
)
if
(
useOpenCL
)
{
UMat
A
=
A1Out
.
getUMat
();
Mat
b1
=
b1Out
.
getMat
();
...
...
@@ -444,6 +444,7 @@ void OpticalFlowPCAFlow::calc( InputArray I0, InputArray I1, InputOutputArray fl
CV_Assert
(
to
.
channels
()
==
1
);
const
Mat
fromOrig
=
from
.
getMat
(
ACCESS_READ
).
clone
();
useOpenCL
=
flowOut
.
isUMat
()
&&
ocl
::
useOpenCL
();
applyCLAHE
(
from
,
claheClip
);
applyCLAHE
(
to
,
claheClip
);
...
...
@@ -481,7 +482,7 @@ OpticalFlowPCAFlow::OpticalFlowPCAFlow( Ptr<const PCAPrior> _prior, const Size _
float
_dampingFactor
,
float
_claheClip
)
:
prior
(
_prior
),
basisSize
(
_basisSize
),
sparseRate
(
_sparseRate
),
retainedCornersFraction
(
_retainedCornersFraction
),
occlusionsThreshold
(
_occlusionsThreshold
),
dampingFactor
(
_dampingFactor
),
claheClip
(
_claheClip
)
dampingFactor
(
_dampingFactor
),
claheClip
(
_claheClip
)
,
useOpenCL
(
false
)
{
CV_Assert
(
sparseRate
>
0
&&
sparseRate
<=
0.1
);
CV_Assert
(
retainedCornersFraction
>=
0
&&
retainedCornersFraction
<=
1.0
);
...
...
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