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
92edd4fc
Commit
92edd4fc
authored
Aug 21, 2012
by
Victor Passichenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix building for MS VS C++: remove allocation of arrays of dynamic size in stack
parent
017ab51b
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
18 deletions
+17
-18
denoising.cpp
modules/photo/src/denoising.cpp
+2
-2
fast_nlmeans_denoising_invoker.hpp
modules/photo/src/fast_nlmeans_denoising_invoker.hpp
+7
-7
fast_nlmeans_multi_denoising_invoker.hpp
modules/photo/src/fast_nlmeans_multi_denoising_invoker.hpp
+8
-9
No files found.
modules/photo/src/denoising.cpp
View file @
92edd4fc
...
...
@@ -103,7 +103,7 @@ static void fastNlMeansDenoisingMultiCheckPreconditions(
int
imgToDenoiseIndex
,
int
temporalWindowSize
,
int
templateWindowSize
,
int
searchWindowSize
)
{
int
src_imgs_size
=
srcImgs
.
size
();
int
src_imgs_size
=
(
int
)
srcImgs
.
size
();
if
(
src_imgs_size
==
0
)
{
CV_Error
(
CV_StsBadArg
,
"Input images vector should not be empty!"
);
}
...
...
@@ -176,7 +176,7 @@ void cv::fastNlMeansDenoisingColoredMulti( const std::vector<Mat>& srcImgs,
temporalWindowSize
,
templateWindowSize
,
searchWindowSize
);
int
src_imgs_size
=
srcImgs
.
size
();
int
src_imgs_size
=
(
int
)
srcImgs
.
size
();
if
(
srcImgs
[
0
].
type
()
!=
CV_8UC3
)
{
CV_Error
(
CV_StsBadArg
,
"Type of input images should be CV_8UC3!"
);
...
...
modules/photo/src/fast_nlmeans_denoising_invoker.hpp
View file @
92edd4fc
...
...
@@ -62,6 +62,10 @@ struct FastNlMeansDenoisingInvoker {
void
operator
()
(
const
BlockedRange
&
range
)
const
;
void
operator
=
(
const
FastNlMeansDenoisingInvoker
&
invoker
)
{
CV_Error
(
CV_StsNotImplemented
,
"Assigment operator is not implemented"
);
}
private
:
const
Mat
&
src_
;
Mat
&
dst_
;
...
...
@@ -153,16 +157,12 @@ void FastNlMeansDenoisingInvoker<T>::operator() (const BlockedRange& range) cons
int
row_from
=
range
.
begin
();
int
row_to
=
range
.
end
()
-
1
;
int
dist_sums_array
[
search_window_size_
*
search_window_size_
];
Array2d
<
int
>
dist_sums
(
dist_sums_array
,
search_window_size_
,
search_window_size_
);
Array2d
<
int
>
dist_sums
(
search_window_size_
,
search_window_size_
);
// for lazy calc optimization
int
col_dist_sums_array
[
template_window_size_
*
search_window_size_
*
search_window_size_
];
Array3d
<
int
>
col_dist_sums
(
&
col_dist_sums_array
[
0
],
template_window_size_
,
search_window_size_
,
search_window_size_
);
Array3d
<
int
>
col_dist_sums
(
template_window_size_
,
search_window_size_
,
search_window_size_
);
int
first_col_num
=
-
1
;
Array3d
<
int
>
up_col_dist_sums
(
src_
.
cols
,
search_window_size_
,
search_window_size_
);
for
(
int
i
=
row_from
;
i
<=
row_to
;
i
++
)
{
...
...
@@ -233,7 +233,7 @@ void FastNlMeansDenoisingInvoker<T>::operator() (const BlockedRange& range) cons
// calc weights
int
weights_sum
=
0
;
int
estimation
[
src_
.
channels
()
];
int
estimation
[
3
];
for
(
int
channel_num
=
0
;
channel_num
<
src_
.
channels
();
channel_num
++
)
{
estimation
[
channel_num
]
=
0
;
}
...
...
modules/photo/src/fast_nlmeans_multi_denoising_invoker.hpp
View file @
92edd4fc
...
...
@@ -63,6 +63,10 @@ struct FastNlMeansMultiDenoisingInvoker {
void
operator
()
(
const
BlockedRange
&
range
)
const
;
void
operator
=
(
const
FastNlMeansMultiDenoisingInvoker
&
invoker
)
{
CV_Error
(
CV_StsNotImplemented
,
"Assigment operator is not implemented"
);
}
private
:
int
rows_
;
int
cols_
;
...
...
@@ -175,16 +179,11 @@ void FastNlMeansMultiDenoisingInvoker<T>::operator() (const BlockedRange& range)
int
row_from
=
range
.
begin
();
int
row_to
=
range
.
end
()
-
1
;
int
dist_sums_array
[
temporal_window_size_
*
search_window_size_
*
search_window_size_
];
Array3d
<
int
>
dist_sums
(
dist_sums_array
,
temporal_window_size_
,
search_window_size_
,
search_window_size_
);
Array3d
<
int
>
dist_sums
(
temporal_window_size_
,
search_window_size_
,
search_window_size_
);
// for lazy calc optimization
int
col_dist_sums_array
[
template_window_size_
*
temporal_window_size_
*
search_window_size_
*
search_window_size_
];
Array4d
<
int
>
col_dist_sums
(
col_dist_sums_array
,
template_window_size_
,
temporal_window_size_
,
search_window_size_
,
search_window_size_
);
Array4d
<
int
>
col_dist_sums
(
template_window_size_
,
temporal_window_size_
,
search_window_size_
,
search_window_size_
);
int
first_col_num
=
-
1
;
...
...
@@ -263,7 +262,7 @@ void FastNlMeansMultiDenoisingInvoker<T>::operator() (const BlockedRange& range)
// calc weights
int
weights_sum
=
0
;
int
estimation
[
channels_count_
];
int
estimation
[
3
];
for
(
int
channel_num
=
0
;
channel_num
<
channels_count_
;
channel_num
++
)
{
estimation
[
channel_num
]
=
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