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
a2dec6c3
Commit
a2dec6c3
authored
Mar 19, 2014
by
Andrey Pavlenko
Committed by
OpenCV Buildbot
Mar 19, 2014
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2493 from ilya-lavrenov:tapi_fnlm
parents
b70332d8
6fe71bd2
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
9 deletions
+11
-9
denoising.cpp
modules/photo/src/denoising.cpp
+6
-4
fast_nlmeans_denoising_opencl.hpp
modules/photo/src/fast_nlmeans_denoising_opencl.hpp
+2
-2
test_denoising.cpp
modules/photo/test/ocl/test_denoising.cpp
+3
-3
No files found.
modules/photo/src/denoising.cpp
View file @
a2dec6c3
...
...
@@ -86,7 +86,9 @@ void cv::fastNlMeansDenoisingColored( InputArray _src, OutputArray _dst,
float
h
,
float
hForColorComponents
,
int
templateWindowSize
,
int
searchWindowSize
)
{
if
(
_src
.
type
()
!=
CV_8UC3
)
int
type
=
_src
.
type
(),
depth
=
CV_MAT_DEPTH
(
type
),
cn
=
CV_MAT_CN
(
type
);
if
(
type
!=
CV_8UC3
&&
type
!=
CV_8UC4
)
{
CV_Error
(
Error
::
StsBadArg
,
"Type of input image should be CV_8UC3!"
);
return
;
...
...
@@ -97,7 +99,7 @@ void cv::fastNlMeansDenoisingColored( InputArray _src, OutputArray _dst,
templateWindowSize
,
searchWindowSize
))
Mat
src
=
_src
.
getMat
();
_dst
.
create
(
src
.
size
(),
src
.
type
()
);
_dst
.
create
(
src
.
size
(),
type
);
Mat
dst
=
_dst
.
getMat
();
Mat
src_lab
;
...
...
@@ -113,10 +115,10 @@ void cv::fastNlMeansDenoisingColored( InputArray _src, OutputArray _dst,
fastNlMeansDenoising
(
ab
,
ab
,
hForColorComponents
,
templateWindowSize
,
searchWindowSize
);
Mat
l_ab_denoised
[]
=
{
l
,
ab
};
Mat
dst_lab
(
src
.
size
(),
src
.
type
(
));
Mat
dst_lab
(
src
.
size
(),
CV_MAKE_TYPE
(
depth
,
3
));
mixChannels
(
l_ab_denoised
,
2
,
&
dst_lab
,
1
,
from_to
,
3
);
cvtColor
(
dst_lab
,
dst
,
COLOR_Lab2LBGR
);
cvtColor
(
dst_lab
,
dst
,
COLOR_Lab2LBGR
,
cn
);
}
static
void
fastNlMeansDenoisingMultiCheckPreconditions
(
...
...
modules/photo/src/fast_nlmeans_denoising_opencl.hpp
View file @
a2dec6c3
...
...
@@ -149,10 +149,10 @@ static bool ocl_fastNlMeansDenoisingColored( InputArray _src, OutputArray _dst,
fastNlMeansDenoising
(
l_ab
[
0
],
l_ab_denoised
[
0
],
h
,
templateWindowSize
,
searchWindowSize
);
fastNlMeansDenoising
(
l_ab
[
1
],
l_ab_denoised
[
1
],
hForColorComponents
,
templateWindowSize
,
searchWindowSize
);
UMat
dst_lab
(
src
.
size
(),
src
.
type
()
);
UMat
dst_lab
(
src
.
size
(),
CV_8UC3
);
mixChannels
(
l_ab_denoised
,
std
::
vector
<
UMat
>
(
1
,
dst_lab
),
from_to
,
3
);
cvtColor
(
dst_lab
,
dst
,
COLOR_Lab2LBGR
);
cvtColor
(
dst_lab
,
dst
,
COLOR_Lab2LBGR
,
src
.
channels
()
);
return
true
;
}
...
...
modules/photo/test/ocl/test_denoising.cpp
View file @
a2dec6c3
...
...
@@ -72,9 +72,9 @@ OCL_TEST_P(FastNlMeansDenoising, Mat)
}
}
typedef
FastNlMeansDenoisingTestBase
f
astNlMeansDenoisingColored
;
typedef
FastNlMeansDenoisingTestBase
F
astNlMeansDenoisingColored
;
OCL_TEST_P
(
f
astNlMeansDenoisingColored
,
Mat
)
OCL_TEST_P
(
F
astNlMeansDenoisingColored
,
Mat
)
{
for
(
int
j
=
0
;
j
<
test_loop_times
;
j
++
)
{
...
...
@@ -88,7 +88,7 @@ OCL_TEST_P(fastNlMeansDenoisingColored, Mat)
}
OCL_INSTANTIATE_TEST_CASE_P
(
Photo
,
FastNlMeansDenoising
,
Combine
(
Values
(
1
,
2
),
Bool
()));
OCL_INSTANTIATE_TEST_CASE_P
(
Photo
,
fastNlMeansDenoisingColored
,
Combine
(
Values
(
Channels
(
3
)
),
Bool
()));
OCL_INSTANTIATE_TEST_CASE_P
(
Photo
,
FastNlMeansDenoisingColored
,
Combine
(
Values
(
3
,
4
),
Bool
()));
}
}
// namespace cvtest::ocl
...
...
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