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
a7356eb5
Commit
a7356eb5
authored
Jun 02, 2015
by
cbalint13
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
BugFix & Enhance DAISY.
parent
7e0e8e72
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
18 deletions
+18
-18
daisy.cpp
modules/xfeatures2d/src/daisy.cpp
+18
-18
No files found.
modules/xfeatures2d/src/daisy.cpp
View file @
a7356eb5
...
...
@@ -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
;
...
...
@@ -74,13 +73,6 @@ static const int MAX_NORMALIZATION_ITER = 5;
int
g_selected_cubes
[
MAX_CUBE_NO
];
// m_rad_q_no < MAX_CUBE_NO
void
DAISY
::
compute
(
InputArrayOfArrays
images
,
std
::
vector
<
std
::
vector
<
KeyPoint
>
>&
keypoints
,
OutputArrayOfArrays
descriptors
)
{
DescriptorExtractor
::
compute
(
images
,
keypoints
,
descriptors
);
}
/*
!DAISY implementation
*/
...
...
@@ -415,7 +407,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 +478,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 +509,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 +539,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