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
1a9eee39
Commit
1a9eee39
authored
May 18, 2015
by
cbalint13
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixx win64 compilation.
parent
dec629a6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
35 deletions
+35
-35
daisy.cpp
modules/xfeatures2d/src/daisy.cpp
+35
-35
No files found.
modules/xfeatures2d/src/daisy.cpp
View file @
1a9eee39
...
...
@@ -497,8 +497,8 @@ static Mat layered_gradient( Mat data, int layer_no = 8 )
Mat
cvO
;
// smooth the data matrix
filter2D
(
data
,
cvO
,
CV_32F
,
Kernel
,
Point
(
-
1
.0
f
,
-
1.0
f
),
0
,
BORDER_REPLICATE
);
filter2D
(
cvO
,
cvO
,
CV_32F
,
Kernel
.
t
(),
Point
(
-
1
.0
f
,
-
1.0
f
),
0
,
BORDER_REPLICATE
);
filter2D
(
data
,
cvO
,
CV_32F
,
Kernel
,
Point
(
-
1
,
-
1
),
0
,
BORDER_REPLICATE
);
filter2D
(
cvO
,
cvO
,
CV_32F
,
Kernel
.
t
(),
Point
(
-
1
,
-
1
),
0
,
BORDER_REPLICATE
);
Mat
dx
(
1
,
data_size
,
CV_32F
);
Mat
dy
(
1
,
data_size
,
CV_32F
);
...
...
@@ -540,8 +540,8 @@ static void layered_gradient( Mat data, int layer_no, Mat layers )
gaussian_1d
(
kernel
,
5
,
0.5
f
,
0.0
f
);
Mat
Kernel
(
1
,
5
,
CV_32F
,
(
float
*
)
kernel
);
filter2D
(
cvI
,
cvI
,
CV_32F
,
Kernel
,
Point
(
-
1
.0
f
,
-
1.0
f
),
0
,
BORDER_REPLICATE
);
filter2D
(
cvI
,
cvI
,
CV_32F
,
Kernel
.
t
(),
Point
(
-
1
.0
f
,
-
1.0
f
),
0
,
BORDER_REPLICATE
);
filter2D
(
cvI
,
cvI
,
CV_32F
,
Kernel
,
Point
(
-
1
,
-
1
),
0
,
BORDER_REPLICATE
);
filter2D
(
cvI
,
cvI
,
CV_32F
,
Kernel
.
t
(),
Point
(
-
1
,
-
1
),
0
,
BORDER_REPLICATE
);
Mat
dx
(
1
,
data_size
,
CV_32F
);
Mat
dy
(
1
,
data_size
,
CV_32F
);
...
...
@@ -654,8 +654,8 @@ inline void DAISY_Impl::smooth_layers( Mat layers, int h, int w, int layer_numbe
float
*
layer
=
NULL
;
int
kernel_size
=
filter_size
(
sigma
);
float
kernel
[
kernel_size
]
;
gaussian_1d
(
kernel
,
kernel_size
,
sigma
,
0
);
std
::
vector
<
float
>
kernel
(
kernel_size
)
;
gaussian_1d
(
&
kernel
[
0
]
,
kernel_size
,
sigma
,
0
);
float
*
ptr
=
layers
.
ptr
<
float
>
(
0
);
...
...
@@ -669,9 +669,9 @@ inline void DAISY_Impl::smooth_layers( Mat layers, int h, int w, int layer_numbe
Mat
cvI
(
h
,
w
,
CV_32FC1
,
(
float
*
)
layer
);
Mat
Kernel
(
1
,
kernel_size
,
CV_32FC1
,
(
float
*
)
kernel
);
filter2D
(
cvI
,
cvI
,
CV_32F
,
Kernel
,
Point
(
-
1
.0
f
,
-
1.0
f
),
0
,
BORDER_REPLICATE
);
filter2D
(
cvI
,
cvI
,
CV_32F
,
Kernel
.
t
(),
Point
(
-
1
.0
f
,
-
1.0
f
),
0
,
BORDER_REPLICATE
);
Mat
Kernel
(
1
,
kernel_size
,
CV_32FC1
,
&
kernel
[
0
]
);
filter2D
(
cvI
,
cvI
,
CV_32F
,
Kernel
,
Point
(
-
1
,
-
1
),
0
,
BORDER_REPLICATE
);
filter2D
(
cvI
,
cvI
,
CV_32F
,
Kernel
.
t
(),
Point
(
-
1
,
-
1
),
0
,
BORDER_REPLICATE
);
}
}
...
...
@@ -900,8 +900,8 @@ inline void DAISY_Impl::compute_smoothed_gradient_layers()
-
m_cube_sigmas
.
at
<
double
>
(
r
-
1
)
*
m_cube_sigmas
.
at
<
double
>
(
r
-
1
)
);
int
kernel_size
=
filter_size
(
sigma
);
float
kernel
[
kernel_size
]
;
gaussian_1d
(
kernel
,
kernel_size
,
(
float
)
sigma
,
0
);
std
::
vector
<
float
>
kernel
(
kernel_size
)
;
gaussian_1d
(
&
kernel
[
0
]
,
kernel_size
,
(
float
)
sigma
,
0
);
#if defined _OPENMP
#pragma omp parallel for
...
...
@@ -911,9 +911,9 @@ inline void DAISY_Impl::compute_smoothed_gradient_layers()
Mat
cvI
(
m_image
.
rows
,
m_image
.
cols
,
CV_32FC1
,
(
float
*
)
prev_cube
+
th
*
m_layer_size
);
Mat
cvO
(
m_image
.
rows
,
m_image
.
cols
,
CV_32FC1
,
(
float
*
)
cube
+
th
*
m_layer_size
);
Mat
Kernel
(
1
,
kernel_size
,
CV_32FC1
,
(
float
*
)
kernel
);
filter2D
(
cvI
,
cvO
,
CV_32F
,
Kernel
,
Point
(
-
1
.0
f
,
-
1.0
f
),
0
,
BORDER_REPLICATE
);
filter2D
(
cvO
,
cvO
,
CV_32F
,
Kernel
.
t
(),
Point
(
-
1
.0
f
,
-
1.0
f
),
0
,
BORDER_REPLICATE
);
Mat
Kernel
(
1
,
kernel_size
,
CV_32FC1
,
&
kernel
[
0
]
);
filter2D
(
cvI
,
cvO
,
CV_32F
,
Kernel
,
Point
(
-
1
,
-
1
),
0
,
BORDER_REPLICATE
);
filter2D
(
cvO
,
cvO
,
CV_32F
,
Kernel
.
t
(),
Point
(
-
1
,
-
1
),
0
,
BORDER_REPLICATE
);
}
prev_cube
=
cube
;
}
...
...
@@ -1001,15 +1001,15 @@ inline void DAISY_Impl::compute_scales()
if
(
kernel_size
%
2
==
0
)
kernel_size
++
;
// kernel size must be odd
if
(
kernel_size
<
3
)
kernel_size
=
3
;
// kernel size cannot be smaller than 3
float
kernel
[
kernel_size
]
;
gaussian_1d
(
kernel
,
kernel_size
,
sigma
,
0
);
Mat
Kernel
(
1
,
kernel_size
,
CV_32F
,
(
float
*
)
kernel
);
std
::
vector
<
float
>
kernel
(
kernel_size
)
;
gaussian_1d
(
&
kernel
[
0
]
,
kernel_size
,
sigma
,
0
);
Mat
Kernel
(
1
,
kernel_size
,
CV_32F
,
&
kernel
[
0
]
);
Mat
sim
,
next_sim
;
// output gaussian image
filter2D
(
m_image
,
sim
,
CV_32F
,
Kernel
,
Point
(
-
1
.0
f
,
-
1.0
f
),
0
,
BORDER_REPLICATE
);
filter2D
(
sim
,
sim
,
CV_32F
,
Kernel
.
t
(),
Point
(
-
1
.0
f
,
-
1.0
f
),
0
,
BORDER_REPLICATE
);
filter2D
(
m_image
,
sim
,
CV_32F
,
Kernel
,
Point
(
-
1
,
-
1
),
0
,
BORDER_REPLICATE
);
filter2D
(
sim
,
sim
,
CV_32F
,
Kernel
.
t
(),
Point
(
-
1
,
-
1
),
0
,
BORDER_REPLICATE
);
Mat
max_dog
(
m_image
.
rows
,
m_image
.
cols
,
CV_32F
,
Scalar
(
0
)
);
m_scale_map
=
Mat
(
m_image
.
rows
,
m_image
.
cols
,
CV_32F
,
Scalar
(
0
)
);
...
...
@@ -1032,13 +1032,13 @@ inline void DAISY_Impl::compute_scales()
if
(
kernel_size
%
2
==
0
)
kernel_size
++
;
// kernel size must be odd
if
(
kernel_size
<
3
)
kernel_size
=
3
;
// kernel size cannot be smaller than 3
float
next_kernel
[
kernel_size
]
;
gaussian_1d
(
next_kernel
,
kernel_size
,
sigma_inc
,
0
);
Mat
NextKernel
(
1
,
kernel_size
,
CV_32F
,
(
float
*
)
next_kernel
);
kernel
.
resize
(
kernel_size
)
;
gaussian_1d
(
&
kernel
[
0
]
,
kernel_size
,
sigma_inc
,
0
);
Mat
NextKernel
(
1
,
kernel_size
,
CV_32F
,
&
kernel
[
0
]
);
// output gaussian image
filter2D
(
sim
,
next_sim
,
CV_32F
,
NextKernel
,
Point
(
-
1
.0
f
,
-
1.0
f
),
0
,
BORDER_REPLICATE
);
filter2D
(
next_sim
,
next_sim
,
CV_32F
,
NextKernel
.
t
(),
Point
(
-
1
.0
f
,
-
1.0
f
),
0
,
BORDER_REPLICATE
);
filter2D
(
sim
,
next_sim
,
CV_32F
,
NextKernel
,
Point
(
-
1
,
-
1
),
0
,
BORDER_REPLICATE
);
filter2D
(
next_sim
,
next_sim
,
CV_32F
,
NextKernel
.
t
(),
Point
(
-
1
,
-
1
),
0
,
BORDER_REPLICATE
);
#if defined _OPENMP
...
...
@@ -1066,13 +1066,13 @@ inline void DAISY_Impl::compute_scales()
if
(
kernel_size
<
3
)
kernel_size
=
3
;
// kernel size cannot be smaller than 3
float
filter_kernel
[
kernel_size
]
;
gaussian_1d
(
filter_kernel
,
kernel_size
,
10.0
f
,
0
);
Mat
FilterKernel
(
1
,
kernel_size
,
CV_32F
,
(
float
*
)
filter_kernel
);
kernel
.
resize
(
kernel_size
)
;
gaussian_1d
(
&
kernel
[
0
]
,
kernel_size
,
10.0
f
,
0
);
Mat
FilterKernel
(
1
,
kernel_size
,
CV_32F
,
&
kernel
[
0
]
);
// output gaussian image
filter2D
(
m_scale_map
,
m_scale_map
,
CV_32F
,
FilterKernel
,
Point
(
-
1
.0
f
,
-
1.0
f
),
0
,
BORDER_REPLICATE
);
filter2D
(
m_scale_map
,
m_scale_map
,
CV_32F
,
FilterKernel
.
t
(),
Point
(
-
1
.0
f
,
-
1.0
f
),
0
,
BORDER_REPLICATE
);
filter2D
(
m_scale_map
,
m_scale_map
,
CV_32F
,
FilterKernel
,
Point
(
-
1
,
-
1
),
0
,
BORDER_REPLICATE
);
filter2D
(
m_scale_map
,
m_scale_map
,
CV_32F
,
FilterKernel
.
t
(),
Point
(
-
1
,
-
1
),
0
,
BORDER_REPLICATE
);
#if defined _OPENMP
#pragma omp parallel for
...
...
@@ -1174,7 +1174,7 @@ inline void DAISY_Impl::compute_orientations()
{
angle
=
0
;
}
m_orientation_map
.
at
<
float
>
(
y
,
x
)
=
iangle
;
m_orientation_map
.
at
<
float
>
(
y
,
x
)
=
(
float
)
iangle
;
}
hist
.
release
();
}
...
...
@@ -1333,7 +1333,7 @@ inline void DAISY_Impl::i_get_descriptor( double y, double x, int orientation, f
yy
=
y
+
grid
.
at
<
double
>
(
2
*
region
);
xx
=
x
+
grid
.
at
<
double
>
(
2
*
region
+
1
);
if
(
!
Point
(
xx
,
yy
).
inside
(
if
(
!
Point
2f
(
(
float
)
xx
,
(
float
)
yy
).
inside
(
Rect
(
0
,
0
,
m_image
.
cols
-
1
,
m_image
.
rows
-
1
)
)
)
continue
;
...
...
@@ -1384,7 +1384,7 @@ inline void DAISY_Impl::ni_get_descriptor( double y, double x, int orientation,
iy
=
(
int
)
yy
;
if
(
yy
-
iy
>
0.5
)
iy
++
;
ix
=
(
int
)
xx
;
if
(
xx
-
ix
>
0.5
)
ix
++
;
if
(
!
Point
(
xx
,
yy
).
inside
(
if
(
!
Point
2f
(
(
float
)
xx
,
(
float
)
yy
).
inside
(
Rect
(
0
,
0
,
m_image
.
cols
-
1
,
m_image
.
rows
-
1
)
)
)
continue
;
...
...
@@ -1425,7 +1425,7 @@ inline bool DAISY_Impl::i_get_descriptor( double y, double x, int orientation, d
double
hy
,
hx
,
ry
,
rx
;
point_transform_via_homography
(
H
,
x
,
y
,
hx
,
hy
);
if
(
!
Point
(
hx
,
hy
).
inside
(
if
(
!
Point
2f
(
(
float
)
hx
,
(
float
)
hy
).
inside
(
Rect
(
0
,
0
,
m_image
.
cols
-
1
,
m_image
.
rows
-
1
)
)
)
return
false
;
...
...
@@ -1460,7 +1460,7 @@ inline bool DAISY_Impl::i_get_descriptor( double y, double x, int orientation, d
hradius
[
r
]
=
quantize_radius
(
(
float
)
radius
);
}
if
(
!
Point
(
hx
,
hy
).
inside
(
if
(
!
Point
2f
(
(
float
)
hx
,
(
float
)
hy
).
inside
(
Rect
(
0
,
0
,
m_image
.
cols
-
1
,
m_image
.
rows
-
1
)
)
)
continue
;
...
...
@@ -1489,7 +1489,7 @@ inline bool DAISY_Impl::ni_get_descriptor( double y, double x, int orientation,
point_transform_via_homography
(
H
,
x
,
y
,
hx
,
hy
);
if
(
!
Point
(
hx
,
hy
).
inside
(
if
(
!
Point
2f
(
(
float
)
hx
,
(
float
)
hy
).
inside
(
Rect
(
0
,
0
,
m_image
.
cols
-
1
,
m_image
.
rows
-
1
)
)
)
return
false
;
...
...
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