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
f9ef5d45
Commit
f9ef5d45
authored
Jun 13, 2016
by
Vladislav Samsonov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added some explanatory comments
parent
8ebe182f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
0 deletions
+22
-0
pcaflow.cpp
modules/optflow/src/pcaflow.cpp
+22
-0
No files found.
modules/optflow/src/pcaflow.cpp
View file @
f9ef5d45
...
...
@@ -62,6 +62,16 @@ OpticalFlowPCAFlow::OpticalFlowPCAFlow( const PCAPrior *_prior, const Size _basi
template
<
typename
T
>
static
inline
int
mathSign
(
T
val
)
{
return
(
T
(
0
)
<
val
)
-
(
val
<
T
(
0
)
);
}
/* Stable symmetric Householder reflection that gives c and s such that
* [ c s ][a] = [d],
* [ s -c ][b] [0]
*
* Output:
* c -- cosine(theta), where theta is the implicit angle of rotation
* (counter-clockwise) in a plane-rotation
* s -- sine(theta)
* r -- two-norm of [a; b]
*/
static
inline
void
symOrtho
(
double
a
,
double
b
,
double
&
c
,
double
&
s
,
double
&
r
)
{
if
(
b
==
0
)
...
...
@@ -92,6 +102,18 @@ static inline void symOrtho( double a, double b, double &c, double &s, double &r
}
}
/* Iterative LSQR algorithm for solving least squares problems.
*
* [1] Paige, C. C. and M. A. Saunders,
* LSQR: An Algorithm for Sparse Linear Equations And Sparse Least Squares
* ACM Trans. Math. Soft., Vol.8, 1982, pp. 43-71.
*
* Solves the following problem:
* argmin_x ||Ax - b|| + damp||x||
*
* Output:
* x -- approximate solution
*/
static
void
solveLSQR
(
const
Mat
&
A
,
const
Mat
&
b
,
OutputArray
xOut
,
const
double
damp
=
0.0
,
const
unsigned
iter_lim
=
10
)
{
...
...
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