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
584372bb
Commit
584372bb
authored
Feb 13, 2015
by
Erik Karlsson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed bounds checking
parent
d588c717
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
6 deletions
+6
-6
fast_nlmeans_denoising_invoker.hpp
modules/photo/src/fast_nlmeans_denoising_invoker.hpp
+3
-3
fast_nlmeans_multi_denoising_invoker.hpp
modules/photo/src/fast_nlmeans_multi_denoising_invoker.hpp
+3
-3
No files found.
modules/photo/src/fast_nlmeans_denoising_invoker.hpp
View file @
584372bb
...
@@ -132,7 +132,7 @@ FastNlMeansDenoisingInvoker<T, IT, UIT>::FastNlMeansDenoisingInvoker(
...
@@ -132,7 +132,7 @@ FastNlMeansDenoisingInvoker<T, IT, UIT>::FastNlMeansDenoisingInvoker(
const
size_t
ALLOC_CHUNK
=
65536
;
const
size_t
ALLOC_CHUNK
=
65536
;
IT
max_dist
=
IT
max_dist
=
(
IT
)
pixelInfo
<
T
>::
sampleMax
()
*
(
IT
)
pixelInfo
<
T
>::
sampleMax
()
*
(
IT
)
pixelInfo
<
T
>::
channels
;
(
IT
)
pixelInfo
<
T
>::
sampleMax
()
*
(
IT
)
pixelInfo
<
T
>::
sampleMax
()
*
(
IT
)
pixelInfo
<
T
>::
channels
;
in
t
almost_max_dist
=
0
;
size_
t
almost_max_dist
=
0
;
while
(
true
)
while
(
true
)
{
{
double
dist
=
almost_max_dist
*
almost_dist2actual_dist_multiplier
;
double
dist
=
almost_max_dist
*
almost_dist2actual_dist_multiplier
;
...
@@ -158,7 +158,7 @@ void FastNlMeansDenoisingInvoker<T, IT, UIT>::operator() (const Range& range) co
...
@@ -158,7 +158,7 @@ void FastNlMeansDenoisingInvoker<T, IT, UIT>::operator() (const Range& range) co
int
row_from
=
range
.
start
;
int
row_from
=
range
.
start
;
int
row_to
=
range
.
end
-
1
;
int
row_to
=
range
.
end
-
1
;
in
t
almost_max_dist
=
almost_dist2weight_
.
size
();
size_
t
almost_max_dist
=
almost_dist2weight_
.
size
();
// sums of cols anf rows for current pixel p
// sums of cols anf rows for current pixel p
Array2d
<
IT
>
dist_sums
(
search_window_size_
,
search_window_size_
);
Array2d
<
IT
>
dist_sums
(
search_window_size_
,
search_window_size_
);
...
@@ -242,7 +242,7 @@ void FastNlMeansDenoisingInvoker<T, IT, UIT>::operator() (const Range& range) co
...
@@ -242,7 +242,7 @@ void FastNlMeansDenoisingInvoker<T, IT, UIT>::operator() (const Range& range) co
IT
*
dist_sums_row
=
dist_sums
.
row_ptr
(
y
);
IT
*
dist_sums_row
=
dist_sums
.
row_ptr
(
y
);
for
(
int
x
=
0
;
x
<
search_window_size_
;
x
++
)
for
(
int
x
=
0
;
x
<
search_window_size_
;
x
++
)
{
{
int
almostAvgDist
=
(
in
t
)(
dist_sums_row
[
x
]
>>
almost_template_window_size_sq_bin_shift_
);
size_t
almostAvgDist
=
(
size_
t
)(
dist_sums_row
[
x
]
>>
almost_template_window_size_sq_bin_shift_
);
IT
weight
=
IT
weight
=
almostAvgDist
<
almost_max_dist
?
almost_dist2weight_
[
almostAvgDist
]
:
0
;
almostAvgDist
<
almost_max_dist
?
almost_dist2weight_
[
almostAvgDist
]
:
0
;
weights_sum
+=
weight
;
weights_sum
+=
weight
;
...
...
modules/photo/src/fast_nlmeans_multi_denoising_invoker.hpp
View file @
584372bb
...
@@ -143,7 +143,7 @@ FastNlMeansMultiDenoisingInvoker<T, IT, UIT>::FastNlMeansMultiDenoisingInvoker(
...
@@ -143,7 +143,7 @@ FastNlMeansMultiDenoisingInvoker<T, IT, UIT>::FastNlMeansMultiDenoisingInvoker(
const
size_t
ALLOC_CHUNK
=
65536
;
const
size_t
ALLOC_CHUNK
=
65536
;
IT
max_dist
=
IT
max_dist
=
(
IT
)
pixelInfo
<
T
>::
sampleMax
()
*
(
IT
)
pixelInfo
<
T
>::
sampleMax
()
*
(
IT
)
pixelInfo
<
T
>::
channels
;
(
IT
)
pixelInfo
<
T
>::
sampleMax
()
*
(
IT
)
pixelInfo
<
T
>::
sampleMax
()
*
(
IT
)
pixelInfo
<
T
>::
channels
;
in
t
almost_max_dist
=
0
;
size_
t
almost_max_dist
=
0
;
while
(
true
)
while
(
true
)
{
{
double
dist
=
almost_max_dist
*
almost_dist2actual_dist_multiplier
;
double
dist
=
almost_max_dist
*
almost_dist2actual_dist_multiplier
;
...
@@ -169,7 +169,7 @@ void FastNlMeansMultiDenoisingInvoker<T, IT, UIT>::operator() (const Range& rang
...
@@ -169,7 +169,7 @@ void FastNlMeansMultiDenoisingInvoker<T, IT, UIT>::operator() (const Range& rang
int
row_from
=
range
.
start
;
int
row_from
=
range
.
start
;
int
row_to
=
range
.
end
-
1
;
int
row_to
=
range
.
end
-
1
;
in
t
almost_max_dist
=
almost_dist2weight
.
size
();
size_
t
almost_max_dist
=
almost_dist2weight
.
size
();
Array3d
<
IT
>
dist_sums
(
temporal_window_size_
,
search_window_size_
,
search_window_size_
);
Array3d
<
IT
>
dist_sums
(
temporal_window_size_
,
search_window_size_
,
search_window_size_
);
...
@@ -269,7 +269,7 @@ void FastNlMeansMultiDenoisingInvoker<T, IT, UIT>::operator() (const Range& rang
...
@@ -269,7 +269,7 @@ void FastNlMeansMultiDenoisingInvoker<T, IT, UIT>::operator() (const Range& rang
for
(
int
x
=
0
;
x
<
search_window_size_
;
x
++
)
for
(
int
x
=
0
;
x
<
search_window_size_
;
x
++
)
{
{
int
almostAvgDist
=
(
in
t
)(
dist_sums_row
[
x
]
>>
almost_template_window_size_sq_bin_shift
);
size_t
almostAvgDist
=
(
size_
t
)(
dist_sums_row
[
x
]
>>
almost_template_window_size_sq_bin_shift
);
IT
weight
=
IT
weight
=
almostAvgDist
<
almost_max_dist
?
almost_dist2weight
[
almostAvgDist
]
:
0
;
almostAvgDist
<
almost_max_dist
?
almost_dist2weight
[
almostAvgDist
]
:
0
;
...
...
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