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
599bcfb5
Commit
599bcfb5
authored
Apr 28, 2014
by
Ievgen Khvedchenia
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix size_t to int conversion
parent
cc0a94c5
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
50 additions
and
50 deletions
+50
-50
AKAZE.cpp
modules/features2d/src/akaze/AKAZE.cpp
+22
-22
KAZE.cpp
modules/features2d/src/kaze/KAZE.cpp
+20
-20
config.h
modules/features2d/src/kaze/config.h
+8
-8
No files found.
modules/features2d/src/akaze/AKAZE.cpp
View file @
599bcfb5
...
@@ -234,7 +234,7 @@ void AKAZEFeatures::Compute_Multiscale_Derivatives(void) {
...
@@ -234,7 +234,7 @@ void AKAZEFeatures::Compute_Multiscale_Derivatives(void) {
//t1 = cv::getTickCount();
//t1 = cv::getTickCount();
cv
::
parallel_for_
(
cv
::
Range
(
0
,
evolution_
.
size
()),
MultiscaleDerivativesInvoker
(
evolution_
,
options_
));
cv
::
parallel_for_
(
cv
::
Range
(
0
,
(
int
)
evolution_
.
size
()),
MultiscaleDerivativesInvoker
(
evolution_
,
options_
));
/*
/*
for (int i = 0; i < (int)(evolution_.size()); i++) {
for (int i = 0; i < (int)(evolution_.size()); i++) {
...
@@ -334,8 +334,8 @@ void AKAZEFeatures::Find_Scale_Space_Extrema(std::vector<cv::KeyPoint>& kpts) {
...
@@ -334,8 +334,8 @@ void AKAZEFeatures::Find_Scale_Space_Extrema(std::vector<cv::KeyPoint>& kpts) {
is_extremum
=
true
;
is_extremum
=
true
;
point
.
response
=
fabs
(
value
);
point
.
response
=
fabs
(
value
);
point
.
size
=
evolution_
[
i
].
esigma
*
options_
.
derivative_factor
;
point
.
size
=
evolution_
[
i
].
esigma
*
options_
.
derivative_factor
;
point
.
octave
=
evolution_
[
i
].
octave
;
point
.
octave
=
(
int
)
evolution_
[
i
].
octave
;
point
.
class_id
=
i
;
point
.
class_id
=
(
int
)
i
;
ratio
=
pow
(
2.
f
,
point
.
octave
);
ratio
=
pow
(
2.
f
,
point
.
octave
);
sigma_size_
=
fRound
(
point
.
size
/
ratio
);
sigma_size_
=
fRound
(
point
.
size
/
ratio
);
point
.
pt
.
x
=
static_cast
<
float
>
(
jx
);
point
.
pt
.
x
=
static_cast
<
float
>
(
jx
);
...
@@ -349,7 +349,7 @@ void AKAZEFeatures::Find_Scale_Space_Extrema(std::vector<cv::KeyPoint>& kpts) {
...
@@ -349,7 +349,7 @@ void AKAZEFeatures::Find_Scale_Space_Extrema(std::vector<cv::KeyPoint>& kpts) {
dist
=
sqrt
(
pow
(
point
.
pt
.
x
*
ratio
-
kpts_aux
[
ik
].
pt
.
x
,
2
)
+
pow
(
point
.
pt
.
y
*
ratio
-
kpts_aux
[
ik
].
pt
.
y
,
2
));
dist
=
sqrt
(
pow
(
point
.
pt
.
x
*
ratio
-
kpts_aux
[
ik
].
pt
.
x
,
2
)
+
pow
(
point
.
pt
.
y
*
ratio
-
kpts_aux
[
ik
].
pt
.
y
,
2
));
if
(
dist
<=
point
.
size
)
{
if
(
dist
<=
point
.
size
)
{
if
(
point
.
response
>
kpts_aux
[
ik
].
response
)
{
if
(
point
.
response
>
kpts_aux
[
ik
].
response
)
{
id_repeated
=
ik
;
id_repeated
=
(
int
)
ik
;
is_repeated
=
true
;
is_repeated
=
true
;
}
}
else
{
else
{
...
@@ -501,7 +501,7 @@ void AKAZEFeatures::Do_Subpixel_Refinement(std::vector<cv::KeyPoint>& kpts) {
...
@@ -501,7 +501,7 @@ void AKAZEFeatures::Do_Subpixel_Refinement(std::vector<cv::KeyPoint>& kpts) {
void
AKAZEFeatures
::
Feature_Suppression_Distance
(
std
::
vector
<
cv
::
KeyPoint
>&
kpts
,
float
mdist
)
const
{
void
AKAZEFeatures
::
Feature_Suppression_Distance
(
std
::
vector
<
cv
::
KeyPoint
>&
kpts
,
float
mdist
)
const
{
vector
<
cv
::
KeyPoint
>
aux
;
vector
<
cv
::
KeyPoint
>
aux
;
vector
<
in
t
>
to_delete
;
vector
<
size_
t
>
to_delete
;
float
dist
=
0.0
,
x1
=
0.0
,
y1
=
0.0
,
x2
=
0.0
,
y2
=
0.0
;
float
dist
=
0.0
,
x1
=
0.0
,
y1
=
0.0
,
x2
=
0.0
,
y2
=
0.0
;
bool
found
=
false
;
bool
found
=
false
;
...
@@ -527,7 +527,7 @@ void AKAZEFeatures::Feature_Suppression_Distance(std::vector<cv::KeyPoint>& kpts
...
@@ -527,7 +527,7 @@ void AKAZEFeatures::Feature_Suppression_Distance(std::vector<cv::KeyPoint>& kpts
for
(
size_t
i
=
0
;
i
<
kpts
.
size
();
i
++
)
{
for
(
size_t
i
=
0
;
i
<
kpts
.
size
();
i
++
)
{
found
=
false
;
found
=
false
;
for
(
size_t
j
=
0
;
j
<
to_delete
.
size
();
j
++
)
{
for
(
size_t
j
=
0
;
j
<
to_delete
.
size
();
j
++
)
{
if
(
i
==
(
size_t
)(
to_delete
[
j
])
)
{
if
(
i
==
to_delete
[
j
]
)
{
found
=
true
;
found
=
true
;
break
;
break
;
}
}
...
@@ -805,17 +805,17 @@ void AKAZEFeatures::Compute_Descriptors(std::vector<cv::KeyPoint>& kpts, cv::Mat
...
@@ -805,17 +805,17 @@ void AKAZEFeatures::Compute_Descriptors(std::vector<cv::KeyPoint>& kpts, cv::Mat
// Allocate memory for the matrix with the descriptors
// Allocate memory for the matrix with the descriptors
if
(
options_
.
descriptor
<
MLDB_UPRIGHT
)
{
if
(
options_
.
descriptor
<
MLDB_UPRIGHT
)
{
desc
=
cv
::
Mat
::
zeros
(
kpts
.
size
(),
64
,
CV_32FC1
);
desc
=
cv
::
Mat
::
zeros
(
(
int
)
kpts
.
size
(),
64
,
CV_32FC1
);
}
}
else
{
else
{
// We use the full length binary descriptor -> 486 bits
// We use the full length binary descriptor -> 486 bits
if
(
options_
.
descriptor_size
==
0
)
{
if
(
options_
.
descriptor_size
==
0
)
{
int
t
=
(
6
+
36
+
120
)
*
options_
.
descriptor_channels
;
int
t
=
(
6
+
36
+
120
)
*
options_
.
descriptor_channels
;
desc
=
cv
::
Mat
::
zeros
(
kpts
.
size
(),
(
int
)
ceil
(
t
/
8.
),
CV_8UC1
);
desc
=
cv
::
Mat
::
zeros
(
(
int
)
kpts
.
size
(),
(
int
)
ceil
(
t
/
8.
),
CV_8UC1
);
}
}
else
{
else
{
// We use the random bit selection length binary descriptor
// We use the random bit selection length binary descriptor
desc
=
cv
::
Mat
::
zeros
(
kpts
.
size
(),
(
int
)
ceil
(
options_
.
descriptor_size
/
8.
),
CV_8UC1
);
desc
=
cv
::
Mat
::
zeros
(
(
int
)
kpts
.
size
(),
(
int
)
ceil
(
options_
.
descriptor_size
/
8.
),
CV_8UC1
);
}
}
}
}
...
@@ -823,7 +823,7 @@ void AKAZEFeatures::Compute_Descriptors(std::vector<cv::KeyPoint>& kpts, cv::Mat
...
@@ -823,7 +823,7 @@ void AKAZEFeatures::Compute_Descriptors(std::vector<cv::KeyPoint>& kpts, cv::Mat
case
SURF_UPRIGHT
:
// Upright descriptors, not invariant to rotation
case
SURF_UPRIGHT
:
// Upright descriptors, not invariant to rotation
{
{
cv
::
parallel_for_
(
cv
::
Range
(
0
,
kpts
.
size
()),
SURF_Descriptor_Upright_64_Invoker
(
kpts
,
desc
,
evolution_
,
options_
));
cv
::
parallel_for_
(
cv
::
Range
(
0
,
(
int
)
kpts
.
size
()),
SURF_Descriptor_Upright_64_Invoker
(
kpts
,
desc
,
evolution_
,
options_
));
//for (int i = 0; i < (int)(kpts.size()); i++) {
//for (int i = 0; i < (int)(kpts.size()); i++) {
// Get_SURF_Descriptor_Upright_64(kpts[i], desc.ptr<float>(i));
// Get_SURF_Descriptor_Upright_64(kpts[i], desc.ptr<float>(i));
...
@@ -832,7 +832,7 @@ void AKAZEFeatures::Compute_Descriptors(std::vector<cv::KeyPoint>& kpts, cv::Mat
...
@@ -832,7 +832,7 @@ void AKAZEFeatures::Compute_Descriptors(std::vector<cv::KeyPoint>& kpts, cv::Mat
break
;
break
;
case
SURF
:
case
SURF
:
{
{
cv
::
parallel_for_
(
cv
::
Range
(
0
,
kpts
.
size
()),
SURF_Descriptor_64_Invoker
(
kpts
,
desc
,
evolution_
,
options_
));
cv
::
parallel_for_
(
cv
::
Range
(
0
,
(
int
)
kpts
.
size
()),
SURF_Descriptor_64_Invoker
(
kpts
,
desc
,
evolution_
,
options_
));
//for (int i = 0; i < (int)(kpts.size()); i++) {
//for (int i = 0; i < (int)(kpts.size()); i++) {
// Compute_Main_Orientation(kpts[i]);
// Compute_Main_Orientation(kpts[i]);
...
@@ -842,7 +842,7 @@ void AKAZEFeatures::Compute_Descriptors(std::vector<cv::KeyPoint>& kpts, cv::Mat
...
@@ -842,7 +842,7 @@ void AKAZEFeatures::Compute_Descriptors(std::vector<cv::KeyPoint>& kpts, cv::Mat
break
;
break
;
case
MSURF_UPRIGHT
:
// Upright descriptors, not invariant to rotation
case
MSURF_UPRIGHT
:
// Upright descriptors, not invariant to rotation
{
{
cv
::
parallel_for_
(
cv
::
Range
(
0
,
kpts
.
size
()),
MSURF_Upright_Descriptor_64_Invoker
(
kpts
,
desc
,
evolution_
,
options_
));
cv
::
parallel_for_
(
cv
::
Range
(
0
,
(
int
)
kpts
.
size
()),
MSURF_Upright_Descriptor_64_Invoker
(
kpts
,
desc
,
evolution_
,
options_
));
//for (int i = 0; i < (int)(kpts.size()); i++) {
//for (int i = 0; i < (int)(kpts.size()); i++) {
// Get_MSURF_Upright_Descriptor_64(kpts[i], desc.ptr<float>(i));
// Get_MSURF_Upright_Descriptor_64(kpts[i], desc.ptr<float>(i));
...
@@ -851,7 +851,7 @@ void AKAZEFeatures::Compute_Descriptors(std::vector<cv::KeyPoint>& kpts, cv::Mat
...
@@ -851,7 +851,7 @@ void AKAZEFeatures::Compute_Descriptors(std::vector<cv::KeyPoint>& kpts, cv::Mat
break
;
break
;
case
MSURF
:
case
MSURF
:
{
{
cv
::
parallel_for_
(
cv
::
Range
(
0
,
kpts
.
size
()),
MSURF_Descriptor_64_Invoker
(
kpts
,
desc
,
evolution_
,
options_
));
cv
::
parallel_for_
(
cv
::
Range
(
0
,
(
int
)
kpts
.
size
()),
MSURF_Descriptor_64_Invoker
(
kpts
,
desc
,
evolution_
,
options_
));
//for (int i = 0; i < (int)(kpts.size()); i++) {
//for (int i = 0; i < (int)(kpts.size()); i++) {
// Compute_Main_Orientation(kpts[i]);
// Compute_Main_Orientation(kpts[i]);
...
@@ -862,9 +862,9 @@ void AKAZEFeatures::Compute_Descriptors(std::vector<cv::KeyPoint>& kpts, cv::Mat
...
@@ -862,9 +862,9 @@ void AKAZEFeatures::Compute_Descriptors(std::vector<cv::KeyPoint>& kpts, cv::Mat
case
MLDB_UPRIGHT
:
// Upright descriptors, not invariant to rotation
case
MLDB_UPRIGHT
:
// Upright descriptors, not invariant to rotation
{
{
if
(
options_
.
descriptor_size
==
0
)
if
(
options_
.
descriptor_size
==
0
)
cv
::
parallel_for_
(
cv
::
Range
(
0
,
kpts
.
size
()),
Upright_MLDB_Full_Descriptor_Invoker
(
kpts
,
desc
,
evolution_
,
options_
));
cv
::
parallel_for_
(
cv
::
Range
(
0
,
(
int
)
kpts
.
size
()),
Upright_MLDB_Full_Descriptor_Invoker
(
kpts
,
desc
,
evolution_
,
options_
));
else
else
cv
::
parallel_for_
(
cv
::
Range
(
0
,
kpts
.
size
()),
Upright_MLDB_Descriptor_Subset_Invoker
(
kpts
,
desc
,
evolution_
,
options_
,
descriptorSamples_
,
descriptorBits_
));
cv
::
parallel_for_
(
cv
::
Range
(
0
,
(
int
)
kpts
.
size
()),
Upright_MLDB_Descriptor_Subset_Invoker
(
kpts
,
desc
,
evolution_
,
options_
,
descriptorSamples_
,
descriptorBits_
));
//for (int i = 0; i < (int)(kpts.size()); i++) {
//for (int i = 0; i < (int)(kpts.size()); i++) {
// if (options_.descriptor_size == 0)
// if (options_.descriptor_size == 0)
...
@@ -877,9 +877,9 @@ void AKAZEFeatures::Compute_Descriptors(std::vector<cv::KeyPoint>& kpts, cv::Mat
...
@@ -877,9 +877,9 @@ void AKAZEFeatures::Compute_Descriptors(std::vector<cv::KeyPoint>& kpts, cv::Mat
case
MLDB
:
case
MLDB
:
{
{
if
(
options_
.
descriptor_size
==
0
)
if
(
options_
.
descriptor_size
==
0
)
cv
::
parallel_for_
(
cv
::
Range
(
0
,
kpts
.
size
()),
MLDB_Full_Descriptor_Invoker
(
kpts
,
desc
,
evolution_
,
options_
));
cv
::
parallel_for_
(
cv
::
Range
(
0
,
(
int
)
kpts
.
size
()),
MLDB_Full_Descriptor_Invoker
(
kpts
,
desc
,
evolution_
,
options_
));
else
else
cv
::
parallel_for_
(
cv
::
Range
(
0
,
kpts
.
size
()),
MLDB_Descriptor_Subset_Invoker
(
kpts
,
desc
,
evolution_
,
options_
,
descriptorSamples_
,
descriptorBits_
));
cv
::
parallel_for_
(
cv
::
Range
(
0
,
(
int
)
kpts
.
size
()),
MLDB_Descriptor_Subset_Invoker
(
kpts
,
desc
,
evolution_
,
options_
,
descriptorSamples_
,
descriptorBits_
));
//for (int i = 0; i < (int)(kpts.size()); i++) {
//for (int i = 0; i < (int)(kpts.size()); i++) {
// Compute_Main_Orientation(kpts[i]);
// Compute_Main_Orientation(kpts[i]);
...
@@ -2145,7 +2145,7 @@ void generateDescriptorSubsample(cv::Mat& sampleList, cv::Mat& comparisons, int
...
@@ -2145,7 +2145,7 @@ void generateDescriptorSubsample(cv::Mat& sampleList, cv::Mat& comparisons, int
}
}
ssz
*=
nchannels
;
ssz
*=
nchannels
;
CV_Assert
(
nbits
<=
ssz
&&
"descriptor size can't be bigger than full descriptor"
);
CV_Assert
(
(
nbits
<=
ssz
)
&&
"descriptor size can't be bigger than full descriptor"
);
// Since the full descriptor is usually under 10k elements, we pick
// Since the full descriptor is usually under 10k elements, we pick
// the selection from the full matrix. We take as many samples per
// the selection from the full matrix. We take as many samples per
...
@@ -2153,7 +2153,7 @@ void generateDescriptorSubsample(cv::Mat& sampleList, cv::Mat& comparisons, int
...
@@ -2153,7 +2153,7 @@ void generateDescriptorSubsample(cv::Mat& sampleList, cv::Mat& comparisons, int
// take the two samples involved and put them in the sampling list
// take the two samples involved and put them in the sampling list
Mat_
<
int
>
fullM
(
ssz
/
nchannels
,
5
);
Mat_
<
int
>
fullM
(
ssz
/
nchannels
,
5
);
for
(
size_
t
i
=
0
,
c
=
0
;
i
<
3
;
i
++
)
{
for
(
in
t
i
=
0
,
c
=
0
;
i
<
3
;
i
++
)
{
int
gdiv
=
i
+
2
;
//grid divisions, per row
int
gdiv
=
i
+
2
;
//grid divisions, per row
int
gsz
=
gdiv
*
gdiv
;
int
gsz
=
gdiv
*
gdiv
;
int
psz
=
(
int
)
ceil
(
2.
f
*
pattern_size
/
(
float
)
gdiv
);
int
psz
=
(
int
)
ceil
(
2.
f
*
pattern_size
/
(
float
)
gdiv
);
...
@@ -2175,13 +2175,13 @@ void generateDescriptorSubsample(cv::Mat& sampleList, cv::Mat& comparisons, int
...
@@ -2175,13 +2175,13 @@ void generateDescriptorSubsample(cv::Mat& sampleList, cv::Mat& comparisons, int
// Select some samples. A sample includes all channels
// Select some samples. A sample includes all channels
int
count
=
0
;
int
count
=
0
;
size_t
npicks
=
(
size_
t
)
ceil
(
nbits
/
(
float
)
nchannels
);
int
npicks
=
(
in
t
)
ceil
(
nbits
/
(
float
)
nchannels
);
Mat_
<
int
>
samples
(
29
,
3
);
Mat_
<
int
>
samples
(
29
,
3
);
Mat_
<
int
>
fullcopy
=
fullM
.
clone
();
Mat_
<
int
>
fullcopy
=
fullM
.
clone
();
samples
=
-
1
;
samples
=
-
1
;
for
(
size_
t
i
=
0
;
i
<
npicks
;
i
++
)
{
for
(
in
t
i
=
0
;
i
<
npicks
;
i
++
)
{
size_
t
k
=
rand
()
%
(
fullM
.
rows
-
i
);
in
t
k
=
rand
()
%
(
fullM
.
rows
-
i
);
if
(
i
<
6
)
{
if
(
i
<
6
)
{
// Force use of the coarser grid values and comparisons
// Force use of the coarser grid values and comparisons
k
=
i
;
k
=
i
;
...
...
modules/features2d/src/kaze/KAZE.cpp
View file @
599bcfb5
...
@@ -381,20 +381,20 @@ void KAZEFeatures::Determinant_Hessian_Parallel(std::vector<cv::KeyPoint>& kpts)
...
@@ -381,20 +381,20 @@ void KAZEFeatures::Determinant_Hessian_Parallel(std::vector<cv::KeyPoint>& kpts)
#ifdef _OPENMP
#ifdef _OPENMP
#pragma omp parallel for
#pragma omp parallel for
#endif
#endif
for
(
size_
t
i
=
1
;
i
<
evolution_
.
size
()
-
1
;
i
++
)
{
for
(
in
t
i
=
1
;
i
<
evolution_
.
size
()
-
1
;
i
++
)
{
Find_Extremum_Threading
(
i
);
Find_Extremum_Threading
(
i
);
}
}
// Now fill the vector of keypoints!!!
// Now fill the vector of keypoints!!!
for
(
size_
t
i
=
0
;
i
<
kpts_par_
.
size
();
i
++
)
{
for
(
in
t
i
=
0
;
i
<
kpts_par_
.
size
();
i
++
)
{
for
(
size_
t
j
=
0
;
j
<
kpts_par_
[
i
].
size
();
j
++
)
{
for
(
in
t
j
=
0
;
j
<
kpts_par_
[
i
].
size
();
j
++
)
{
level
=
i
+
1
;
level
=
i
+
1
;
is_extremum
=
true
;
is_extremum
=
true
;
is_repeated
=
false
;
is_repeated
=
false
;
is_out
=
false
;
is_out
=
false
;
// Check in case we have the same point as maxima in previous evolution levels
// Check in case we have the same point as maxima in previous evolution levels
for
(
size_
t
ik
=
0
;
ik
<
kpts
.
size
();
ik
++
)
{
for
(
in
t
ik
=
0
;
ik
<
kpts
.
size
();
ik
++
)
{
if
(
kpts
[
ik
].
class_id
==
level
||
kpts
[
ik
].
class_id
==
level
+
1
||
kpts
[
ik
].
class_id
==
level
-
1
)
{
if
(
kpts
[
ik
].
class_id
==
level
||
kpts
[
ik
].
class_id
==
level
+
1
||
kpts
[
ik
].
class_id
==
level
-
1
)
{
dist
=
pow
(
kpts_par_
[
i
][
j
].
pt
.
x
-
kpts
[
ik
].
pt
.
x
,
2
)
+
pow
(
kpts_par_
[
i
][
j
].
pt
.
y
-
kpts
[
ik
].
pt
.
y
,
2
);
dist
=
pow
(
kpts_par_
[
i
][
j
].
pt
.
x
-
kpts
[
ik
].
pt
.
x
,
2
)
+
pow
(
kpts_par_
[
i
][
j
].
pt
.
y
-
kpts
[
ik
].
pt
.
y
,
2
);
...
@@ -610,7 +610,7 @@ void KAZEFeatures::Do_Subpixel_Refinement(std::vector<cv::KeyPoint> &kpts) {
...
@@ -610,7 +610,7 @@ void KAZEFeatures::Do_Subpixel_Refinement(std::vector<cv::KeyPoint> &kpts) {
void
KAZEFeatures
::
Feature_Suppression_Distance
(
std
::
vector
<
cv
::
KeyPoint
>&
kpts
,
const
float
&
mdist
)
{
void
KAZEFeatures
::
Feature_Suppression_Distance
(
std
::
vector
<
cv
::
KeyPoint
>&
kpts
,
const
float
&
mdist
)
{
vector
<
KeyPoint
>
aux
;
vector
<
KeyPoint
>
aux
;
vector
<
in
t
>
to_delete
;
vector
<
size_
t
>
to_delete
;
float
dist
=
0.0
,
x1
=
0.0
,
y1
=
0.0
,
x2
=
0.0
,
y2
=
0.0
;
float
dist
=
0.0
,
x1
=
0.0
,
y1
=
0.0
,
x2
=
0.0
,
y2
=
0.0
;
bool
found
=
false
;
bool
found
=
false
;
...
@@ -639,7 +639,7 @@ void KAZEFeatures::Feature_Suppression_Distance(std::vector<cv::KeyPoint>& kpts,
...
@@ -639,7 +639,7 @@ void KAZEFeatures::Feature_Suppression_Distance(std::vector<cv::KeyPoint>& kpts,
found
=
false
;
found
=
false
;
for
(
size_t
j
=
0
;
j
<
to_delete
.
size
();
j
++
)
{
for
(
size_t
j
=
0
;
j
<
to_delete
.
size
();
j
++
)
{
if
(
i
==
(
size_t
)(
to_delete
[
j
])
)
{
if
(
i
==
to_delete
[
j
]
)
{
found
=
true
;
found
=
true
;
break
;
break
;
}
}
...
@@ -670,10 +670,10 @@ void KAZEFeatures::Feature_Description(std::vector<cv::KeyPoint> &kpts, cv::Mat
...
@@ -670,10 +670,10 @@ void KAZEFeatures::Feature_Description(std::vector<cv::KeyPoint> &kpts, cv::Mat
// Allocate memory for the matrix of descriptors
// Allocate memory for the matrix of descriptors
if
(
use_extended_
==
true
)
{
if
(
use_extended_
==
true
)
{
desc
=
Mat
::
zeros
(
kpts
.
size
(),
128
,
CV_32FC1
);
desc
=
Mat
::
zeros
(
(
int
)
kpts
.
size
(),
128
,
CV_32FC1
);
}
}
else
{
else
{
desc
=
Mat
::
zeros
(
kpts
.
size
(),
64
,
CV_32FC1
);
desc
=
Mat
::
zeros
(
(
int
)
kpts
.
size
(),
64
,
CV_32FC1
);
}
}
if
(
use_upright_
==
true
)
{
if
(
use_upright_
==
true
)
{
...
@@ -684,7 +684,7 @@ void KAZEFeatures::Feature_Description(std::vector<cv::KeyPoint> &kpts, cv::Mat
...
@@ -684,7 +684,7 @@ void KAZEFeatures::Feature_Description(std::vector<cv::KeyPoint> &kpts, cv::Mat
#endif
#endif
for
(
size_t
i
=
0
;
i
<
kpts
.
size
();
i
++
)
{
for
(
size_t
i
=
0
;
i
<
kpts
.
size
();
i
++
)
{
kpts
[
i
].
angle
=
0.0
;
kpts
[
i
].
angle
=
0.0
;
Get_SURF_Upright_Descriptor_64
(
kpts
[
i
],
desc
.
ptr
<
float
>
(
i
));
Get_SURF_Upright_Descriptor_64
(
kpts
[
i
],
desc
.
ptr
<
float
>
(
(
int
)
i
));
}
}
}
}
else
if
(
descriptor_mode_
==
1
)
{
else
if
(
descriptor_mode_
==
1
)
{
...
@@ -693,7 +693,7 @@ void KAZEFeatures::Feature_Description(std::vector<cv::KeyPoint> &kpts, cv::Mat
...
@@ -693,7 +693,7 @@ void KAZEFeatures::Feature_Description(std::vector<cv::KeyPoint> &kpts, cv::Mat
#endif
#endif
for
(
size_t
i
=
0
;
i
<
kpts
.
size
();
i
++
)
{
for
(
size_t
i
=
0
;
i
<
kpts
.
size
();
i
++
)
{
kpts
[
i
].
angle
=
0.0
;
kpts
[
i
].
angle
=
0.0
;
Get_MSURF_Upright_Descriptor_64
(
kpts
[
i
],
desc
.
ptr
<
float
>
(
i
));
Get_MSURF_Upright_Descriptor_64
(
kpts
[
i
],
desc
.
ptr
<
float
>
(
(
int
)
i
));
}
}
}
}
else
if
(
descriptor_mode_
==
2
)
{
else
if
(
descriptor_mode_
==
2
)
{
...
@@ -702,7 +702,7 @@ void KAZEFeatures::Feature_Description(std::vector<cv::KeyPoint> &kpts, cv::Mat
...
@@ -702,7 +702,7 @@ void KAZEFeatures::Feature_Description(std::vector<cv::KeyPoint> &kpts, cv::Mat
#endif
#endif
for
(
size_t
i
=
0
;
i
<
kpts
.
size
();
i
++
)
{
for
(
size_t
i
=
0
;
i
<
kpts
.
size
();
i
++
)
{
kpts
[
i
].
angle
=
0.0
;
kpts
[
i
].
angle
=
0.0
;
Get_GSURF_Upright_Descriptor_64
(
kpts
[
i
],
desc
.
ptr
<
float
>
(
i
));
Get_GSURF_Upright_Descriptor_64
(
kpts
[
i
],
desc
.
ptr
<
float
>
(
(
int
)
i
));
}
}
}
}
}
}
...
@@ -714,7 +714,7 @@ void KAZEFeatures::Feature_Description(std::vector<cv::KeyPoint> &kpts, cv::Mat
...
@@ -714,7 +714,7 @@ void KAZEFeatures::Feature_Description(std::vector<cv::KeyPoint> &kpts, cv::Mat
#endif
#endif
for
(
size_t
i
=
0
;
i
<
kpts
.
size
();
i
++
)
{
for
(
size_t
i
=
0
;
i
<
kpts
.
size
();
i
++
)
{
kpts
[
i
].
angle
=
0.0
;
kpts
[
i
].
angle
=
0.0
;
Get_SURF_Upright_Descriptor_128
(
kpts
[
i
],
desc
.
ptr
<
float
>
(
i
));
Get_SURF_Upright_Descriptor_128
(
kpts
[
i
],
desc
.
ptr
<
float
>
(
(
int
)
i
));
}
}
}
}
else
if
(
descriptor_mode_
==
1
)
{
else
if
(
descriptor_mode_
==
1
)
{
...
@@ -723,7 +723,7 @@ void KAZEFeatures::Feature_Description(std::vector<cv::KeyPoint> &kpts, cv::Mat
...
@@ -723,7 +723,7 @@ void KAZEFeatures::Feature_Description(std::vector<cv::KeyPoint> &kpts, cv::Mat
#endif
#endif
for
(
size_t
i
=
0
;
i
<
kpts
.
size
();
i
++
)
{
for
(
size_t
i
=
0
;
i
<
kpts
.
size
();
i
++
)
{
kpts
[
i
].
angle
=
0.0
;
kpts
[
i
].
angle
=
0.0
;
Get_MSURF_Upright_Descriptor_128
(
kpts
[
i
],
desc
.
ptr
<
float
>
(
i
));
Get_MSURF_Upright_Descriptor_128
(
kpts
[
i
],
desc
.
ptr
<
float
>
(
(
int
)
i
));
}
}
}
}
else
if
(
descriptor_mode_
==
2
)
{
else
if
(
descriptor_mode_
==
2
)
{
...
@@ -732,7 +732,7 @@ void KAZEFeatures::Feature_Description(std::vector<cv::KeyPoint> &kpts, cv::Mat
...
@@ -732,7 +732,7 @@ void KAZEFeatures::Feature_Description(std::vector<cv::KeyPoint> &kpts, cv::Mat
#endif
#endif
for
(
size_t
i
=
0
;
i
<
kpts
.
size
();
i
++
)
{
for
(
size_t
i
=
0
;
i
<
kpts
.
size
();
i
++
)
{
kpts
[
i
].
angle
=
0.0
;
kpts
[
i
].
angle
=
0.0
;
Get_GSURF_Upright_Descriptor_128
(
kpts
[
i
],
desc
.
ptr
<
float
>
(
i
));
Get_GSURF_Upright_Descriptor_128
(
kpts
[
i
],
desc
.
ptr
<
float
>
(
(
int
)
i
));
}
}
}
}
}
}
...
@@ -745,7 +745,7 @@ void KAZEFeatures::Feature_Description(std::vector<cv::KeyPoint> &kpts, cv::Mat
...
@@ -745,7 +745,7 @@ void KAZEFeatures::Feature_Description(std::vector<cv::KeyPoint> &kpts, cv::Mat
#endif
#endif
for
(
size_t
i
=
0
;
i
<
kpts
.
size
();
i
++
)
{
for
(
size_t
i
=
0
;
i
<
kpts
.
size
();
i
++
)
{
Compute_Main_Orientation_SURF
(
kpts
[
i
]);
Compute_Main_Orientation_SURF
(
kpts
[
i
]);
Get_SURF_Descriptor_64
(
kpts
[
i
],
desc
.
ptr
<
float
>
(
i
));
Get_SURF_Descriptor_64
(
kpts
[
i
],
desc
.
ptr
<
float
>
(
(
int
)
i
));
}
}
}
}
else
if
(
descriptor_mode_
==
1
)
{
else
if
(
descriptor_mode_
==
1
)
{
...
@@ -754,7 +754,7 @@ void KAZEFeatures::Feature_Description(std::vector<cv::KeyPoint> &kpts, cv::Mat
...
@@ -754,7 +754,7 @@ void KAZEFeatures::Feature_Description(std::vector<cv::KeyPoint> &kpts, cv::Mat
#endif
#endif
for
(
size_t
i
=
0
;
i
<
kpts
.
size
();
i
++
)
{
for
(
size_t
i
=
0
;
i
<
kpts
.
size
();
i
++
)
{
Compute_Main_Orientation_SURF
(
kpts
[
i
]);
Compute_Main_Orientation_SURF
(
kpts
[
i
]);
Get_MSURF_Descriptor_64
(
kpts
[
i
],
desc
.
ptr
<
float
>
(
i
));
Get_MSURF_Descriptor_64
(
kpts
[
i
],
desc
.
ptr
<
float
>
(
(
int
)
i
));
}
}
}
}
else
if
(
descriptor_mode_
==
2
)
{
else
if
(
descriptor_mode_
==
2
)
{
...
@@ -763,7 +763,7 @@ void KAZEFeatures::Feature_Description(std::vector<cv::KeyPoint> &kpts, cv::Mat
...
@@ -763,7 +763,7 @@ void KAZEFeatures::Feature_Description(std::vector<cv::KeyPoint> &kpts, cv::Mat
#endif
#endif
for
(
size_t
i
=
0
;
i
<
kpts
.
size
();
i
++
)
{
for
(
size_t
i
=
0
;
i
<
kpts
.
size
();
i
++
)
{
Compute_Main_Orientation_SURF
(
kpts
[
i
]);
Compute_Main_Orientation_SURF
(
kpts
[
i
]);
Get_GSURF_Descriptor_64
(
kpts
[
i
],
desc
.
ptr
<
float
>
(
i
));
Get_GSURF_Descriptor_64
(
kpts
[
i
],
desc
.
ptr
<
float
>
(
(
int
)
i
));
}
}
}
}
}
}
...
@@ -774,7 +774,7 @@ void KAZEFeatures::Feature_Description(std::vector<cv::KeyPoint> &kpts, cv::Mat
...
@@ -774,7 +774,7 @@ void KAZEFeatures::Feature_Description(std::vector<cv::KeyPoint> &kpts, cv::Mat
#endif
#endif
for
(
size_t
i
=
0
;
i
<
kpts
.
size
();
i
++
)
{
for
(
size_t
i
=
0
;
i
<
kpts
.
size
();
i
++
)
{
Compute_Main_Orientation_SURF
(
kpts
[
i
]);
Compute_Main_Orientation_SURF
(
kpts
[
i
]);
Get_SURF_Descriptor_128
(
kpts
[
i
],
desc
.
ptr
<
float
>
(
i
));
Get_SURF_Descriptor_128
(
kpts
[
i
],
desc
.
ptr
<
float
>
(
(
int
)
i
));
}
}
}
}
else
if
(
descriptor_mode_
==
1
)
{
else
if
(
descriptor_mode_
==
1
)
{
...
@@ -783,7 +783,7 @@ void KAZEFeatures::Feature_Description(std::vector<cv::KeyPoint> &kpts, cv::Mat
...
@@ -783,7 +783,7 @@ void KAZEFeatures::Feature_Description(std::vector<cv::KeyPoint> &kpts, cv::Mat
#endif
#endif
for
(
size_t
i
=
0
;
i
<
kpts
.
size
();
i
++
)
{
for
(
size_t
i
=
0
;
i
<
kpts
.
size
();
i
++
)
{
Compute_Main_Orientation_SURF
(
kpts
[
i
]);
Compute_Main_Orientation_SURF
(
kpts
[
i
]);
Get_MSURF_Descriptor_128
(
kpts
[
i
],
desc
.
ptr
<
float
>
(
i
));
Get_MSURF_Descriptor_128
(
kpts
[
i
],
desc
.
ptr
<
float
>
(
(
int
)
i
));
}
}
}
}
else
if
(
descriptor_mode_
==
2
)
{
else
if
(
descriptor_mode_
==
2
)
{
...
@@ -792,7 +792,7 @@ void KAZEFeatures::Feature_Description(std::vector<cv::KeyPoint> &kpts, cv::Mat
...
@@ -792,7 +792,7 @@ void KAZEFeatures::Feature_Description(std::vector<cv::KeyPoint> &kpts, cv::Mat
#endif
#endif
for
(
size_t
i
=
0
;
i
<
kpts
.
size
();
i
++
)
{
for
(
size_t
i
=
0
;
i
<
kpts
.
size
();
i
++
)
{
Compute_Main_Orientation_SURF
(
kpts
[
i
]);
Compute_Main_Orientation_SURF
(
kpts
[
i
]);
Get_GSURF_Descriptor_128
(
kpts
[
i
],
desc
.
ptr
<
float
>
(
i
));
Get_GSURF_Descriptor_128
(
kpts
[
i
],
desc
.
ptr
<
float
>
(
(
int
)
i
));
}
}
}
}
}
}
...
...
modules/features2d/src/kaze/config.h
View file @
599bcfb5
...
@@ -30,11 +30,11 @@
...
@@ -30,11 +30,11 @@
#define NMAX_CHAR 400
#define NMAX_CHAR 400
// Some default options
// Some default options
static
const
float
DEFAULT_SCALE_OFFSET
=
1
.
60
;
// Base scale offset (sigma units)
static
const
float
DEFAULT_SCALE_OFFSET
=
1
.
60
f
;
// Base scale offset (sigma units)
static
const
float
DEFAULT_OCTAVE_MAX
=
4
.
0
;
// Maximum octave evolution of the image 2^sigma (coarsest scale sigma units)
static
const
float
DEFAULT_OCTAVE_MAX
=
4
.
0
f
;
// 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_NSUBLEVELS
=
4
;
// Default number of sublevels per scale level
static
const
float
DEFAULT_DETECTOR_THRESHOLD
=
0
.
001
;
// Detector response threshold to accept point
static
const
float
DEFAULT_DETECTOR_THRESHOLD
=
0
.
001
f
;
// Detector response threshold to accept point
static
const
float
DEFAULT_MIN_DETECTOR_THRESHOLD
=
0
.
00001
;
// Minimum 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_DESCRIPTOR_MODE
=
1
;
// Descriptor Mode 0->SURF, 1->M-SURF
static
const
int
DEFAULT_DESCRIPTOR_MODE
=
1
;
// Descriptor Mode 0->SURF, 1->M-SURF
static
const
bool
DEFAULT_USE_FED
=
true
;
// 0->AOS, 1->FED
static
const
bool
DEFAULT_USE_FED
=
true
;
// 0->AOS, 1->FED
static
const
bool
DEFAULT_UPRIGHT
=
false
;
// Upright descriptors, not invariant to rotation
static
const
bool
DEFAULT_UPRIGHT
=
false
;
// Upright descriptors, not invariant to rotation
...
@@ -45,14 +45,14 @@ static const bool DEFAULT_SHOW_RESULTS = true; // For showing the output image w
...
@@ -45,14 +45,14 @@ static const bool DEFAULT_SHOW_RESULTS = true; // For showing the output image w
static
const
bool
DEFAULT_SAVE_KEYPOINTS
=
false
;
// For saving the list of keypoints
static
const
bool
DEFAULT_SAVE_KEYPOINTS
=
false
;
// For saving the list of keypoints
// Some important configuration variables
// Some important configuration variables
static
const
float
DEFAULT_SIGMA_SMOOTHING_DERIVATIVES
=
1
.
0
;
static
const
float
DEFAULT_SIGMA_SMOOTHING_DERIVATIVES
=
1
.
0
f
;
static
const
float
DEFAULT_KCONTRAST
=
.
01
;
static
const
float
DEFAULT_KCONTRAST
=
0
.
01
f
;
static
const
float
KCONTRAST_PERCENTILE
=
0
.
7
;
static
const
float
KCONTRAST_PERCENTILE
=
0
.
7
f
;
static
const
int
KCONTRAST_NBINS
=
300
;
static
const
int
KCONTRAST_NBINS
=
300
;
static
const
bool
COMPUTE_KCONTRAST
=
true
;
static
const
bool
COMPUTE_KCONTRAST
=
true
;
static
const
int
DEFAULT_DIFFUSIVITY_TYPE
=
1
;
// 0 -> PM G1, 1 -> PM G2, 2 -> Weickert
static
const
int
DEFAULT_DIFFUSIVITY_TYPE
=
1
;
// 0 -> PM G1, 1 -> PM G2, 2 -> Weickert
static
const
bool
USE_CLIPPING_NORMALIZATION
=
false
;
static
const
bool
USE_CLIPPING_NORMALIZATION
=
false
;
static
const
float
CLIPPING_NORMALIZATION_RATIO
=
1
.
6
;
static
const
float
CLIPPING_NORMALIZATION_RATIO
=
1
.
6
f
;
static
const
int
CLIPPING_NORMALIZATION_NITER
=
5
;
static
const
int
CLIPPING_NORMALIZATION_NITER
=
5
;
//*************************************************************************************
//*************************************************************************************
...
...
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