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
d0981a62
Commit
d0981a62
authored
Jan 23, 2012
by
Andrey Pavlenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Tegra optimization for image filtering
parent
88896166
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
56 additions
and
0 deletions
+56
-0
perf_filter2d.cpp
modules/imgproc/perf/perf_filter2d.cpp
+45
-0
filter.cpp
modules/imgproc/src/filter.cpp
+5
-0
smooth.cpp
modules/imgproc/src/smooth.cpp
+6
-0
No files found.
modules/imgproc/perf/perf_filter2d.cpp
0 → 100644
View file @
d0981a62
#include "perf_precomp.hpp"
using
namespace
std
;
using
namespace
cv
;
using
namespace
perf
;
using
namespace
testing
;
using
std
::
tr1
::
make_tuple
;
using
std
::
tr1
::
get
;
CV_ENUM
(
BorderMode
,
BORDER_CONSTANT
,
BORDER_REPLICATE
,
BORDER_REFLECT_101
);
typedef
TestBaseWithParam
<
tr1
::
tuple
<
Size
,
int
,
BorderMode
>
>
TestFilter2d
;
PERF_TEST_P
(
TestFilter2d
,
Filter2d
,
Combine
(
Values
(
Size
(
320
,
240
),
szVGA
,
sz720p
,
sz1080p
),
Values
(
3
,
5
),
ValuesIn
(
BorderMode
::
all
()
)
)
)
{
Size
sz
;
int
borderMode
,
kSize
;
sz
=
get
<
0
>
(
GetParam
());
kSize
=
get
<
1
>
(
GetParam
());
borderMode
=
get
<
2
>
(
GetParam
());
Mat
src
(
sz
,
CV_8UC4
);
Mat
dst
(
sz
,
CV_8UC4
);
Mat
kernel
(
kSize
,
kSize
,
CV_32FC1
);
randu
(
kernel
,
-
3
,
10
);
float
s
=
fabs
(
sum
(
kernel
)[
0
]
);
if
(
s
>
1e-3
)
kernel
/=
s
;
declare
.
in
(
src
,
WARMUP_RNG
).
out
(
dst
).
time
(
20
);
TEST_CYCLE
()
filter2D
(
src
,
dst
,
CV_8UC4
,
kernel
,
Point
(
1
,
1
),
0.
,
borderMode
);
SANITY_CHECK
(
dst
);
}
modules/imgproc/src/filter.cpp
View file @
d0981a62
...
...
@@ -3010,6 +3010,11 @@ void cv::filter2D( InputArray _src, OutputArray _dst, int ddepth,
Mat
dst
=
_dst
.
getMat
();
anchor
=
normalizeAnchor
(
anchor
,
kernel
.
size
());
#ifdef HAVE_TEGRA_OPTIMIZATION
if
(
tegra
::
filter2D
(
src
,
dst
,
kernel
,
anchor
,
delta
,
borderType
)
)
return
;
#endif
if
(
kernel
.
cols
*
kernel
.
rows
>=
dft_filter_size
)
{
Mat
temp
;
...
...
modules/imgproc/src/smooth.cpp
View file @
d0981a62
...
...
@@ -311,6 +311,12 @@ void cv::boxFilter( InputArray _src, OutputArray _dst, int ddepth,
if
(
src
.
cols
==
1
)
ksize
.
width
=
1
;
}
#ifdef HAVE_TEGRA_OPTIMIZATION
if
(
tegra
::
boxFilter
(
src
,
dst
,
ksize
,
anchor
,
normalize
,
borderType
)
)
return
;
#endif
Ptr
<
FilterEngine
>
f
=
createBoxFilter
(
src
.
type
(),
dst
.
type
(),
ksize
,
anchor
,
normalize
,
borderType
);
f
->
apply
(
src
,
dst
);
...
...
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