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
09d93af9
Commit
09d93af9
authored
Jan 28, 2013
by
Andrey Kamaev
Committed by
OpenCV Buildbot
Jan 28, 2013
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #343 from taka-no-me:fix_nlmeans_2646
parents
8521ac5d
73744453
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
17 additions
and
7 deletions
+17
-7
fast_nlmeans_denoising_invoker.hpp
modules/photo/src/fast_nlmeans_denoising_invoker.hpp
+1
-1
fast_nlmeans_multi_denoising_invoker.hpp
modules/photo/src/fast_nlmeans_multi_denoising_invoker.hpp
+1
-1
test_denoising.cpp
modules/photo/test/test_denoising.cpp
+14
-4
test_inpaint.cpp
modules/photo/test/test_inpaint.cpp
+1
-1
No files found.
modules/photo/src/fast_nlmeans_denoising_invoker.hpp
View file @
09d93af9
...
@@ -257,7 +257,7 @@ void FastNlMeansDenoisingInvoker<T>::operator() (const BlockedRange& range) cons
...
@@ -257,7 +257,7 @@ void FastNlMeansDenoisingInvoker<T>::operator() (const BlockedRange& range) cons
}
}
for
(
size_t
channel_num
=
0
;
channel_num
<
sizeof
(
T
);
channel_num
++
)
for
(
size_t
channel_num
=
0
;
channel_num
<
sizeof
(
T
);
channel_num
++
)
estimation
[
channel_num
]
=
(
estimation
[
channel_num
]
+
weights_sum
/
2
)
/
weights_sum
;
estimation
[
channel_num
]
=
(
(
unsigned
)
estimation
[
channel_num
]
+
weights_sum
/
2
)
/
weights_sum
;
dst_
.
at
<
T
>
(
i
,
j
)
=
saturateCastFromArray
<
T
>
(
estimation
);
dst_
.
at
<
T
>
(
i
,
j
)
=
saturateCastFromArray
<
T
>
(
estimation
);
}
}
...
...
modules/photo/src/fast_nlmeans_multi_denoising_invoker.hpp
View file @
09d93af9
...
@@ -287,7 +287,7 @@ void FastNlMeansMultiDenoisingInvoker<T>::operator() (const BlockedRange& range)
...
@@ -287,7 +287,7 @@ void FastNlMeansMultiDenoisingInvoker<T>::operator() (const BlockedRange& range)
}
}
for
(
size_t
channel_num
=
0
;
channel_num
<
sizeof
(
T
);
channel_num
++
)
for
(
size_t
channel_num
=
0
;
channel_num
<
sizeof
(
T
);
channel_num
++
)
estimation
[
channel_num
]
=
(
estimation
[
channel_num
]
+
weights_sum
/
2
)
/
weights_sum
;
estimation
[
channel_num
]
=
(
(
unsigned
)
estimation
[
channel_num
]
+
weights_sum
/
2
)
/
weights_sum
;
dst_
.
at
<
T
>
(
i
,
j
)
=
saturateCastFromArray
<
T
>
(
estimation
);
dst_
.
at
<
T
>
(
i
,
j
)
=
saturateCastFromArray
<
T
>
(
estimation
);
...
...
modules/photo/test/test_denoising.cpp
View file @
09d93af9
...
@@ -56,7 +56,7 @@ using namespace std;
...
@@ -56,7 +56,7 @@ using namespace std;
#endif
#endif
TEST
(
Imgproc
_DenoisingGrayscale
,
regression
)
TEST
(
Photo
_DenoisingGrayscale
,
regression
)
{
{
string
folder
=
string
(
cvtest
::
TS
::
ptr
()
->
get_data_path
())
+
"denoising/"
;
string
folder
=
string
(
cvtest
::
TS
::
ptr
()
->
get_data_path
())
+
"denoising/"
;
string
original_path
=
folder
+
"lena_noised_gaussian_sigma=10.png"
;
string
original_path
=
folder
+
"lena_noised_gaussian_sigma=10.png"
;
...
@@ -76,7 +76,7 @@ TEST(Imgproc_DenoisingGrayscale, regression)
...
@@ -76,7 +76,7 @@ TEST(Imgproc_DenoisingGrayscale, regression)
ASSERT_EQ
(
0
,
norm
(
result
!=
expected
));
ASSERT_EQ
(
0
,
norm
(
result
!=
expected
));
}
}
TEST
(
Imgproc
_DenoisingColored
,
regression
)
TEST
(
Photo
_DenoisingColored
,
regression
)
{
{
string
folder
=
string
(
cvtest
::
TS
::
ptr
()
->
get_data_path
())
+
"denoising/"
;
string
folder
=
string
(
cvtest
::
TS
::
ptr
()
->
get_data_path
())
+
"denoising/"
;
string
original_path
=
folder
+
"lena_noised_gaussian_sigma=10.png"
;
string
original_path
=
folder
+
"lena_noised_gaussian_sigma=10.png"
;
...
@@ -96,7 +96,7 @@ TEST(Imgproc_DenoisingColored, regression)
...
@@ -96,7 +96,7 @@ TEST(Imgproc_DenoisingColored, regression)
ASSERT_EQ
(
0
,
norm
(
result
!=
expected
));
ASSERT_EQ
(
0
,
norm
(
result
!=
expected
));
}
}
TEST
(
Imgproc
_DenoisingGrayscaleMulti
,
regression
)
TEST
(
Photo
_DenoisingGrayscaleMulti
,
regression
)
{
{
const
int
imgs_count
=
3
;
const
int
imgs_count
=
3
;
string
folder
=
string
(
cvtest
::
TS
::
ptr
()
->
get_data_path
())
+
"denoising/"
;
string
folder
=
string
(
cvtest
::
TS
::
ptr
()
->
get_data_path
())
+
"denoising/"
;
...
@@ -121,7 +121,7 @@ TEST(Imgproc_DenoisingGrayscaleMulti, regression)
...
@@ -121,7 +121,7 @@ TEST(Imgproc_DenoisingGrayscaleMulti, regression)
ASSERT_EQ
(
0
,
norm
(
result
!=
expected
));
ASSERT_EQ
(
0
,
norm
(
result
!=
expected
));
}
}
TEST
(
Imgproc
_DenoisingColoredMulti
,
regression
)
TEST
(
Photo
_DenoisingColoredMulti
,
regression
)
{
{
const
int
imgs_count
=
3
;
const
int
imgs_count
=
3
;
string
folder
=
string
(
cvtest
::
TS
::
ptr
()
->
get_data_path
())
+
"denoising/"
;
string
folder
=
string
(
cvtest
::
TS
::
ptr
()
->
get_data_path
())
+
"denoising/"
;
...
@@ -146,3 +146,13 @@ TEST(Imgproc_DenoisingColoredMulti, regression)
...
@@ -146,3 +146,13 @@ TEST(Imgproc_DenoisingColoredMulti, regression)
ASSERT_EQ
(
0
,
norm
(
result
!=
expected
));
ASSERT_EQ
(
0
,
norm
(
result
!=
expected
));
}
}
TEST
(
Photo_White
,
issue_2646
)
{
cv
::
Mat
img
(
50
,
50
,
CV_8UC1
,
cv
::
Scalar
::
all
(
255
));
cv
::
Mat
filtered
;
cv
::
fastNlMeansDenoising
(
img
,
filtered
);
int
nonWhitePixelsCount
=
(
int
)
img
.
total
()
-
cv
::
countNonZero
(
filtered
==
img
);
ASSERT_EQ
(
0
,
nonWhitePixelsCount
);
}
modules/photo/test/test_inpaint.cpp
View file @
09d93af9
...
@@ -115,4 +115,4 @@ void CV_InpaintTest::run( int )
...
@@ -115,4 +115,4 @@ void CV_InpaintTest::run( int )
ts
->
set_failed_test_info
(
cvtest
::
TS
::
OK
);
ts
->
set_failed_test_info
(
cvtest
::
TS
::
OK
);
}
}
TEST
(
Imgproc
_Inpaint
,
regression
)
{
CV_InpaintTest
test
;
test
.
safe_run
();
}
TEST
(
Photo
_Inpaint
,
regression
)
{
CV_InpaintTest
test
;
test
.
safe_run
();
}
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