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
9d1aa37e
Commit
9d1aa37e
authored
Sep 05, 2012
by
Yury Zemlyanskiy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Small fixes
parent
4e0fdf22
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
11 deletions
+11
-11
simpleflow.cpp
modules/video/src/simpleflow.cpp
+11
-11
No files found.
modules/video/src/simpleflow.cpp
View file @
9d1aa37e
...
...
@@ -128,11 +128,11 @@ static void crossBilateralFilter(const Mat& image,
multiply
(
weights
,
confidence_extended
(
window_rows
,
window_cols
),
weights
);
multiply
(
weights
,
weights_space
,
weights
);
float
weights_sum
=
sum
(
weights
)[
0
];
float
weights_sum
=
(
float
)
sum
(
weights
)[
0
];
for
(
int
ch
=
0
;
ch
<
2
;
++
ch
)
{
multiply
(
weights
,
image_extended_channels
[
ch
](
window_rows
,
window_cols
),
weighted_sum
);
float
total_sum
=
sum
(
weighted_sum
)[
0
];
float
total_sum
=
(
float
)
sum
(
weighted_sum
)[
0
];
dst
.
at
<
Vec2f
>
(
row
,
col
)[
ch
]
=
(
flag
&&
fabs
(
weights_sum
)
<
1e-9
)
?
image
.
at
<
float
>
(
row
,
col
)
...
...
@@ -154,10 +154,10 @@ static void calcConfidence(const Mat& prev,
for
(
int
r0
=
0
;
r0
<
rows
;
++
r0
)
{
for
(
int
c0
=
0
;
c0
<
cols
;
++
c0
)
{
Vec2f
flow_at_point
=
flow
.
at
<
Vec2f
>
(
r0
,
c0
);
int
u0
=
floor
(
flow_at_point
[
0
]
+
0.5
);
int
u0
=
cvRound
(
flow_at_point
[
0
]
);
if
(
r0
+
u0
<
0
)
{
u0
=
-
r0
;
}
if
(
r0
+
u0
>=
rows
)
{
u0
=
rows
-
1
-
r0
;
}
int
v0
=
floor
(
flow_at_point
[
1
]
+
0.5
);
int
v0
=
cvRound
(
flow_at_point
[
1
]
);
if
(
c0
+
v0
<
0
)
{
v0
=
-
c0
;
}
if
(
c0
+
v0
>=
cols
)
{
v0
=
cols
-
1
-
c0
;
}
...
...
@@ -531,12 +531,12 @@ CV_EXPORTS_W void calcOpticalFlowSF(Mat& from,
removeOcclusions
(
flow
,
flow_inv
,
occ_thr
,
(
float
)
occ_thr
,
confidence
);
removeOcclusions
(
flow_inv
,
flow
,
occ_thr
,
(
float
)
occ_thr
,
confidence_inv
);
Mat
speed_up
=
Mat
::
zeros
(
curr_from
.
size
(),
CV_8U
);
...
...
@@ -606,8 +606,8 @@ CV_EXPORTS_W void calcOpticalFlowSF(Mat& from,
flow
,
averaging_radius
,
max_flow
,
sigma_dist
,
sigma_color
);
(
float
)
sigma_dist
,
(
float
)
sigma_color
);
calcConfidence
(
curr_to
,
curr_from
,
flow_inv
,
confidence_inv
,
max_flow
);
calcOpticalFlowSingleScaleSF
(
curr_to_extended
,
...
...
@@ -616,8 +616,8 @@ CV_EXPORTS_W void calcOpticalFlowSF(Mat& from,
flow_inv
,
averaging_radius
,
max_flow
,
sigma_dist
,
sigma_color
);
(
float
)
sigma_dist
,
(
float
)
sigma_color
);
extrapolateFlow
(
flow
,
speed_up
);
extrapolateFlow
(
flow_inv
,
speed_up_inv
);
...
...
@@ -628,7 +628,7 @@ CV_EXPORTS_W void calcOpticalFlowSF(Mat& from,
}
crossBilateralFilter
(
flow
,
curr_from
,
confidence
,
flow
,
postprocess_window
,
sigma_color_fix
,
sigma_dist_fix
);
postprocess_window
,
(
float
)
sigma_color_fix
,
(
float
)
sigma_dist_fix
);
GaussianBlur
(
flow
,
flow
,
Size
(
3
,
3
),
5
);
...
...
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