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
d27ed856
Commit
d27ed856
authored
Apr 23, 2014
by
Ievgen Khvedchenia
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replace config with AKAZEConfig.h
parent
5848e751
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
190 additions
and
156 deletions
+190
-156
AKAZEConfig.h
modules/features2d/src/akaze/AKAZEConfig.h
+190
-0
config.h
modules/features2d/src/akaze/config.h
+0
-156
No files found.
modules/features2d/src/akaze/AKAZEConfig.h
0 → 100644
View file @
d27ed856
/**
* @file AKAZEConfig.h
* @brief AKAZE configuration file
* @date Feb 23, 2014
* @author Pablo F. Alcantarilla, Jesus Nuevo
*/
#pragma once
/* ************************************************************************* */
// OpenCV
#include <opencv2/opencv.hpp>
#include <opencv2/features2d/features2d.hpp>
// OpenMP
#ifdef _OPENMP
# include <omp.h>
#endif
// System Includes
#include <string>
#include <vector>
#include <cmath>
#include <bitset>
#include <iomanip>
/* ************************************************************************* */
/// Lookup table for 2d gaussian (sigma = 2.5) where (0,0) is top left and (6,6) is bottom right
const
float
gauss25
[
7
][
7
]
=
{
{
0
.
025464
81
f
,
0
.
023506
98
f
,
0
.
01
849125
f
,
0
.
0123
9505
f
,
0
.
0070
8017
f
,
0
.
0034462
9
f
,
0
.
00142
946
f
},
{
0
.
023506
98
f
,
0
.
0216
9968
f
,
0
.
01706
957
f
,
0
.
0114420
8
f
,
0
.
006535
82
f
,
0
.
0031
8132
f
,
0
.
00131
956
f
},
{
0
.
01
849125
f
,
0
.
01706
957
f
,
0
.
01342740
f
,
0
.
00
900066
f
,
0
.
00514126
f
,
0
.
00250252
f
,
0
.
00103
800
f
},
{
0
.
0123
9505
f
,
0
.
0114420
8
f
,
0
.
00
900066
f
,
0
.
00603332
f
,
0
.
0034462
9
f
,
0
.
0016774
9
f
,
0
.
0006
9579
f
},
{
0
.
0070
8017
f
,
0
.
006535
82
f
,
0
.
00514126
f
,
0
.
0034462
9
f
,
0
.
001
96855
f
,
0
.
000
95820
f
,
0
.
0003
9744
f
},
{
0
.
0034462
9
f
,
0
.
0031
8132
f
,
0
.
00250252
f
,
0
.
0016774
9
f
,
0
.
000
95820
f
,
0
.
00046640
f
,
0
.
0001
9346
f
},
{
0
.
00142
946
f
,
0
.
00131
956
f
,
0
.
00103
800
f
,
0
.
0006
9579
f
,
0
.
0003
9744
f
,
0
.
0001
9346
f
,
0
.
0000
8024
f
}
};
/* ************************************************************************* */
/// AKAZE Descriptor Type
enum
DESCRIPTOR_TYPE
{
SURF_UPRIGHT
=
0
,
///< Upright descriptors, not invariant to rotation
SURF
=
1
,
MSURF_UPRIGHT
=
2
,
///< Upright descriptors, not invariant to rotation
MSURF
=
3
,
MLDB_UPRIGHT
=
4
,
///< Upright descriptors, not invariant to rotation
MLDB
=
5
};
/* ************************************************************************* */
/// AKAZE Diffusivities
enum
DIFFUSIVITY_TYPE
{
PM_G1
=
0
,
PM_G2
=
1
,
WEICKERT
=
2
,
CHARBONNIER
=
3
};
/* ************************************************************************* */
/// AKAZE Timing structure
struct
AKAZETiming
{
AKAZETiming
()
{
kcontrast
=
0
.
0
;
scale
=
0
.
0
;
derivatives
=
0
.
0
;
detector
=
0
.
0
;
extrema
=
0
.
0
;
subpixel
=
0
.
0
;
descriptor
=
0
.
0
;
}
double
kcontrast
;
///< Contrast factor computation time in ms
double
scale
;
///< Nonlinear scale space computation time in ms
double
derivatives
;
///< Multiscale derivatives computation time in ms
double
detector
;
///< Feature detector computation time in ms
double
extrema
;
///< Scale space extrema computation time in ms
double
subpixel
;
///< Subpixel refinement computation time in ms
double
descriptor
;
///< Descriptors computation time in ms
};
/* ************************************************************************* */
/// AKAZE configuration options structure
struct
AKAZEOptions
{
AKAZEOptions
()
{
soffset
=
1
.
6
f
;
derivative_factor
=
1
.
5
f
;
omax
=
4
;
nsublevels
=
4
;
dthreshold
=
0
.
001
f
;
min_dthreshold
=
0
.
00001
f
;
diffusivity
=
PM_G2
;
descriptor
=
MLDB
;
descriptor_size
=
0
;
descriptor_channels
=
3
;
descriptor_pattern_size
=
10
;
sderivatives
=
1
.
0
;
kcontrast
=
0
.
001
f
;
kcontrast_percentile
=
0
.
7
f
;
kcontrast_nbins
=
300
;
save_scale_space
=
false
;
save_keypoints
=
false
;
verbosity
=
false
;
}
int
omin
;
///< Initial octave level (-1 means that the size of the input image is duplicated)
int
omax
;
///< Maximum octave evolution of the image 2^sigma (coarsest scale sigma units)
int
nsublevels
;
///< Default number of sublevels per scale level
int
img_width
;
///< Width of the input image
int
img_height
;
///< Height of the input image
float
soffset
;
///< Base scale offset (sigma units)
float
derivative_factor
;
///< Factor for the multiscale derivatives
float
sderivatives
;
///< Smoothing factor for the derivatives
DIFFUSIVITY_TYPE
diffusivity
;
///< Diffusivity type
float
dthreshold
;
///< Detector response threshold to accept point
float
min_dthreshold
;
///< Minimum detector threshold to accept a point
DESCRIPTOR_TYPE
descriptor
;
///< Type of descriptor
int
descriptor_size
;
///< Size of the descriptor in bits. 0->Full size
int
descriptor_channels
;
///< Number of channels in the descriptor (1, 2, 3)
int
descriptor_pattern_size
;
///< Actual patch size is 2*pattern_size*point.scale
float
kcontrast
;
///< The contrast factor parameter
float
kcontrast_percentile
;
///< Percentile level for the contrast factor
size_t
kcontrast_nbins
;
///< Number of bins for the contrast factor histogram
bool
save_scale_space
;
///< Set to true for saving the scale space images
bool
save_keypoints
;
///< Set to true for saving the detected keypoints and descriptors
bool
verbosity
;
///< Set to true for displaying verbosity information
friend
std
::
ostream
&
operator
<<
(
std
::
ostream
&
os
,
const
AKAZEOptions
&
akaze_options
)
{
os
<<
std
::
left
;
#define CHECK_AKAZE_OPTION(option) \
os << std::setw(33) << #option << " = " << option << std::endl
// Scale-space parameters.
CHECK_AKAZE_OPTION
(
akaze_options
.
omax
);
CHECK_AKAZE_OPTION
(
akaze_options
.
nsublevels
);
CHECK_AKAZE_OPTION
(
akaze_options
.
soffset
);
CHECK_AKAZE_OPTION
(
akaze_options
.
sderivatives
);
CHECK_AKAZE_OPTION
(
akaze_options
.
diffusivity
);
// Detection parameters.
CHECK_AKAZE_OPTION
(
akaze_options
.
dthreshold
);
// Descriptor parameters.
CHECK_AKAZE_OPTION
(
akaze_options
.
descriptor
);
CHECK_AKAZE_OPTION
(
akaze_options
.
descriptor_channels
);
CHECK_AKAZE_OPTION
(
akaze_options
.
descriptor_size
);
// Save scale-space
CHECK_AKAZE_OPTION
(
akaze_options
.
save_scale_space
);
// Verbose option for debug.
CHECK_AKAZE_OPTION
(
akaze_options
.
verbosity
);
#undef CHECK_AKAZE_OPTIONS
return
os
;
}
};
/* ************************************************************************* */
/// AKAZE nonlinear diffusion filtering evolution
struct
TEvolution
{
TEvolution
()
{
etime
=
0
.
0
f
;
esigma
=
0
.
0
f
;
octave
=
0
;
sublevel
=
0
;
sigma_size
=
0
;
}
cv
::
Mat
Lx
,
Ly
;
// First order spatial derivatives
cv
::
Mat
Lxx
,
Lxy
,
Lyy
;
// Second order spatial derivatives
cv
::
Mat
Lflow
;
// Diffusivity image
cv
::
Mat
Lt
;
// Evolution image
cv
::
Mat
Lsmooth
;
// Smoothed image
cv
::
Mat
Lstep
;
// Evolution step update
cv
::
Mat
Ldet
;
// Detector response
float
etime
;
// Evolution time
float
esigma
;
// Evolution sigma. For linear diffusion t = sigma^2 / 2
size_t
octave
;
// Image octave
size_t
sublevel
;
// Image sublevel in each octave
size_t
sigma_size
;
// Integer sigma. For computing the feature detector responses
};
\ No newline at end of file
modules/features2d/src/akaze/config.h
deleted
100644 → 0
View file @
5848e751
#ifndef __OPENCV_FEATURES_2D_AKAZE_CONFIG_HPP__
#define __OPENCV_FEATURES_2D_AKAZE_CONFIG_HPP__
// STL
#include <string>
#include <vector>
#include <cmath>
#include <bitset>
#include <iomanip>
// OpenCV
#include "precomp.hpp"
// OpenMP
#ifdef _OPENMP
# include <omp.h>
#endif
// Lookup table for 2d gaussian (sigma = 2.5) where (0,0) is top left and (6,6) is bottom right
static
const
float
gauss25
[
7
][
7
]
=
{
{
0
.
025464
81
f
,
0
.
023506
98
f
,
0
.
01
849125
f
,
0
.
0123
9505
f
,
0
.
0070
8017
f
,
0
.
0034462
9
f
,
0
.
00142
946
f
},
{
0
.
023506
98
f
,
0
.
0216
9968
f
,
0
.
01706
957
f
,
0
.
0114420
8
f
,
0
.
006535
82
f
,
0
.
0031
8132
f
,
0
.
00131
956
f
},
{
0
.
01
849125
f
,
0
.
01706
957
f
,
0
.
01342740
f
,
0
.
00
900066
f
,
0
.
00514126
f
,
0
.
00250252
f
,
0
.
00103
800
f
},
{
0
.
0123
9505
f
,
0
.
0114420
8
f
,
0
.
00
900066
f
,
0
.
00603332
f
,
0
.
0034462
9
f
,
0
.
0016774
9
f
,
0
.
0006
9579
f
},
{
0
.
0070
8017
f
,
0
.
006535
82
f
,
0
.
00514126
f
,
0
.
0034462
9
f
,
0
.
001
96855
f
,
0
.
000
95820
f
,
0
.
0003
9744
f
},
{
0
.
0034462
9
f
,
0
.
0031
8132
f
,
0
.
00250252
f
,
0
.
0016774
9
f
,
0
.
000
95820
f
,
0
.
00046640
f
,
0
.
0001
9346
f
},
{
0
.
00142
946
f
,
0
.
00131
956
f
,
0
.
00103
800
f
,
0
.
0006
9579
f
,
0
.
0003
9744
f
,
0
.
0001
9346
f
,
0
.
0000
8024
f
}
};
// Scale Space parameters
static
const
float
DEFAULT_SCALE_OFFSET
=
1
.
60
f
;
// Base scale offset (sigma units)
static
const
float
DEFAULT_FACTOR_SIZE
=
1
.
5
f
;
// Factor for the multiscale derivatives
static
const
int
DEFAULT_OCTAVE_MIN
=
0
;
// Initial octave level (-1 means that the size of the input image is duplicated)
static
const
int
DEFAULT_OCTAVE_MAX
=
4
;
// Maximum octave evolution of the image 2^sigma (coarsest scale sigma units)
static
const
int
DEFAULT_NSUBLEVELS
=
4
;
// Default number of sublevels per scale level
static
const
int
DEFAULT_DIFFUSIVITY_TYPE
=
1
;
static
const
float
KCONTRAST_PERCENTILE
=
0
.
7
f
;
static
const
int
KCONTRAST_NBINS
=
300
;
static
const
float
DEFAULT_SIGMA_SMOOTHING_DERIVATIVES
=
1
.
0
f
;
static
const
float
DEFAULT_KCONTRAST
=
.
01
f
;
// Detector Parameters
static
const
float
DEFAULT_DETECTOR_THRESHOLD
=
0
.
001
f
;
// Detector response threshold to accept point
static
const
float
DEFAULT_MIN_DETECTOR_THRESHOLD
=
0
.
00001
f
;
// Minimum Detector response threshold to accept point
static
const
int
DEFAULT_LDB_DESCRIPTOR_SIZE
=
0
;
// Use 0 for the full descriptor, or the number of bits
static
const
int
DEFAULT_LDB_PATTERN_SIZE
=
10
;
// Actual patch size is 2*pattern_size*point.scale;
static
const
int
DEFAULT_LDB_CHANNELS
=
3
;
// Descriptor Parameters
enum
DESCRIPTOR_TYPE
{
SURF_UPRIGHT
=
0
,
// Upright descriptors, not invariant to rotation
SURF
=
1
,
MSURF_UPRIGHT
=
2
,
// Upright descriptors, not invariant to rotation
MSURF
=
3
,
MLDB_UPRIGHT
=
4
,
// Upright descriptors, not invariant to rotation
MLDB
=
5
};
static
const
int
DEFAULT_DESCRIPTOR
=
MLDB
;
// Some debugging options
static
const
bool
DEFAULT_SAVE_SCALE_SPACE
=
false
;
// For saving the scale space images
static
const
bool
DEFAULT_VERBOSITY
=
false
;
// Verbosity level (0->no verbosity)
static
const
bool
DEFAULT_SHOW_RESULTS
=
true
;
// For showing the output image with the detected features plus some ratios
static
const
bool
DEFAULT_SAVE_KEYPOINTS
=
false
;
// For saving the list of keypoints
// Options structure
struct
AKAZEOptions
{
int
omin
;
int
omax
;
int
nsublevels
;
int
img_width
;
int
img_height
;
int
diffusivity
;
float
soffset
;
float
sderivatives
;
float
dthreshold
;
float
dthreshold2
;
int
descriptor
;
int
descriptor_size
;
int
descriptor_channels
;
int
descriptor_pattern_size
;
bool
save_scale_space
;
bool
save_keypoints
;
bool
verbosity
;
AKAZEOptions
()
{
// Load the default options
soffset
=
DEFAULT_SCALE_OFFSET
;
omax
=
DEFAULT_OCTAVE_MAX
;
nsublevels
=
DEFAULT_NSUBLEVELS
;
dthreshold
=
DEFAULT_DETECTOR_THRESHOLD
;
diffusivity
=
DEFAULT_DIFFUSIVITY_TYPE
;
descriptor
=
DEFAULT_DESCRIPTOR
;
descriptor_size
=
DEFAULT_LDB_DESCRIPTOR_SIZE
;
descriptor_channels
=
DEFAULT_LDB_CHANNELS
;
descriptor_pattern_size
=
DEFAULT_LDB_PATTERN_SIZE
;
sderivatives
=
DEFAULT_SIGMA_SMOOTHING_DERIVATIVES
;
save_scale_space
=
DEFAULT_SAVE_SCALE_SPACE
;
save_keypoints
=
DEFAULT_SAVE_KEYPOINTS
;
verbosity
=
DEFAULT_VERBOSITY
;
}
friend
std
::
ostream
&
operator
<<
(
std
::
ostream
&
os
,
const
AKAZEOptions
&
akaze_options
)
{
os
<<
std
::
left
;
#define CHECK_AKAZE_OPTION(option) \
os << std::setw(33) << #option << " = " << option << std::endl
// Scale-space parameters.
CHECK_AKAZE_OPTION
(
akaze_options
.
omax
);
CHECK_AKAZE_OPTION
(
akaze_options
.
nsublevels
);
CHECK_AKAZE_OPTION
(
akaze_options
.
soffset
);
CHECK_AKAZE_OPTION
(
akaze_options
.
sderivatives
);
CHECK_AKAZE_OPTION
(
akaze_options
.
diffusivity
);
// Detection parameters.
CHECK_AKAZE_OPTION
(
akaze_options
.
dthreshold
);
// Descriptor parameters.
CHECK_AKAZE_OPTION
(
akaze_options
.
descriptor
);
CHECK_AKAZE_OPTION
(
akaze_options
.
descriptor_channels
);
CHECK_AKAZE_OPTION
(
akaze_options
.
descriptor_size
);
// Save scale-space
CHECK_AKAZE_OPTION
(
akaze_options
.
save_scale_space
);
// Verbose option for debug.
CHECK_AKAZE_OPTION
(
akaze_options
.
verbosity
);
#undef CHECK_AKAZE_OPTIONS
return
os
;
}
};
struct
tevolution
{
cv
::
Mat
Lx
,
Ly
;
// First order spatial derivatives
cv
::
Mat
Lxx
,
Lxy
,
Lyy
;
// Second order spatial derivatives
cv
::
Mat
Lflow
;
// Diffusivity image
cv
::
Mat
Lt
;
// Evolution image
cv
::
Mat
Lsmooth
;
// Smoothed image
cv
::
Mat
Lstep
;
// Evolution step update
cv
::
Mat
Ldet
;
// Detector response
float
etime
;
// Evolution time
float
esigma
;
// Evolution sigma. For linear diffusion t = sigma^2 / 2
int
octave
;
// Image octave
int
sublevel
;
// Image sublevel in each octave
int
sigma_size
;
// Integer sigma. For computing the feature detector responses
};
#endif
\ No newline at end of file
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