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
25b2958e
Commit
25b2958e
authored
May 09, 2016
by
Vladislav Samsonov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added flow estimation using DCT basis
parent
7d13c8f9
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
83 additions
and
2 deletions
+83
-2
optflow.hpp
modules/optflow/include/opencv2/optflow.hpp
+2
-2
pcaflow.hpp
modules/optflow/include/opencv2/optflow/pcaflow.hpp
+81
-0
pcaflow.cpp
modules/optflow/src/pcaflow.cpp
+0
-0
No files found.
modules/optflow/include/opencv2/optflow.hpp
View file @
25b2958e
...
@@ -43,6 +43,8 @@ the use of this software, even if advised of the possibility of such damage.
...
@@ -43,6 +43,8 @@ the use of this software, even if advised of the possibility of such damage.
#include "opencv2/core.hpp"
#include "opencv2/core.hpp"
#include "opencv2/video.hpp"
#include "opencv2/video.hpp"
#include "opencv2/optflow/pcaflow.hpp"
/**
/**
@defgroup optflow Optical Flow Algorithms
@defgroup optflow Optical Flow Algorithms
...
@@ -193,8 +195,6 @@ CV_EXPORTS_W Ptr<DenseOpticalFlow> createOptFlow_SparseToDense();
...
@@ -193,8 +195,6 @@ CV_EXPORTS_W Ptr<DenseOpticalFlow> createOptFlow_SparseToDense();
CV_EXPORTS_W
Ptr
<
DenseOpticalFlow
>
createOptFlow_BlockMatching
();
CV_EXPORTS_W
Ptr
<
DenseOpticalFlow
>
createOptFlow_BlockMatching
();
CV_EXPORTS_W
Ptr
<
DenseOpticalFlow
>
createOptFlow_PCAFlow
();
//! @}
//! @}
}
//optflow
}
//optflow
...
...
modules/optflow/include/opencv2/optflow/pcaflow.hpp
0 → 100644
View file @
25b2958e
/*
By downloading, copying, installing or using the software you agree to this
license. If you do not agree to this license, do not download, install,
copy or use the software.
License Agreement
For Open Source Computer Vision Library
(3-clause BSD License)
Copyright (C) 2013, OpenCV Foundation, all rights reserved.
Third party copyrights are property of their respective owners.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the names of the copyright holders nor the names of the contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.
This software is provided by the copyright holders and contributors "as is" and
any express or implied warranties, including, but not limited to, the implied
warranties of merchantability and fitness for a particular purpose are
disclaimed. In no event shall copyright holders or contributors be liable for
any direct, indirect, incidental, special, exemplary, or consequential damages
(including, but not limited to, procurement of substitute goods or services;
loss of use, data, or profits; or business interruption) however caused
and on any theory of liability, whether in contract, strict liability,
or tort (including negligence or otherwise) arising in any way out of
the use of this software, even if advised of the possibility of such damage.
*/
#ifndef __OPENCV_OPTFLOW_PCAFLOW_HPP__
#define __OPENCV_OPTFLOW_PCAFLOW_HPP__
#include "opencv2/core.hpp"
#include "opencv2/video.hpp"
namespace
cv
{
namespace
optflow
{
class
OpticalFlowPCAFlow
:
public
DenseOpticalFlow
{
protected
:
const
Size
basisSize
;
const
float
sparseRate
;
// (0 .. 0.1)
const
float
retainedCornersFraction
;
// [0 .. 1]
const
float
occlusionsThreshold
;
public
:
OpticalFlowPCAFlow
(
Size
_basisSize
=
Size
(
18
,
14
),
float
_sparseRate
=
0.02
,
float
_retainedCornersFraction
=
1.0
,
float
_occlusionsThreshold
=
0.00002
);
void
calc
(
InputArray
I0
,
InputArray
I1
,
InputOutputArray
flow
);
void
collectGarbage
();
private
:
void
findSparseFeatures
(
Mat
&
from
,
Mat
&
to
,
std
::
vector
<
Point2f
>
&
features
,
std
::
vector
<
Point2f
>
&
predictedFeatures
)
const
;
void
removeOcclusions
(
Mat
&
from
,
Mat
&
to
,
std
::
vector
<
Point2f
>
&
features
,
std
::
vector
<
Point2f
>
&
predictedFeatures
)
const
;
void
getSystem
(
OutputArray
AOut
,
OutputArray
b1Out
,
OutputArray
b2Out
,
const
std
::
vector
<
Point2f
>
&
features
,
const
std
::
vector
<
Point2f
>
&
predictedFeatures
,
const
Size
size
);
};
CV_EXPORTS_W
Ptr
<
DenseOpticalFlow
>
createOptFlow_PCAFlow
();
}
}
#endif
modules/optflow/src/pcaflow.cpp
View file @
25b2958e
This diff is collapsed.
Click to expand it.
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