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
c7857e8c
Commit
c7857e8c
authored
Feb 20, 2014
by
Ilya Lavrenov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
small fixes
parent
8bf616e4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
13 additions
and
49 deletions
+13
-49
perf_denoising.cpp
modules/photo/perf/opencl/perf_denoising.cpp
+1
-1
fast_nlmeans_denoising_opencl.hpp
modules/photo/src/fast_nlmeans_denoising_opencl.hpp
+7
-6
nlmeans.cl
modules/photo/src/opencl/nlmeans.cl
+0
-2
test_denoising.cpp
modules/photo/test/ocl/test_denoising.cpp
+5
-40
No files found.
modules/photo/perf/opencl/perf_denoising.cpp
View file @
c7857e8c
...
...
@@ -42,7 +42,7 @@ OCL_PERF_TEST(Photo, DenoisingColored)
OCL_TEST_CYCLE
()
cv
::
fastNlMeansDenoisingColored
(
original
,
result
,
10
,
10
);
SANITY_CHECK
(
result
);
SANITY_CHECK
(
result
,
2
);
}
OCL_PERF_TEST
(
Photo
,
DISABLED_DenoisingGrayscaleMulti
)
...
...
modules/photo/src/fast_nlmeans_denoising_opencl.hpp
View file @
c7857e8c
...
...
@@ -9,20 +9,20 @@
#define __OPENCV_FAST_NLMEANS_DENOISING_OPENCL_HPP__
#include "precomp.hpp"
#define CV_OPENCL_RUN_ASSERT
#include "opencl_kernels.hpp"
#ifdef HAVE_OPENCL
namespace
cv
{
enum
{
BLOCK_ROWS
=
32
,
BLOCK_COLS
=
128
,
BLOCK_COLS
=
32
,
CTA_SIZE
=
256
};
static
inline
int
getNearestPowerOf2
(
int
value
)
static
inline
int
getNearestPowerOf2
OpenCL
(
int
value
)
{
int
p
=
0
;
while
(
1
<<
p
<
value
)
...
...
@@ -51,7 +51,7 @@ static bool ocl_calcAlmostDist2Weight(UMat & almostDist2Weight, int searchWindow
// additional optimization of precalced weights to replace division(averaging) by binary shift
CV_Assert
(
templateWindowSize
<=
46340
);
// sqrt(INT_MAX)
int
templateWindowSizeSq
=
templateWindowSize
*
templateWindowSize
;
almostTemplateWindowSizeSqBinShift
=
getNearestPowerOf2
(
templateWindowSizeSq
);
almostTemplateWindowSizeSqBinShift
=
getNearestPowerOf2
OpenCL
(
templateWindowSizeSq
);
FT
almostDist2ActualDistMultiplier
=
(
FT
)(
1
<<
almostTemplateWindowSizeSqBinShift
)
/
templateWindowSizeSq
;
const
FT
WEIGHT_THRESHOLD
=
1e-3
f
;
...
...
@@ -128,7 +128,7 @@ static bool ocl_fastNlMeansDenoising(InputArray _src, OutputArray _dst, float h,
ocl
::
KernelArg
::
PtrReadOnly
(
almostDist2Weight
),
ocl
::
KernelArg
::
PtrReadOnly
(
buffer
),
almostTemplateWindowSizeSqBinShift
);
size_t
globalsize
[
2
]
=
{
nblocksx
*
BLOCK_COLS
,
nblocksy
*
BLOCK_ROWS
},
localsize
[
2
]
=
{
CTA_SIZE
,
1
};
size_t
globalsize
[
2
]
=
{
nblocksx
*
CTA_SIZE
,
nblocksy
},
localsize
[
2
]
=
{
CTA_SIZE
,
1
};
return
k
.
run
(
2
,
globalsize
,
localsize
,
false
);
}
...
...
@@ -167,3 +167,4 @@ static bool ocl_fastNlMeansDenoisingColored( InputArray _src, OutputArray _dst,
}
#endif
#endif
modules/photo/src/opencl/nlmeans.cl
View file @
c7857e8c
...
...
@@ -115,8 +115,6 @@ inline void calcFirstElementInRow(__global const uchar * src, int src_step, int
for
(
int
j
=
0
; j < TEMPLATE_SIZE; ++j)
col_dists_current[j]
=
col_dists_current_private[j]
;
//
COND
printf
(
"%d %d\n"
,
i,
convert_int
(
dist
))
;
dists[i]
=
dist
;
up_col_dists[0
+
i]
=
col_dists[TEMPLATE_SIZE
-
1]
;
}
...
...
modules/photo/test/ocl/test_denoising.cpp
View file @
c7857e8c
/*M///////////////////////////////////////////////////////////////////////////////////////
//
// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
//
// By downloading, copying, installing or using the software you agree to this license.
// If you do not agree to this license, do not download, install,
// copy or use the software.
//
//
// License Agreement
// For Open Source Computer Vision Library
//
// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.
// Copyright (C) 2009, Willow Garage Inc., all rights reserved.
// This file is part of OpenCV project.
// It is subject to the license terms in the LICENSE file found in the top-level directory
// of this distribution and at http://opencv.org/license.html.
// Copyright (C) 2014, Advanced Micro Devices, Inc., all rights reserved.
// Third party copyrights are property of their respective owners.
//
// Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met:
//
// * Redistribution's of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
//
// * Redistribution's in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
//
// * The name of the copyright holders may not be used to endorse or promote products
// derived from this software without specific prior written permission.
//
// This software is provided by the copyright holders and contributors "as is" and
// any express or implied warranties, including, but not limited to, the implied
// warranties of merchantability and fitness for a particular purpose are disclaimed.
// In no event shall the Intel Corporation or contributors be liable for any direct,
// indirect, incidental, special, exemplary, or consequential damages
// (including, but not limited to, procurement of substitute goods or services;
// loss of use, data, or profits; or business interruption) however caused
// and on any theory of liability, whether in contract, strict liability,
// or tort (including negligence or otherwise) arising in any way out of
// the use of this software, even if advised of the possibility of such damage.
//
//M*/
#include "test_precomp.hpp"
#include "opencv2/ts/ocl_test.hpp"
...
...
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