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
0ecd7913
Commit
0ecd7913
authored
Sep 19, 2013
by
Alexander Smorkalov
Committed by
OpenCV Buildbot
Sep 19, 2013
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1472 from alalek:master_fix_debug_builds_on_win
parents
c550e452
81ac97c6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
1 deletion
+16
-1
denoise_tvl1.cpp
modules/optim/src/denoise_tvl1.cpp
+16
-1
No files found.
modules/optim/src/denoise_tvl1.cpp
View file @
0ecd7913
...
...
@@ -18,6 +18,21 @@ namespace cv{namespace optim{
double
_scale
;
};
#ifndef OPENCV_NOSTL
using
std
::
transform
;
#else
template
<
class
InputIterator
,
class
InputIterator2
,
class
OutputIterator
,
class
BinaryOperator
>
static
OutputIterator
transform
(
InputIterator
first1
,
InputIterator
last1
,
InputIterator2
first2
,
OutputIterator
result
,
BinaryOperator
binary_op
)
{
while
(
first1
!=
last1
)
{
*
result
=
binary_op
(
*
first1
,
*
first2
);
++
result
;
++
first1
;
++
first2
;
}
return
result
;
}
#endif
void
denoise_TVL1
(
const
std
::
vector
<
Mat
>&
observations
,
Mat
&
result
,
double
lambda
,
int
niters
){
CV_Assert
(
observations
.
size
()
>
0
&&
niters
>
0
&&
lambda
>
0
);
...
...
@@ -68,7 +83,7 @@ namespace cv{namespace optim{
//Rs = clip(Rs + sigma*(X-imgs), -clambda, clambda)
for
(
count
=
0
;
count
<
(
int
)
Rs
.
size
();
count
++
){
std
::
transform
<
MatIterator_
<
double
>
,
MatConstIterator_
<
uchar
>
,
MatIterator_
<
double
>
,
AddFloatToCharScaled
>
(
transform
<
MatIterator_
<
double
>
,
MatConstIterator_
<
uchar
>
,
MatIterator_
<
double
>
,
AddFloatToCharScaled
>
(
Rs
[
count
].
begin
(),
Rs
[
count
].
end
(),
observations
[
count
].
begin
<
uchar
>
(),
Rs
[
count
].
begin
(),
AddFloatToCharScaled
(
-
sigma
/
255.0
));
Rs
[
count
]
+=
sigma
*
X
;
...
...
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