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
5dfb8103
Commit
5dfb8103
authored
Oct 17, 2016
by
Alexander Alekhin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
video: fix optflow test: NAN results shouldn't bypass checks
parent
8213e57f
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
2 deletions
+15
-2
test_optflowpyrlk.cpp
modules/video/test/test_optflowpyrlk.cpp
+15
-2
No files found.
modules/video/test/test_optflowpyrlk.cpp
View file @
5dfb8103
...
...
@@ -66,7 +66,7 @@ void CV_OptFlowPyrLKTest::run( int )
double
max_err
=
0.
,
sum_err
=
0
;
int
pt_cmpd
=
0
;
int
pt_exceed
=
0
;
int
merr_i
=
0
,
merr_j
=
0
,
merr_k
=
0
;
int
merr_i
=
0
,
merr_j
=
0
,
merr_k
=
0
,
merr_nan
=
0
;
char
filename
[
1000
];
CvPoint2D32f
*
u
=
0
,
*
v
=
0
,
*
v2
=
0
;
...
...
@@ -153,12 +153,18 @@ void CV_OptFlowPyrLKTest::run( int )
if
(
status
[
i
]
!=
0
)
{
double
err
;
if
(
cvIsNaN
(
v
[
i
].
x
)
)
if
(
cvIsNaN
(
v
[
i
].
x
)
||
cvIsNaN
(
v
[
i
].
y
)
)
{
merr_j
++
;
continue
;
}
if
(
cvIsNaN
(
v2
[
i
].
x
)
||
cvIsNaN
(
v2
[
i
].
y
)
)
{
merr_nan
++
;
continue
;
}
err
=
fabs
(
v2
[
i
].
x
-
v
[
i
].
x
)
+
fabs
(
v2
[
i
].
y
-
v
[
i
].
y
);
if
(
err
>
max_err
)
{
...
...
@@ -198,6 +204,13 @@ void CV_OptFlowPyrLKTest::run( int )
goto
_exit_
;
}
if
(
merr_nan
>
0
)
{
ts
->
printf
(
cvtest
::
TS
::
LOG
,
"NAN tracking result with status != 0 (%d times)
\n
"
,
merr_nan
);
code
=
cvtest
::
TS
::
FAIL_BAD_ACCURACY
;
goto
_exit_
;
}
_exit_
:
cvFree
(
&
status
);
...
...
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