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
12687179
Commit
12687179
authored
Jul 04, 2014
by
Bellaktris
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
-||-
parent
cc9fd5af
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
3 deletions
+7
-3
dct_image_denoising.cpp
modules/xphoto/src/dct_image_denoising.cpp
+3
-1
dct_image_denoising.cpp
modules/xphoto/test/dct_image_denoising.cpp
+3
-2
test_precomp.hpp
modules/xphoto/test/test_precomp.hpp
+1
-0
No files found.
modules/xphoto/src/dct_image_denoising.cpp
View file @
12687179
...
...
@@ -61,6 +61,8 @@ namespace cv
Mat_
<
float
>
res
(
src
.
size
(),
0.0
f
),
num
(
src
.
size
(),
0.0
f
);
double
threshold
=
2.0
*
log
(
psize
)
*
sigma
;
for
(
int
i
=
0
;
i
<=
src
.
rows
-
psize
;
++
i
)
for
(
int
j
=
0
;
j
<=
src
.
cols
-
psize
;
++
j
)
{
...
...
@@ -69,7 +71,7 @@ namespace cv
dct
(
patch
,
patch
);
float
*
ptr
=
(
float
*
)
patch
.
data
;
for
(
int
k
=
0
;
k
<
psize
*
psize
;
++
k
)
if
(
fabs
(
ptr
[
k
])
<
3.0
f
*
sigma
)
if
(
fabs
(
ptr
[
k
])
<
threshold
)
ptr
[
k
]
=
0.0
f
;
idct
(
patch
,
patch
);
...
...
modules/xphoto/test/dct_image_denoising.cpp
View file @
12687179
...
...
@@ -14,13 +14,14 @@ namespace cvtest
for
(
int
i
=
0
;
i
<
nTests
;
++
i
)
{
cv
::
String
srcName
=
dir
+
cv
::
format
(
"sources/%02d.png"
,
i
+
1
);
cv
::
Mat
src
=
cv
::
imread
(
srcName
);
cv
::
Mat
src
=
cv
::
imread
(
srcName
,
1
);
cv
::
String
previousResultName
=
dir
+
cv
::
format
(
"results/%02d.png"
,
i
+
1
);
cv
::
Mat
previousResult
=
cv
::
imread
(
previousResultName
,
1
);
cv
::
Mat
currentResult
;
cv
::
Mat
currentResult
,
fastNlMeansResult
;
cv
::
dctDenoising
(
src
,
currentResult
,
sigma
,
psize
);
cv
::
fastNlMeansDenoising
(
src
,
fastNlMeansResult
);
cv
::
Mat
sqrError
=
(
currentResult
-
previousResult
)
.
mul
(
currentResult
-
previousResult
);
...
...
modules/xphoto/test/test_precomp.hpp
View file @
12687179
...
...
@@ -13,6 +13,7 @@
#include "opencv2/imgproc.hpp"
#include "opencv2/imgproc/types_c.h"
#include "opencv2/highgui.hpp"
#include "opencv2/photo.hpp"
#include "opencv2/xphoto.hpp"
#include "opencv2/ts.hpp"
#include <iostream>
...
...
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