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
21409de1
Commit
21409de1
authored
Jul 11, 2011
by
Vadim Pisarevsky
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
optimized sparse LK optical flow (tickets #1062 and #1210)
parent
442f6b41
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
14 deletions
+20
-14
utils.cpp
modules/imgproc/src/utils.cpp
+9
-3
lkpyramid.cpp
modules/video/src/lkpyramid.cpp
+0
-0
test_optflowpyrlk.cpp
modules/video/test/test_optflowpyrlk.cpp
+11
-11
No files found.
modules/imgproc/src/utils.cpp
View file @
21409de1
...
...
@@ -212,11 +212,17 @@ void cv::copyMakeBorder( InputArray _src, OutputArray _dst, int top, int bottom,
top
,
left
,
(
int
)
src
.
elemSize
(),
borderType
);
else
{
double
buf
[
4
];
scalarToRawData
(
value
,
buf
,
src
.
type
());
int
cn
=
src
.
channels
(),
cn1
=
cn
;
AutoBuffer
<
double
>
buf
(
cn
);
if
(
cn
>
4
)
{
CV_Assert
(
value
[
0
]
==
value
[
1
]
&&
value
[
0
]
==
value
[
2
]
&&
value
[
0
]
==
value
[
3
]
);
cn1
=
1
;
}
scalarToRawData
(
value
,
buf
,
CV_MAKETYPE
(
src
.
depth
(),
cn1
),
cn
);
copyMakeConstBorder_8u
(
src
.
data
,
src
.
step
,
src
.
size
(),
dst
.
data
,
dst
.
step
,
dst
.
size
(),
top
,
left
,
(
int
)
src
.
elemSize
(),
(
uchar
*
)
buf
);
top
,
left
,
(
int
)
src
.
elemSize
(),
(
uchar
*
)
(
double
*
)
buf
);
}
}
...
...
modules/video/src/lkpyramid.cpp
View file @
21409de1
This diff is collapsed.
Click to expand it.
modules/video/test/test_optflowpyrlk.cpp
View file @
21409de1
...
...
@@ -58,8 +58,8 @@ void CV_OptFlowPyrLKTest::run( int )
{
int
code
=
cvtest
::
TS
::
OK
;
const
double
success_error_level
=
0.
2
;
const
int
bad_points_max
=
2
;
const
double
success_error_level
=
0.
3
;
const
int
bad_points_max
=
8
;
/* test parameters */
double
max_err
=
0.
,
sum_err
=
0
;
...
...
@@ -139,7 +139,7 @@ void CV_OptFlowPyrLKTest::run( int )
status
=
(
char
*
)
cvAlloc
(
n
*
sizeof
(
status
[
0
]));
/* calculate flow */
cvCalcOpticalFlowPyrLK
(
imgI
,
imgJ
,
0
,
0
,
u
,
v2
,
n
,
cvSize
(
20
,
20
),
cvCalcOpticalFlowPyrLK
(
imgI
,
imgJ
,
0
,
0
,
u
,
v2
,
n
,
cvSize
(
41
,
41
),
4
,
status
,
0
,
cvTermCriteria
(
CV_TERMCRIT_ITER
|
CV_TERMCRIT_EPS
,
30
,
0.01
f
),
0
);
...
...
@@ -163,14 +163,6 @@ void CV_OptFlowPyrLKTest::run( int )
}
pt_exceed
+=
err
>
success_error_level
;
if
(
pt_exceed
>
bad_points_max
)
{
ts
->
printf
(
cvtest
::
TS
::
LOG
,
"The number of poorly tracked points is too big (>=%d)
\n
"
,
pt_exceed
);
code
=
cvtest
::
TS
::
FAIL_BAD_ACCURACY
;
goto
_exit_
;
}
sum_err
+=
err
;
pt_cmpd
++
;
}
...
...
@@ -186,6 +178,14 @@ void CV_OptFlowPyrLKTest::run( int )
}
}
}
if
(
pt_exceed
>
bad_points_max
)
{
ts
->
printf
(
cvtest
::
TS
::
LOG
,
"The number of poorly tracked points is too big (>=%d)
\n
"
,
pt_exceed
);
code
=
cvtest
::
TS
::
FAIL_BAD_ACCURACY
;
goto
_exit_
;
}
if
(
max_err
>
1
)
{
...
...
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