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
6432267d
Commit
6432267d
authored
May 03, 2011
by
Vadim Pisarevsky
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
corrected angular difference check in MSER test (thanks to Pieter-Jan Busschaert for the patch)
parent
dff9c070
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
2 deletions
+12
-2
test_mser.cpp
modules/features2d/test/test_mser.cpp
+12
-2
No files found.
modules/features2d/test/test_mser.cpp
View file @
6432267d
...
...
@@ -107,7 +107,15 @@ int CV_MserTest::CompareBoxes(const vector<CvBox2D>& boxes1,const vector<CvBox2D
float
rel_diff
;
if
(
!
((
boxes1
[
i
].
angle
==
0.0
f
)
&&
(
abs
(
boxes2
[
i
].
angle
)
<
max_rel_diff
)))
{
rel_diff
=
abs
(
boxes1
[
i
].
angle
-
boxes2
[
i
].
angle
)
/
abs
(
boxes1
[
i
].
angle
);
float
angle_diff
=
(
float
)
fmod
(
boxes1
[
i
].
angle
-
boxes2
[
i
].
angle
,
180
);
// for angular correctness, it makes no sense to use a "relative" error.
// a 1-degree error around 5 degrees is equally bas as around 250 degrees.
// in correct cases, angle_diff can now be a bit above 0 or a bit below 180
if
(
angle_diff
>
90.0
f
)
{
angle_diff
-=
180.0
f
;
}
rel_diff
=
(
float
)
fabs
(
angle_diff
);
if
(
rel_diff
>
max_rel_diff
)
return
i
;
}
...
...
@@ -173,6 +181,7 @@ void CV_MserTest::run(int)
}
string
boxes_path
=
string
(
ts
->
get_data_path
())
+
"mser/boxes.txt"
;
string
calc_boxes_path
=
string
(
ts
->
get_data_path
())
+
"mser/boxes.calc.txt"
;
if
(
!
LoadBoxes
(
boxes_path
.
c_str
(),
boxes_orig
))
{
...
...
@@ -190,8 +199,9 @@ void CV_MserTest::run(int)
}
else
{
SaveBoxes
(
calc_boxes_path
.
c_str
(),
boxes
);
ts
->
set_failed_test_info
(
cvtest
::
TS
::
FAIL_BAD_ACCURACY
);
ts
->
printf
(
cvtest
::
TS
::
LOG
,
"Incorrect correspondence in %d box
\n
"
,
n_box
);
ts
->
printf
(
cvtest
::
TS
::
LOG
,
"Incorrect correspondence in box %d
\n
"
,
n_box
);
}
cvReleaseMemStorage
(
&
storage
);
...
...
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