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
4f6e5767
Commit
4f6e5767
authored
Nov 10, 2016
by
Alexander Alekhin
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #838 from MambaWong:master
parents
9ea4ad91
e320d7dd
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
14 deletions
+24
-14
dpm_convolution.cpp
modules/dpm/src/dpm_convolution.cpp
+24
-14
No files found.
modules/dpm/src/dpm_convolution.cpp
View file @
4f6e5767
...
...
@@ -49,11 +49,15 @@ double ConvolutionEngine::convolve(const Mat &feat, const Mat &filter,
int
dimHOG
,
int
x
,
int
y
)
{
double
val
=
0
;
for
(
int
xp
=
0
;
xp
<
filter
.
cols
;
x
p
++
)
for
(
int
yp
=
0
;
yp
<
filter
.
rows
;
y
p
++
)
{
for
(
int
yp
=
0
;
yp
<
filter
.
rows
;
yp
++
)
val
+=
filter
.
at
<
double
>
(
yp
,
xp
)
*
feat
.
at
<
double
>
(
y
+
yp
,
x
*
dimHOG
+
xp
);
const
double
*
pfeat
=
(
double
*
)
feat
.
ptr
(
y
+
yp
)
+
x
*
dimHOG
;
const
double
*
pfilter
=
(
double
*
)
filter
.
ptr
(
yp
);
for
(
int
xp
=
0
;
xp
<
filter
.
cols
;
xp
++
)
{
val
+=
pfeat
[
xp
]
*
pfilter
[
xp
];
}
}
return
val
;
...
...
@@ -62,20 +66,26 @@ double ConvolutionEngine::convolve(const Mat &feat, const Mat &filter,
void
ConvolutionEngine
::
convolve
(
const
Mat
&
feat
,
const
Mat
&
filter
,
int
dimHOG
,
Mat
&
result
)
{
for
(
int
x
=
0
;
x
<
result
.
cols
;
x
++
)
for
(
int
y
=
0
;
y
<
result
.
rows
;
y
++
)
{
for
(
int
y
=
0
;
y
<
result
.
rows
;
y
++
)
double
*
presult
=
(
double
*
)
result
.
ptr
(
y
);
for
(
int
x
=
0
;
x
<
result
.
cols
;
x
++
)
{
double
val
=
0
;
for
(
int
xp
=
0
;
xp
<
filter
.
cols
;
x
p
++
)
for
(
int
yp
=
0
;
yp
<
filter
.
rows
;
y
p
++
)
{
for
(
int
yp
=
0
;
yp
<
filter
.
rows
;
yp
++
)
val
+=
feat
.
at
<
double
>
(
y
+
yp
,
x
*
dimHOG
+
xp
)
*
filter
.
at
<
double
>
(
yp
,
xp
);
}
// xp
result
.
at
<
double
>
(
y
,
x
)
=
val
;
}
// y
}
// x
const
double
*
pfeat
=
(
double
*
)
feat
.
ptr
(
y
+
yp
)
+
x
*
dimHOG
;
const
double
*
pfilter
=
(
double
*
)
filter
.
ptr
(
yp
);
for
(
int
xp
=
0
;
xp
<
filter
.
cols
;
xp
++
)
{
val
+=
pfeat
[
xp
]
*
pfilter
[
xp
];
}
}
// yp
presult
[
x
]
=
val
;
}
// x
}
// y
}
}
// namespace cv
}
// namespace dpm
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