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
f375c86d
Commit
f375c86d
authored
Apr 18, 2013
by
Vladislav Vinogradov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
photo module fixes
parent
12f16b7a
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
36 additions
and
28 deletions
+36
-28
CMakeLists.txt
modules/photo/CMakeLists.txt
+1
-1
perf_gpu.cpp
modules/photo/perf/perf_gpu.cpp
+9
-3
nlm.cu
modules/photo/src/cuda/nlm.cu
+0
-5
denoising_gpu.cpp
modules/photo/src/denoising_gpu.cpp
+11
-6
test_denoising_gpu.cpp
modules/photo/test/test_denoising_gpu.cpp
+15
-13
No files found.
modules/photo/CMakeLists.txt
View file @
f375c86d
...
...
@@ -4,4 +4,4 @@ if(HAVE_CUDA)
ocv_warnings_disable
(
CMAKE_CXX_FLAGS -Wundef -Wmissing-declarations
)
endif
()
ocv_define_module
(
photo opencv_imgproc OPTIONAL opencv_gpuimgproc
)
ocv_define_module
(
photo opencv_imgproc OPTIONAL opencv_gpu
arithm opencv_gpu
imgproc
)
modules/photo/perf/perf_gpu.cpp
View file @
f375c86d
...
...
@@ -45,6 +45,10 @@
#include "opencv2/photo/gpu.hpp"
#include "opencv2/ts/gpu_perf.hpp"
#include "opencv2/opencv_modules.hpp"
#if defined (HAVE_CUDA) && defined(HAVE_OPENCV_GPUARITHM) && defined(HAVE_OPENCV_GPUIMGPROC)
using
namespace
std
;
using
namespace
testing
;
using
namespace
perf
;
...
...
@@ -56,7 +60,7 @@ using namespace perf;
DEF_PARAM_TEST
(
Sz_Depth_Cn_WinSz_BlockSz
,
cv
::
Size
,
MatDepth
,
MatCn
,
int
,
int
);
PERF_TEST_P
(
Sz_Depth_Cn_WinSz_BlockSz
,
Denoising
_NonLocalMeans
,
PERF_TEST_P
(
Sz_Depth_Cn_WinSz_BlockSz
,
GPU
_NonLocalMeans
,
Combine
(
GPU_DENOISING_IMAGE_SIZES
,
Values
<
MatDepth
>
(
CV_8U
),
GPU_CHANNELS_1_3
,
...
...
@@ -100,7 +104,7 @@ PERF_TEST_P(Sz_Depth_Cn_WinSz_BlockSz, Denoising_NonLocalMeans,
DEF_PARAM_TEST
(
Sz_Depth_Cn_WinSz_BlockSz
,
cv
::
Size
,
MatDepth
,
MatCn
,
int
,
int
);
PERF_TEST_P
(
Sz_Depth_Cn_WinSz_BlockSz
,
Denoising
_FastNonLocalMeans
,
PERF_TEST_P
(
Sz_Depth_Cn_WinSz_BlockSz
,
GPU
_FastNonLocalMeans
,
Combine
(
GPU_DENOISING_IMAGE_SIZES
,
Values
<
MatDepth
>
(
CV_8U
),
GPU_CHANNELS_1_3
,
...
...
@@ -146,7 +150,7 @@ PERF_TEST_P(Sz_Depth_Cn_WinSz_BlockSz, Denoising_FastNonLocalMeans,
DEF_PARAM_TEST
(
Sz_Depth_WinSz_BlockSz
,
cv
::
Size
,
MatDepth
,
int
,
int
);
PERF_TEST_P
(
Sz_Depth_WinSz_BlockSz
,
Denoising
_FastNonLocalMeansColored
,
PERF_TEST_P
(
Sz_Depth_WinSz_BlockSz
,
GPU
_FastNonLocalMeansColored
,
Combine
(
GPU_DENOISING_IMAGE_SIZES
,
Values
<
MatDepth
>
(
CV_8U
),
Values
(
21
),
...
...
@@ -185,3 +189,5 @@ PERF_TEST_P(Sz_Depth_WinSz_BlockSz, Denoising_FastNonLocalMeansColored,
CPU_SANITY_CHECK
(
dst
);
}
}
#endif
modules/photo/src/cuda/nlm.cu
View file @
f375c86d
...
...
@@ -40,8 +40,6 @@
//
//M*/
#if !defined CUDA_DISABLER
#include "opencv2/core/cuda/common.hpp"
#include "opencv2/core/cuda/vec_traits.hpp"
#include "opencv2/core/cuda/vec_math.hpp"
...
...
@@ -564,6 +562,3 @@ namespace cv { namespace gpu { namespace cudev
}
}
}}}
#endif /* CUDA_DISABLER */
modules/photo/src/denoising_gpu.cpp
View file @
f375c86d
...
...
@@ -44,13 +44,21 @@
#include "opencv2/photo/gpu.hpp"
#include "opencv2/core/gpu_private.hpp"
#include "opencv2/gpuarithm.hpp"
#include "opencv2/gpuimgproc.hpp"
#include "opencv2/opencv_modules.hpp"
#ifdef HAVE_OPENCV_GPUARITHM
# include "opencv2/gpuarithm.hpp"
#endif
#ifdef HAVE_OPENCV_GPUIMGPROC
# include "opencv2/gpuimgproc.hpp"
#endif
using
namespace
cv
;
using
namespace
cv
::
gpu
;
#if !defined (HAVE_CUDA) ||
defined (CUDA_DISABLER
)
#if !defined (HAVE_CUDA) ||
!defined(HAVE_OPENCV_GPUARITHM) || !defined(HAVE_OPENCV_GPUIMGPROC
)
void
cv
::
gpu
::
nonLocalMeans
(
const
GpuMat
&
,
GpuMat
&
,
float
,
int
,
int
,
int
,
Stream
&
)
{
throw_no_cuda
();
}
void
cv
::
gpu
::
FastNonLocalMeansDenoising
::
simpleMethod
(
const
GpuMat
&
,
GpuMat
&
,
float
,
int
,
int
,
Stream
&
)
{
throw_no_cuda
();
}
...
...
@@ -147,7 +155,4 @@ void cv::gpu::FastNonLocalMeansDenoising::labMethod( const GpuMat& src, GpuMat&
cv
::
gpu
::
cvtColor
(
lab
,
dst
,
cv
::
COLOR_Lab2BGR
,
0
,
s
);
}
#endif
modules/photo/test/test_denoising_gpu.cpp
View file @
f375c86d
...
...
@@ -45,18 +45,20 @@
#include "opencv2/photo/gpu.hpp"
#include "opencv2/ts/gpu_test.hpp"
#ifdef HAVE_CUDA
#include "opencv2/opencv_modules.hpp"
#if defined (HAVE_CUDA) && defined(HAVE_OPENCV_GPUARITHM) && defined(HAVE_OPENCV_GPUIMGPROC)
using
namespace
cvtest
;
////////////////////////////////////////////////////////
// Brute Force Non local means
TEST
(
BruteForceNonLocalMeans
,
Regression
)
TEST
(
GPU_
BruteForceNonLocalMeans
,
Regression
)
{
using
cv
::
gpu
::
GpuMat
;
cv
::
Mat
bgr
=
readImage
(
"denoising/lena_noised_gaussian_sigma=20_multi_0.png"
,
cv
::
IMREAD_COLOR
);
cv
::
Mat
bgr
=
readImage
(
"
../gpu/
denoising/lena_noised_gaussian_sigma=20_multi_0.png"
,
cv
::
IMREAD_COLOR
);
ASSERT_FALSE
(
bgr
.
empty
());
cv
::
Mat
gray
;
...
...
@@ -67,12 +69,12 @@ TEST(BruteForceNonLocalMeans, Regression)
cv
::
gpu
::
nonLocalMeans
(
GpuMat
(
gray
),
dgray
,
20
);
#if 0
dumpImage("denoising/nlm_denoised_lena_bgr.png", cv::Mat(dbgr));
dumpImage("denoising/nlm_denoised_lena_gray.png", cv::Mat(dgray));
dumpImage("
../gpu/
denoising/nlm_denoised_lena_bgr.png", cv::Mat(dbgr));
dumpImage("
../gpu/
denoising/nlm_denoised_lena_gray.png", cv::Mat(dgray));
#endif
cv
::
Mat
bgr_gold
=
readImage
(
"denoising/nlm_denoised_lena_bgr.png"
,
cv
::
IMREAD_COLOR
);
cv
::
Mat
gray_gold
=
readImage
(
"denoising/nlm_denoised_lena_gray.png"
,
cv
::
IMREAD_GRAYSCALE
);
cv
::
Mat
bgr_gold
=
readImage
(
"
../gpu/
denoising/nlm_denoised_lena_bgr.png"
,
cv
::
IMREAD_COLOR
);
cv
::
Mat
gray_gold
=
readImage
(
"
../gpu/
denoising/nlm_denoised_lena_gray.png"
,
cv
::
IMREAD_GRAYSCALE
);
ASSERT_FALSE
(
bgr_gold
.
empty
()
||
gray_gold
.
empty
());
EXPECT_MAT_NEAR
(
bgr_gold
,
dbgr
,
1e-4
);
...
...
@@ -82,11 +84,11 @@ TEST(BruteForceNonLocalMeans, Regression)
////////////////////////////////////////////////////////
// Fast Force Non local means
TEST
(
FastNonLocalMeans
,
Regression
)
TEST
(
GPU_
FastNonLocalMeans
,
Regression
)
{
using
cv
::
gpu
::
GpuMat
;
cv
::
Mat
bgr
=
readImage
(
"denoising/lena_noised_gaussian_sigma=20_multi_0.png"
,
cv
::
IMREAD_COLOR
);
cv
::
Mat
bgr
=
readImage
(
"
../gpu/
denoising/lena_noised_gaussian_sigma=20_multi_0.png"
,
cv
::
IMREAD_COLOR
);
ASSERT_FALSE
(
bgr
.
empty
());
cv
::
Mat
gray
;
...
...
@@ -99,12 +101,12 @@ TEST(FastNonLocalMeans, Regression)
fnlmd
.
labMethod
(
GpuMat
(
bgr
),
dbgr
,
20
,
10
);
#if 0
dumpImage("denoising/fnlm_denoised_lena_bgr.png", cv::Mat(dbgr));
dumpImage("denoising/fnlm_denoised_lena_gray.png", cv::Mat(dgray));
dumpImage("
../gpu/
denoising/fnlm_denoised_lena_bgr.png", cv::Mat(dbgr));
dumpImage("
../gpu/
denoising/fnlm_denoised_lena_gray.png", cv::Mat(dgray));
#endif
cv
::
Mat
bgr_gold
=
readImage
(
"denoising/fnlm_denoised_lena_bgr.png"
,
cv
::
IMREAD_COLOR
);
cv
::
Mat
gray_gold
=
readImage
(
"denoising/fnlm_denoised_lena_gray.png"
,
cv
::
IMREAD_GRAYSCALE
);
cv
::
Mat
bgr_gold
=
readImage
(
"
../gpu/
denoising/fnlm_denoised_lena_bgr.png"
,
cv
::
IMREAD_COLOR
);
cv
::
Mat
gray_gold
=
readImage
(
"
../gpu/
denoising/fnlm_denoised_lena_gray.png"
,
cv
::
IMREAD_GRAYSCALE
);
ASSERT_FALSE
(
bgr_gold
.
empty
()
||
gray_gold
.
empty
());
EXPECT_MAT_NEAR
(
bgr_gold
,
dbgr
,
1
);
...
...
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