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
a08b709e
Commit
a08b709e
authored
Jun 02, 2015
by
Vadim Pisarevsky
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #243 from cbalint13/daisy
BugFix & Enhance DAISY.
parents
7e0e8e72
d3895582
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
11 deletions
+18
-11
daisy.cpp
modules/xfeatures2d/src/daisy.cpp
+18
-11
No files found.
modules/xfeatures2d/src/daisy.cpp
View file @
a08b709e
...
...
@@ -61,7 +61,6 @@ namespace xfeatures2d
// constants
const
double
g_sigma_0
=
1
;
const
double
g_sigma_1
=
sqrt
(
2.0
);
//const double g_sigma_2 = 8;
const
double
g_sigma_step
=
std
::
pow
(
2
,
1.0
/
2
);
const
int
g_scale_st
=
int
(
(
log
(
g_sigma_1
/
g_sigma_0
))
/
log
(
g_sigma_step
)
);
static
int
g_scale_en
=
1
;
...
...
@@ -415,7 +414,7 @@ struct LayeredGradientInvoker : ParallelLoopBody
{
for
(
int
l
=
range
.
start
;
l
<
range
.
end
;
++
l
)
{
double
angle
=
l
*
2
*
CV_PI
/
layer_no
;
double
angle
=
l
*
2
*
(
float
)
CV_PI
/
layer_no
;
Mat
layer
(
dx
.
rows
,
dx
.
cols
,
CV_32F
,
layers
->
ptr
<
float
>
(
l
,
0
,
0
)
);
addWeighted
(
dx
,
cos
(
angle
),
dy
,
sin
(
angle
),
0.0
f
,
layer
,
CV_32F
);
max
(
layer
,
0.0
f
,
layer
);
...
...
@@ -486,15 +485,18 @@ static int quantize_radius( float rad, const int _rad_q_no, const Mat& _cube_sig
static
void
normalize_partial
(
float
*
desc
,
const
int
_grid_point_number
,
const
int
_hist_th_q_no
)
{
float
norm
=
0.0
f
;
for
(
int
h
=
0
;
h
<
_grid_point_number
;
h
++
)
{
// l2 norm
double
sum
=
0.0
f
;
for
(
int
i
=
0
;
i
<
_hist_th_q_no
;
i
++
)
{
norm
+=
sqrt
(
desc
[
h
*
_hist_th_q_no
+
i
]
*
desc
[
h
*
_hist_th_q_no
+
i
])
;
sum
+=
desc
[
h
*
_hist_th_q_no
+
i
]
*
desc
[
h
*
_hist_th_q_no
+
i
]
;
}
float
norm
=
(
float
)
sqrt
(
sum
);
if
(
norm
!=
0.0
)
// divide with norm
for
(
int
i
=
0
;
i
<
_hist_th_q_no
;
i
++
)
...
...
@@ -514,13 +516,15 @@ static void normalize_sift_way( float* desc, const int _descriptor_size )
iter
++
;
changed
=
false
;
float
nor
m
=
0.0
f
;
double
su
m
=
0.0
f
;
for
(
int
i
=
0
;
i
<
_descriptor_size
;
i
++
)
{
norm
+=
sqrt
(
desc
[
_descriptor_size
+
i
]
*
desc
[
_descriptor_size
+
i
])
;
sum
+=
desc
[
_descriptor_size
+
i
]
*
desc
[
_descriptor_size
+
i
]
;
}
float
norm
=
(
float
)
sqrt
(
sum
);
if
(
norm
>
1e-5
)
// divide with norm
for
(
int
i
=
0
;
i
<
_descriptor_size
;
i
++
)
...
...
@@ -542,12 +546,15 @@ static void normalize_sift_way( float* desc, const int _descriptor_size )
static
void
normalize_full
(
float
*
desc
,
const
int
_descriptor_size
)
{
// l2 norm
float
nor
m
=
0.0
f
;
double
su
m
=
0.0
f
;
for
(
int
i
=
0
;
i
<
_descriptor_size
;
i
++
)
{
norm
+=
sqrt
(
desc
[
_descriptor_size
+
i
]
*
desc
[
_descriptor_size
+
i
])
;
sum
+=
desc
[
_descriptor_size
+
i
]
*
desc
[
_descriptor_size
+
i
]
;
}
float
norm
=
(
float
)
sqrt
(
sum
);
if
(
norm
!=
0.0
)
// divide with norm
for
(
int
i
=
0
;
i
<
_descriptor_size
;
i
++
)
...
...
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