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
6d500cc6
Commit
6d500cc6
authored
Apr 23, 2014
by
Ievgen Khvedchenia
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Merge KAZE and AKAZE features with most recent version
parent
d27ed856
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
82 additions
and
168 deletions
+82
-168
AKAZE.cpp
modules/features2d/src/akaze/AKAZE.cpp
+0
-0
AKAZE.h
modules/features2d/src/akaze/AKAZE.h
+67
-136
AKAZEConfig.h
modules/features2d/src/akaze/AKAZEConfig.h
+1
-7
nldiffusion_functions.cpp
modules/features2d/src/akaze/nldiffusion_functions.cpp
+0
-0
nldiffusion_functions.h
modules/features2d/src/akaze/nldiffusion_functions.h
+13
-20
nldiffusion_functions.cpp
modules/features2d/src/kaze/nldiffusion_functions.cpp
+1
-5
nldiffusion_functions.h
modules/features2d/src/kaze/nldiffusion_functions.h
+0
-0
No files found.
modules/features2d/src/akaze/AKAZE.cpp
View file @
6d500cc6
This diff is collapsed.
Click to expand it.
modules/features2d/src/akaze/AKAZE.h
View file @
6d500cc6
...
...
@@ -6,148 +6,84 @@
* @author Pablo F. Alcantarilla, Jesus Nuevo
*/
#ifndef _AKAZE_H_
#define _AKAZE_H_
//*************************************************************************************
//*************************************************************************************
#pragma once
/* ************************************************************************* */
// Includes
#include "config.h"
#include "fed.h"
#include "nldiffusion_functions.h"
//*************************************************************************************
//*************************************************************************************
#include "precomp.hpp"
#include "AKAZEConfig.h"
/* ************************************************************************* */
// AKAZE Class Declaration
class
AKAZEFeatures
{
private
:
// Parameters of the AKAZE class
int
omax_
;
// Maximum octave level
int
noctaves_
;
// Number of octaves
int
nsublevels_
;
// Number of sublevels per octave level
int
img_width_
;
// Width of the original image
int
img_height_
;
// Height of the original image
float
soffset_
;
// Base scale offset
float
factor_size_
;
// Factor for the multiscale derivatives
float
sderivatives_
;
// Standard deviation of the Gaussian for the nonlinear diff. derivatives
float
kcontrast_
;
// The contrast parameter for the scalar nonlinear diffusion
float
dthreshold_
;
// Feature detector threshold response
int
diffusivity_
;
// Diffusivity type, 0->PM G1, 1->PM G2, 2-> Weickert, 3->Charbonnier
int
descriptor_
;
// Descriptor mode:
// 0-> SURF_UPRIGHT, 1->SURF
// 2-> M-SURF_UPRIGHT, 3->M-SURF
// 4-> M-LDB_UPRIGHT, 5->M-LDB
int
descriptor_size_
;
// Size of the descriptor in bits. Use 0 for the full descriptor
int
descriptor_pattern_size_
;
// Size of the pattern. Actual size sampled is 2*pattern_size
int
descriptor_channels_
;
// Number of channels to consider in the M-LDB descriptor
bool
save_scale_space_
;
// For saving scale space images
bool
verbosity_
;
// Verbosity level
std
::
vector
<
tevolution
>
evolution_
;
// Vector of nonlinear diffusion evolution
// FED parameters
int
ncycles_
;
// Number of cycles
bool
reordering_
;
// Flag for reordering time steps
std
::
vector
<
std
::
vector
<
float
>
>
tsteps_
;
// Vector of FED dynamic time steps
std
::
vector
<
int
>
nsteps_
;
// Vector of number of steps per cycle
// Some matrices for the M-LDB descriptor computation
cv
::
Mat
descriptorSamples_
;
// List of positions in the grids to sample LDB bits from.
cv
::
Mat
descriptorBits_
;
cv
::
Mat
bitMask_
;
// Computation times variables in ms
double
tkcontrast_
;
// Kcontrast factor computation
double
tscale_
;
// Nonlinear Scale space generation
double
tderivatives_
;
// Multiscale derivatives
double
tdetector_
;
// Feature detector
double
textrema_
;
// Scale Space extrema
double
tsubpixel_
;
// Subpixel refinement
double
tdescriptor_
;
// Feature descriptors
AKAZEOptions
options_
;
///< Configuration options for AKAZE
std
::
vector
<
TEvolution
>
evolution_
;
///< Vector of nonlinear diffusion evolution
/// FED parameters
int
ncycles_
;
///< Number of cycles
bool
reordering_
;
///< Flag for reordering time steps
std
::
vector
<
std
::
vector
<
float
>
>
tsteps_
;
///< Vector of FED dynamic time steps
std
::
vector
<
int
>
nsteps_
;
///< Vector of number of steps per cycle
/// Matrices for the M-LDB descriptor computation
cv
::
Mat
descriptorSamples_
;
// List of positions in the grids to sample LDB bits from.
cv
::
Mat
descriptorBits_
;
cv
::
Mat
bitMask_
;
/// Computation times variables in ms
AKAZETiming
timing_
;
public
:
// Constructor
AKAZEFeatures
(
const
AKAZEOptions
&
options
);
// Destructor
~
AKAZEFeatures
(
void
);
// Setters
void
Set_Octave_Max
(
const
int
&
omax
)
{
omax_
=
omax
;
}
void
Set_NSublevels
(
const
int
&
nsublevels
)
{
nsublevels_
=
nsublevels
;
}
void
Set_Save_Scale_Space_Flag
(
const
bool
&
save_scale_space
)
{
save_scale_space_
=
save_scale_space
;
}
void
Set_Image_Width
(
const
int
&
img_width
)
{
img_width_
=
img_width
;
}
void
Set_Image_Height
(
const
int
&
img_height
)
{
img_height_
=
img_height
;
}
// Getters
int
Get_Image_Width
(
void
)
{
return
img_width_
;
}
int
Get_Image_Height
(
void
)
{
return
img_height_
;
}
double
Get_Time_KContrast
(
void
)
{
return
tkcontrast_
;
}
double
Get_Time_Scale_Space
(
void
)
{
return
tscale_
;
}
double
Get_Time_Derivatives
(
void
)
{
return
tderivatives_
;
}
double
Get_Time_Detector
(
void
)
{
return
tdetector_
;
}
double
Get_Time_Descriptor
(
void
)
{
return
tdescriptor_
;
}
// Scale Space methods
void
Allocate_Memory_Evolution
(
void
);
int
Create_Nonlinear_Scale_Space
(
const
cv
::
Mat
&
img
);
void
Feature_Detection
(
std
::
vector
<
cv
::
KeyPoint
>&
kpts
);
void
Compute_Determinant_Hessian_Response
(
void
);
void
Compute_Multiscale_Derivatives
(
void
);
void
Find_Scale_Space_Extrema
(
std
::
vector
<
cv
::
KeyPoint
>&
kpts
);
void
Do_Subpixel_Refinement
(
std
::
vector
<
cv
::
KeyPoint
>&
kpts
);
void
Feature_Suppression_Distance
(
std
::
vector
<
cv
::
KeyPoint
>&
kpts
,
float
mdist
);
// Feature description methods
void
Compute_Descriptors
(
std
::
vector
<
cv
::
KeyPoint
>&
kpts
,
cv
::
Mat
&
desc
);
void
Compute_Main_Orientation_SURF
(
cv
::
KeyPoint
&
kpt
);
// SURF Pattern Descriptor
void
Get_SURF_Descriptor_Upright_64
(
const
cv
::
KeyPoint
&
kpt
,
float
*
desc
);
void
Get_SURF_Descriptor_64
(
const
cv
::
KeyPoint
&
kpt
,
float
*
desc
);
// M-SURF Pattern Descriptor
void
Get_MSURF_Upright_Descriptor_64
(
const
cv
::
KeyPoint
&
kpt
,
float
*
desc
);
void
Get_MSURF_Descriptor_64
(
const
cv
::
KeyPoint
&
kpt
,
float
*
desc
);
// M-LDB Pattern Descriptor
void
Get_Upright_MLDB_Full_Descriptor
(
const
cv
::
KeyPoint
&
kpt
,
unsigned
char
*
desc
);
void
Get_MLDB_Full_Descriptor
(
const
cv
::
KeyPoint
&
kpt
,
unsigned
char
*
desc
);
void
Get_Upright_MLDB_Descriptor_Subset
(
const
cv
::
KeyPoint
&
kpt
,
unsigned
char
*
desc
);
void
Get_MLDB_Descriptor_Subset
(
const
cv
::
KeyPoint
&
kpt
,
unsigned
char
*
desc
);
/// Constructor with input arguments
AKAZEFeatures
(
const
AKAZEOptions
&
options
);
/// Destructor
~
AKAZEFeatures
();
/// Scale Space methods
void
Allocate_Memory_Evolution
();
int
Create_Nonlinear_Scale_Space
(
const
cv
::
Mat
&
img
);
void
Feature_Detection
(
std
::
vector
<
cv
::
KeyPoint
>&
kpts
);
void
Compute_Determinant_Hessian_Response
(
void
);
void
Compute_Multiscale_Derivatives
(
void
);
void
Find_Scale_Space_Extrema
(
std
::
vector
<
cv
::
KeyPoint
>&
kpts
);
void
Do_Subpixel_Refinement
(
std
::
vector
<
cv
::
KeyPoint
>&
kpts
);
void
Feature_Suppression_Distance
(
std
::
vector
<
cv
::
KeyPoint
>&
kpts
,
float
mdist
)
const
;
// Feature description methods
void
Compute_Descriptors
(
std
::
vector
<
cv
::
KeyPoint
>&
kpts
,
cv
::
Mat
&
desc
);
void
Compute_Main_Orientation
(
cv
::
KeyPoint
&
kpt
)
const
;
// SURF Pattern Descriptor
void
Get_SURF_Descriptor_Upright_64
(
const
cv
::
KeyPoint
&
kpt
,
float
*
desc
)
const
;
void
Get_SURF_Descriptor_64
(
const
cv
::
KeyPoint
&
kpt
,
float
*
desc
)
const
;
// M-SURF Pattern Descriptor
void
Get_MSURF_Upright_Descriptor_64
(
const
cv
::
KeyPoint
&
kpt
,
float
*
desc
)
const
;
void
Get_MSURF_Descriptor_64
(
const
cv
::
KeyPoint
&
kpt
,
float
*
desc
)
const
;
// M-LDB Pattern Descriptor
void
Get_Upright_MLDB_Full_Descriptor
(
const
cv
::
KeyPoint
&
kpt
,
unsigned
char
*
desc
)
const
;
void
Get_MLDB_Full_Descriptor
(
const
cv
::
KeyPoint
&
kpt
,
unsigned
char
*
desc
)
const
;
void
Get_Upright_MLDB_Descriptor_Subset
(
const
cv
::
KeyPoint
&
kpt
,
unsigned
char
*
desc
);
void
Get_MLDB_Descriptor_Subset
(
const
cv
::
KeyPoint
&
kpt
,
unsigned
char
*
desc
);
// Methods for saving some results and showing computation times
void
Save_Scale_Space
();
void
Save_Detector_Responses
();
void
Show_Computation_Times
()
const
;
/// Return the computation times
AKAZETiming
Get_Computation_Times
()
const
{
return
timing_
;
}
};
//*************************************************************************************
//*************************************************************************************
/* ************************************************************************* */
// Inline functions
/**
* @brief This function sets default parameters for the A-KAZE detector.
...
...
@@ -157,13 +93,8 @@ void setDefaultAKAZEOptions(AKAZEOptions& options);
// Inline functions
void
generateDescriptorSubsample
(
cv
::
Mat
&
sampleList
,
cv
::
Mat
&
comparisons
,
int
nbits
,
int
pattern_size
,
int
nchannels
);
int
nbits
,
int
pattern_size
,
int
nchannels
);
float
get_angle
(
float
x
,
float
y
);
float
gaussian
(
float
x
,
float
y
,
float
sigma
);
void
check_descriptor_limits
(
int
&
x
,
int
&
y
,
const
int
width
,
const
int
height
);
void
check_descriptor_limits
(
int
&
x
,
int
&
y
,
int
width
,
int
height
);
int
fRound
(
float
flt
);
//*************************************************************************************
//*************************************************************************************
#endif
modules/features2d/src/akaze/AKAZEConfig.h
View file @
6d500cc6
...
...
@@ -9,13 +9,7 @@
/* ************************************************************************* */
// OpenCV
#include <opencv2/opencv.hpp>
#include <opencv2/features2d/features2d.hpp>
// OpenMP
#ifdef _OPENMP
# include <omp.h>
#endif
#include "precomp.hpp"
// System Includes
#include <string>
...
...
modules/features2d/src/akaze/nldiffusion_functions.cpp
View file @
6d500cc6
This diff is collapsed.
Click to expand it.
modules/features2d/src/akaze/nldiffusion_functions.h
View file @
6d500cc6
#ifndef _NLDIFFUSION_FUNCTIONS_H_
#define _NLDIFFUSION_FUNCTIONS_H_
/**
* @file nldiffusion_functions.h
* @brief Functions for nonlinear diffusion filtering applications
* @date Sep 15, 2013
* @author Pablo F. Alcantarilla, Jesus Nuevo
*/
//******************************************************************************
//******************************************************************************
#pragma once
/* ************************************************************************* */
// Includes
#include "precomp.hpp"
// OpenMP Includes
#ifdef _OPENMP
# include <omp.h>
#endif
//*************************************************************************************
//*************************************************************************************
/* ************************************************************************* */
// Declaration of functions
void
gaussian_2D_convolution
(
const
cv
::
Mat
&
src
,
cv
::
Mat
&
dst
,
const
size_t
&
ksize_x
,
const
size_t
&
ksize_y
,
const
float
&
sigma
);
...
...
@@ -24,8 +21,8 @@ void pm_g1(const cv::Mat& Lx, const cv::Mat& Ly, cv::Mat& dst, const float& k);
void
pm_g2
(
const
cv
::
Mat
&
Lx
,
const
cv
::
Mat
&
Ly
,
cv
::
Mat
&
dst
,
const
float
&
k
);
void
weickert_diffusivity
(
const
cv
::
Mat
&
Lx
,
const
cv
::
Mat
&
Ly
,
cv
::
Mat
&
dst
,
const
float
&
k
);
void
charbonnier_diffusivity
(
const
cv
::
Mat
&
Lx
,
const
cv
::
Mat
&
Ly
,
cv
::
Mat
&
dst
,
const
float
&
k
);
float
compute_k_percentile
(
const
cv
::
Mat
&
img
,
const
float
&
perc
,
const
float
&
gscale
,
const
size_t
&
nbins
,
const
size_t
&
ksize_x
,
const
size_t
&
ksize_y
);
float
compute_k_percentile
(
const
cv
::
Mat
&
img
,
float
perc
,
float
gscale
,
size_t
nbins
,
size_t
ksize_x
,
size_t
ksize_y
);
void
compute_scharr_derivatives
(
const
cv
::
Mat
&
src
,
cv
::
Mat
&
dst
,
const
size_t
&
xorder
,
const
size_t
&
yorder
,
const
size_t
&
scale
);
void
nld_step_scalar
(
cv
::
Mat
&
Ld
,
const
cv
::
Mat
&
c
,
cv
::
Mat
&
Lstep
,
const
float
&
stepsize
);
...
...
@@ -33,9 +30,5 @@ void downsample_image(const cv::Mat& src, cv::Mat& dst);
void
halfsample_image
(
const
cv
::
Mat
&
src
,
cv
::
Mat
&
dst
);
void
compute_derivative_kernels
(
cv
::
OutputArray
kx_
,
cv
::
OutputArray
ky_
,
const
size_t
&
dx
,
const
size_t
&
dy
,
const
size_t
&
scale
);
//*************************************************************************************
//*************************************************************************************
#endif
bool
check_maximum_neighbourhood
(
const
cv
::
Mat
&
img
,
int
dsize
,
float
value
,
int
row
,
int
col
,
bool
same_img
);
modules/features2d/src/kaze/nldiffusion_functions.cpp
View file @
6d500cc6
...
...
@@ -262,11 +262,7 @@ void compute_derivative_kernels(cv::OutputArray _kx, cv::OutputArray _ky,
for
(
int
k
=
0
;
k
<
2
;
k
++
)
{
Mat
*
kernel
=
k
==
0
?
&
kx
:
&
ky
;
int
order
=
k
==
0
?
dx
:
dy
;
std
::
vector
<
float
>
kerI
(
ksize
);
for
(
int
t
=
0
;
t
<
ksize
;
t
++
)
{
kerI
[
t
]
=
0
;
}
std
::
vector
<
float
>
kerI
(
ksize
,
0.0
f
);
if
(
order
==
0
)
{
kerI
[
0
]
=
norm
,
kerI
[
ksize
/
2
]
=
w
*
norm
,
kerI
[
ksize
-
1
]
=
norm
;
...
...
modules/features2d/src/kaze/nldiffusion_functions.h
100755 → 100644
View file @
6d500cc6
File mode changed from 100755 to 100644
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