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
388ccda8
Commit
388ccda8
authored
Dec 04, 2018
by
Vitaly Tuzov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed static analyzer warnings in DISOpticalFlow
parent
2e0150e6
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
0 deletions
+9
-0
dis_flow.cpp
modules/video/src/dis_flow.cpp
+3
-0
variational_refinement.cpp
modules/video/src/variational_refinement.cpp
+6
-0
No files found.
modules/video/src/dis_flow.cpp
View file @
388ccda8
...
@@ -226,9 +226,11 @@ DISOpticalFlowImpl::DISOpticalFlowImpl()
...
@@ -226,9 +226,11 @@ DISOpticalFlowImpl::DISOpticalFlowImpl()
border_size
=
16
;
border_size
=
16
;
use_mean_normalization
=
true
;
use_mean_normalization
=
true
;
use_spatial_propagation
=
true
;
use_spatial_propagation
=
true
;
coarsest_scale
=
10
;
/* Use separate variational refinement instances for different scales to avoid repeated memory allocation: */
/* Use separate variational refinement instances for different scales to avoid repeated memory allocation: */
int
max_possible_scales
=
10
;
int
max_possible_scales
=
10
;
ws
=
hs
=
w
=
h
=
0
;
for
(
int
i
=
0
;
i
<
max_possible_scales
;
i
++
)
for
(
int
i
=
0
;
i
<
max_possible_scales
;
i
++
)
variational_refinement_processors
.
push_back
(
VariationalRefinement
::
create
());
variational_refinement_processors
.
push_back
(
VariationalRefinement
::
create
());
}
}
...
@@ -1035,6 +1037,7 @@ void DISOpticalFlowImpl::Densification_ParBody::operator()(const Range &range) c
...
@@ -1035,6 +1037,7 @@ void DISOpticalFlowImpl::Densification_ParBody::operator()(const Range &range) c
sum_Uy
+=
coef
*
Sy_ptr
[
is
*
dis
->
ws
+
js
];
sum_Uy
+=
coef
*
Sy_ptr
[
is
*
dis
->
ws
+
js
];
sum_coef
+=
coef
;
sum_coef
+=
coef
;
}
}
CV_DbgAssert
(
sum_coef
!=
0
);
Ux_ptr
[
i
*
dis
->
w
+
j
]
=
sum_Ux
/
sum_coef
;
Ux_ptr
[
i
*
dis
->
w
+
j
]
=
sum_Ux
/
sum_coef
;
Uy_ptr
[
i
*
dis
->
w
+
j
]
=
sum_Uy
/
sum_coef
;
Uy_ptr
[
i
*
dis
->
w
+
j
]
=
sum_Uy
/
sum_coef
;
}
}
...
...
modules/video/src/variational_refinement.cpp
View file @
388ccda8
...
@@ -93,6 +93,7 @@ class VariationalRefinementImpl CV_FINAL : public VariationalRefinement
...
@@ -93,6 +93,7 @@ class VariationalRefinementImpl CV_FINAL : public VariationalRefinement
int
red_even_len
,
red_odd_len
;
int
red_even_len
,
red_odd_len
;
int
black_even_len
,
black_odd_len
;
int
black_even_len
,
black_odd_len
;
RedBlackBuffer
();
void
create
(
Size
s
);
void
create
(
Size
s
);
void
release
();
void
release
();
};
};
...
@@ -366,6 +367,10 @@ void VariationalRefinementImpl::updateRepeatedBorders(RedBlackBuffer &dst)
...
@@ -366,6 +367,10 @@ void VariationalRefinementImpl::updateRepeatedBorders(RedBlackBuffer &dst)
}
}
}
}
VariationalRefinementImpl
::
RedBlackBuffer
::
RedBlackBuffer
()
{
release
();
}
void
VariationalRefinementImpl
::
RedBlackBuffer
::
create
(
Size
s
)
void
VariationalRefinementImpl
::
RedBlackBuffer
::
create
(
Size
s
)
{
{
/* Allocate enough memory to include borders */
/* Allocate enough memory to include borders */
...
@@ -386,6 +391,7 @@ void VariationalRefinementImpl::RedBlackBuffer::release()
...
@@ -386,6 +391,7 @@ void VariationalRefinementImpl::RedBlackBuffer::release()
{
{
red
.
release
();
red
.
release
();
black
.
release
();
black
.
release
();
red_even_len
=
red_odd_len
=
black_even_len
=
black_odd_len
=
0
;
}
}
VariationalRefinementImpl
::
ParallelOp_ParBody
::
ParallelOp_ParBody
(
VariationalRefinementImpl
&
_var
,
vector
<
Op
>
_ops
,
VariationalRefinementImpl
::
ParallelOp_ParBody
::
ParallelOp_ParBody
(
VariationalRefinementImpl
&
_var
,
vector
<
Op
>
_ops
,
...
...
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