Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Opencv
提交
f375c86d
O
Opencv
项目概览
Greenplum
/
Opencv
11 个月 前同步成功
通知
7
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
O
Opencv
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
f375c86d
编写于
4月 18, 2013
作者:
V
Vladislav Vinogradov
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
photo module fixes
上级
12f16b7a
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
36 addition
and
28 deletion
+36
-28
modules/photo/CMakeLists.txt
modules/photo/CMakeLists.txt
+1
-1
modules/photo/perf/perf_gpu.cpp
modules/photo/perf/perf_gpu.cpp
+9
-3
modules/photo/src/cuda/nlm.cu
modules/photo/src/cuda/nlm.cu
+0
-5
modules/photo/src/denoising_gpu.cpp
modules/photo/src/denoising_gpu.cpp
+11
-6
modules/photo/test/test_denoising_gpu.cpp
modules/photo/test/test_denoising_gpu.cpp
+15
-13
未找到文件。
modules/photo/CMakeLists.txt
浏览文件 @
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
浏览文件 @
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
浏览文件 @
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
浏览文件 @
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
浏览文件 @
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
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录