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
2e2d9272
Commit
2e2d9272
authored
Nov 14, 2012
by
Andrey Kamaev
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #128 from LeonidBeynenson/fix_args_calcOpticalFlowSF
parents
e3c93ad9
52a13622
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
22 deletions
+25
-22
motion_analysis_and_object_tracking.rst
modules/video/doc/motion_analysis_and_object_tracking.rst
+5
-7
tracking.hpp
modules/video/include/opencv2/video/tracking.hpp
+6
-6
simpleflow.cpp
modules/video/src/simpleflow.cpp
+14
-9
No files found.
modules/video/doc/motion_analysis_and_object_tracking.rst
View file @
2e2d9272
...
...
@@ -601,17 +601,15 @@ calcOpticalFlowSF
-----------------
Calculate an optical flow using "SimpleFlow" algorithm.
.. ocv:function:: void calcOpticalFlowSF(
Mat& from, Mat& to, Mat&
flow, int layers, int averaging_block_size, int max_flow )
.. ocv:function:: void calcOpticalFlowSF(
InputArray from, InputArray to, OutputArray
flow, int layers, int averaging_block_size, int max_flow )
.. ocv:function:: calcOpticalFlowSF(
Mat& from, Mat& to, Mat&
flow, int layers, int averaging_block_size, int max_flow, double sigma_dist, double sigma_color, int postprocess_window, double sigma_dist_fix, double sigma_color_fix, double occ_thr, int upscale_averaging_radius, double upscale_sigma_dist, double upscale_sigma_color, double speed_up_thr )
.. ocv:function:: calcOpticalFlowSF(
InputArray from, InputArray to, OutputArray
flow, int layers, int averaging_block_size, int max_flow, double sigma_dist, double sigma_color, int postprocess_window, double sigma_dist_fix, double sigma_color_fix, double occ_thr, int upscale_averaging_radius, double upscale_sigma_dist, double upscale_sigma_color, double speed_up_thr )
:param prev: First 8-bit 3-channel image.
:param next: Second 8-bit 3-channel image
:param next: Second 8-bit 3-channel image
of the same size as ``prev``
:param flowX: X-coordinate of estimated flow
:param flowY: Y-coordinate of estimated flow
:param flow: computed flow image that has the same size as ``prev`` and type ``CV_32FC2``
:param layers: Number of layers
...
...
@@ -631,7 +629,7 @@ Calculate an optical flow using "SimpleFlow" algorithm.
:param occ_thr: threshold for detecting occlusions
:param upscale_averaging_radiu
d
: window size for bilateral upscale operation
:param upscale_averaging_radiu
s
: window size for bilateral upscale operation
:param upscale_sigma_dist: spatial sigma for bilateral upscale operation
...
...
modules/video/include/opencv2/video/tracking.hpp
View file @
2e2d9272
...
...
@@ -328,16 +328,16 @@ CV_EXPORTS_W Mat estimateRigidTransform( InputArray src, InputArray dst,
bool
fullAffine
);
//! computes dense optical flow using Simple Flow algorithm
CV_EXPORTS_W
void
calcOpticalFlowSF
(
Mat
&
from
,
Mat
&
to
,
Mat
&
flow
,
CV_EXPORTS_W
void
calcOpticalFlowSF
(
InputArray
from
,
InputArray
to
,
OutputArray
flow
,
int
layers
,
int
averaging_block_size
,
int
max_flow
);
CV_EXPORTS_W
void
calcOpticalFlowSF
(
Mat
&
from
,
Mat
&
to
,
Mat
&
flow
,
CV_EXPORTS_W
void
calcOpticalFlowSF
(
InputArray
from
,
InputArray
to
,
OutputArray
flow
,
int
layers
,
int
averaging_block_size
,
int
max_flow
,
...
...
modules/video/src/simpleflow.cpp
View file @
2e2d9272
...
...
@@ -447,7 +447,7 @@ static void extrapolateFlow(Mat& flow,
}
}
static
void
buildPyramidWithResizeMethod
(
Mat
&
src
,
static
void
buildPyramidWithResizeMethod
(
const
Mat
&
src
,
vector
<
Mat
>&
pyramid
,
int
layers
,
int
interpolation_type
)
{
...
...
@@ -464,9 +464,9 @@ static void buildPyramidWithResizeMethod(Mat& src,
}
}
CV_EXPORTS_W
void
calcOpticalFlowSF
(
Mat
&
from
,
Mat
&
to
,
Mat
&
resulted_flow
,
CV_EXPORTS_W
void
calcOpticalFlowSF
(
InputArray
_
from
,
InputArray
_
to
,
OutputArray
_
resulted_flow
,
int
layers
,
int
averaging_radius
,
int
max_flow
,
...
...
@@ -479,7 +479,11 @@ CV_EXPORTS_W void calcOpticalFlowSF(Mat& from,
int
upscale_averaging_radius
,
double
upscale_sigma_dist
,
double
upscale_sigma_color
,
double
speed_up_thr
)
{
double
speed_up_thr
)
{
Mat
from
=
_from
.
getMat
();
Mat
to
=
_to
.
getMat
();
vector
<
Mat
>
pyr_from_images
;
vector
<
Mat
>
pyr_to_images
;
...
...
@@ -632,14 +636,15 @@ CV_EXPORTS_W void calcOpticalFlowSF(Mat& from,
GaussianBlur
(
flow
,
flow
,
Size
(
3
,
3
),
5
);
resulted_flow
=
Mat
(
flow
.
size
(),
CV_32FC2
);
_resulted_flow
.
create
(
flow
.
size
(),
CV_32FC2
);
Mat
resulted_flow
=
_resulted_flow
.
getMat
();
int
from_to
[]
=
{
0
,
1
,
1
,
0
};
mixChannels
(
&
flow
,
1
,
&
resulted_flow
,
1
,
from_to
,
2
);
}
CV_EXPORTS_W
void
calcOpticalFlowSF
(
Mat
&
from
,
Mat
&
to
,
Mat
&
flow
,
CV_EXPORTS_W
void
calcOpticalFlowSF
(
InputArray
from
,
InputArray
to
,
OutputArray
flow
,
int
layers
,
int
averaging_block_size
,
int
max_flow
)
{
...
...
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