Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
O
opencv_contrib
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_contrib
Commits
b3c36791
Commit
b3c36791
authored
Sep 15, 2016
by
Alexander Alekhin
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #778 from sovrasov:freak_rounding
parents
442b16e3
5d86aa25
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
3 deletions
+16
-3
freak.cpp
modules/xfeatures2d/src/freak.cpp
+16
-3
No files found.
modules/xfeatures2d/src/freak.cpp
View file @
b3c36791
...
...
@@ -538,7 +538,12 @@ void FREAK_Impl::computeDescriptors( InputArray _image, std::vector<KeyPoint>& k
}
keypoints
[
k
].
angle
=
static_cast
<
float
>
(
atan2
((
float
)
direction1
,(
float
)
direction0
)
*
(
180.0
/
CV_PI
));
//estimate orientation
thetaIdx
=
int
(
FREAK_NB_ORIENTATION
*
keypoints
[
k
].
angle
*
(
1
/
360.0
)
+
0.5
);
if
(
keypoints
[
k
].
angle
<
0.
f
)
thetaIdx
=
int
(
FREAK_NB_ORIENTATION
*
keypoints
[
k
].
angle
*
(
1
/
360.0
)
-
0.5
);
else
thetaIdx
=
int
(
FREAK_NB_ORIENTATION
*
keypoints
[
k
].
angle
*
(
1
/
360.0
)
+
0.5
);
if
(
thetaIdx
<
0
)
thetaIdx
+=
FREAK_NB_ORIENTATION
;
...
...
@@ -590,7 +595,11 @@ void FREAK_Impl::computeDescriptors( InputArray _image, std::vector<KeyPoint>& k
}
keypoints
[
k
].
angle
=
static_cast
<
float
>
(
atan2
((
float
)
direction1
,(
float
)
direction0
)
*
(
180.0
/
CV_PI
));
//estimate orientation
thetaIdx
=
int
(
FREAK_NB_ORIENTATION
*
keypoints
[
k
].
angle
*
(
1
/
360.0
)
+
0.5
);
if
(
keypoints
[
k
].
angle
<
0.
f
)
thetaIdx
=
int
(
FREAK_NB_ORIENTATION
*
keypoints
[
k
].
angle
*
(
1
/
360.0
)
-
0.5
);
else
thetaIdx
=
int
(
FREAK_NB_ORIENTATION
*
keypoints
[
k
].
angle
*
(
1
/
360.0
)
+
0.5
);
if
(
thetaIdx
<
0
)
thetaIdx
+=
FREAK_NB_ORIENTATION
;
...
...
@@ -672,7 +681,11 @@ imgType FREAK_Impl::meanIntensity( InputArray _image, InputArray _integral,
ret_val
-=
integral
.
at
<
iiType
>
(
y_bottom
,
x_left
);
ret_val
+=
integral
.
at
<
iiType
>
(
y_top
,
x_left
);
ret_val
-=
integral
.
at
<
iiType
>
(
y_top
,
x_right
);
ret_val
=
ret_val
/
(
(
x_right
-
x_left
)
*
(
y_bottom
-
y_top
)
);
const
int
area
=
(
x_right
-
x_left
)
*
(
y_bottom
-
y_top
);
if
(
ret_val
>
0
)
ret_val
=
(
ret_val
+
area
/
2
)
/
area
;
else
ret_val
=
(
ret_val
-
area
/
2
)
/
area
;
//~ std::cout<<integral.step[1]<<std::endl;
return
static_cast
<
imgType
>
(
ret_val
);
}
...
...
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