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
b644505b
Commit
b644505b
authored
May 31, 2011
by
Alexander Shishkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed compilation problems with new SIFT on Windows
parent
389bd146
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
5 deletions
+14
-5
sift.cpp
modules/features2d/src/sift.cpp
+14
-5
No files found.
modules/features2d/src/sift.cpp
View file @
b644505b
...
@@ -315,7 +315,12 @@ static IplImage*** build_gauss_pyr( IplImage* base, int octvs,
...
@@ -315,7 +315,12 @@ static IplImage*** build_gauss_pyr( IplImage* base, int octvs,
{
{
IplImage
***
gauss_pyr
;
IplImage
***
gauss_pyr
;
const
int
_intvls
=
intvls
;
const
int
_intvls
=
intvls
;
double
sig
[
_intvls
+
3
],
sig_total
,
sig_prev
,
k
;
#if defined WIN32 || defined _WIN32 || defined WINCE
double
*
sig
=
new
double
[
_intvls
+
3
];
#else
double
sig
[
_intvls
+
3
];
#endif
double
sig_total
,
sig_prev
,
k
;
int
i
,
o
;
int
i
,
o
;
gauss_pyr
=
(
IplImage
***
)
calloc
(
octvs
,
sizeof
(
IplImage
**
)
);
gauss_pyr
=
(
IplImage
***
)
calloc
(
octvs
,
sizeof
(
IplImage
**
)
);
...
@@ -342,7 +347,7 @@ static IplImage*** build_gauss_pyr( IplImage* base, int octvs,
...
@@ -342,7 +347,7 @@ static IplImage*** build_gauss_pyr( IplImage* base, int octvs,
if
(
o
==
0
&&
i
==
0
)
if
(
o
==
0
&&
i
==
0
)
gauss_pyr
[
o
][
i
]
=
cvCloneImage
(
base
);
gauss_pyr
[
o
][
i
]
=
cvCloneImage
(
base
);
/* base of new oct
v
ave is halved image from end of previous octave */
/* base of new octave is halved image from end of previous octave */
else
if
(
i
==
0
)
else
if
(
i
==
0
)
gauss_pyr
[
o
][
i
]
=
downsample
(
gauss_pyr
[
o
-
1
][
intvls
]
);
gauss_pyr
[
o
][
i
]
=
downsample
(
gauss_pyr
[
o
-
1
][
intvls
]
);
...
@@ -356,6 +361,10 @@ static IplImage*** build_gauss_pyr( IplImage* base, int octvs,
...
@@ -356,6 +361,10 @@ static IplImage*** build_gauss_pyr( IplImage* base, int octvs,
}
}
}
}
#if defined WIN32 || defined _WIN32 || defined WINCE
delete
[]
sig
;
#endif
return
gauss_pyr
;
return
gauss_pyr
;
}
}
...
@@ -1102,7 +1111,7 @@ static double*** descr_hist( IplImage* img, int r, int c, double ori,
...
@@ -1102,7 +1111,7 @@ static double*** descr_hist( IplImage* img, int r, int c, double ori,
bins_per_rad
=
n
/
PI2
;
bins_per_rad
=
n
/
PI2
;
exp_denom
=
d
*
d
*
0.5
;
exp_denom
=
d
*
d
*
0.5
;
hist_width
=
SIFT_DESCR_SCL_FCTR
*
scl
;
hist_width
=
SIFT_DESCR_SCL_FCTR
*
scl
;
radius
=
hist_width
*
sqrt
(
2
)
*
(
d
+
1.0
)
*
0.5
+
0.5
;
radius
=
hist_width
*
sqrt
(
2
.0
)
*
(
d
+
1.0
)
*
0.5
+
0.5
;
for
(
i
=
-
radius
;
i
<=
radius
;
i
++
)
for
(
i
=
-
radius
;
i
<=
radius
;
i
++
)
for
(
j
=
-
radius
;
j
<=
radius
;
j
++
)
for
(
j
=
-
radius
;
j
<=
radius
;
j
++
)
{
{
...
@@ -1291,7 +1300,7 @@ struct ImagePyrData
...
@@ -1291,7 +1300,7 @@ struct ImagePyrData
/* build scale space pyramid; smallest dimension of top level is ~4 pixels */
/* build scale space pyramid; smallest dimension of top level is ~4 pixels */
init_img
=
create_init_img
(
img
,
img_dbl
,
_sigma
);
init_img
=
create_init_img
(
img
,
img_dbl
,
_sigma
);
int
max_octvs
=
log
(
MIN
(
init_img
->
width
,
init_img
->
height
)
)
/
log
(
2
)
-
2
;
int
max_octvs
=
static_cast
<
int
>
(
log
(
static_cast
<
double
>
(
MIN
(
init_img
->
width
,
init_img
->
height
)))
/
log
(
2.0
)
-
2.0
)
;
octvs
=
std
::
max
(
std
::
min
(
octvs
,
max_octvs
),
1
);
octvs
=
std
::
max
(
std
::
min
(
octvs
,
max_octvs
),
1
);
gauss_pyr
=
build_gauss_pyr
(
init_img
,
octvs
,
intvls
,
_sigma
);
gauss_pyr
=
build_gauss_pyr
(
init_img
,
octvs
,
intvls
,
_sigma
);
...
@@ -1537,7 +1546,7 @@ static void fillFeatureData( feature& feat, const SiftParams& params )
...
@@ -1537,7 +1546,7 @@ static void fillFeatureData( feature& feat, const SiftParams& params )
int
o
,
ix
,
iy
,
is
;
int
o
,
ix
,
iy
,
is
;
float
s
,
phi
;
float
s
,
phi
;
phi
=
log2
(
sigma
/
params
.
sigma0
)
;
phi
=
static_cast
<
float
>
(
log
(
sigma
/
params
.
sigma0
)
/
log
(
2.0
))
;
o
=
std
::
floor
(
phi
-
(
float
(
params
.
smin
)
+
.5
)
/
params
.
S
);
o
=
std
::
floor
(
phi
-
(
float
(
params
.
smin
)
+
.5
)
/
params
.
S
);
o
=
std
::
min
(
o
,
params
.
omin
+
params
.
O
-
1
);
o
=
std
::
min
(
o
,
params
.
omin
+
params
.
O
-
1
);
o
=
std
::
max
(
o
,
params
.
omin
);
o
=
std
::
max
(
o
,
params
.
omin
);
...
...
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