Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Opencv
提交
1bc9ec0d
O
Opencv
项目概览
Greenplum
/
Opencv
大约 1 年 前同步成功
通知
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,发现更多精彩内容 >>
提交
1bc9ec0d
编写于
4月 02, 2012
作者:
V
Vladislav Vinogradov
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fixed gpu::Laplacian
fixed gpu performance sample
上级
66fd36f7
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
46 addition
and
17 deletion
+46
-17
modules/gpu/include/opencv2/gpu/gpu.hpp
modules/gpu/include/opencv2/gpu/gpu.hpp
+3
-3
modules/gpu/src/filtering.cpp
modules/gpu/src/filtering.cpp
+8
-8
modules/gpu/test/test_filters.cpp
modules/gpu/test/test_filters.cpp
+1
-4
samples/gpu/performance/tests.cpp
samples/gpu/performance/tests.cpp
+34
-2
未找到文件。
modules/gpu/include/opencv2/gpu/gpu.hpp
浏览文件 @
1bc9ec0d
...
...
@@ -395,7 +395,7 @@ CV_EXPORTS void GaussianBlur(const GpuMat& src, GpuMat& dst, Size ksize, GpuMat&
//! applies Laplacian operator to the image
//! supports only ksize = 1 and ksize = 3
CV_EXPORTS
void
Laplacian
(
const
GpuMat
&
src
,
GpuMat
&
dst
,
int
ddepth
,
int
ksize
=
1
,
double
scale
=
1
,
Stream
&
stream
=
Stream
::
Null
());
CV_EXPORTS
void
Laplacian
(
const
GpuMat
&
src
,
GpuMat
&
dst
,
int
ddepth
,
int
ksize
=
1
,
double
scale
=
1
,
int
borderType
=
BORDER_DEFAULT
,
Stream
&
stream
=
Stream
::
Null
());
////////////////////////////// Arithmetics ///////////////////////////////////
...
...
@@ -1094,8 +1094,8 @@ public:
bool
use_local_init_data_cost
;
private:
GpuMat
messages_buffers
;
GpuMat
messages_buffers
;
GpuMat
temp
;
GpuMat
out
;
};
...
...
modules/gpu/src/filtering.cpp
浏览文件 @
1bc9ec0d
...
...
@@ -87,7 +87,7 @@ void cv::gpu::Scharr(const GpuMat&, GpuMat&, int, int, int, double, int, int) {
void
cv
::
gpu
::
Scharr
(
const
GpuMat
&
,
GpuMat
&
,
int
,
int
,
int
,
GpuMat
&
,
double
,
int
,
int
,
Stream
&
)
{
throw_nogpu
();
}
void
cv
::
gpu
::
GaussianBlur
(
const
GpuMat
&
,
GpuMat
&
,
Size
,
double
,
double
,
int
,
int
)
{
throw_nogpu
();
}
void
cv
::
gpu
::
GaussianBlur
(
const
GpuMat
&
,
GpuMat
&
,
Size
,
GpuMat
&
,
double
,
double
,
int
,
int
,
Stream
&
)
{
throw_nogpu
();
}
void
cv
::
gpu
::
Laplacian
(
const
GpuMat
&
,
GpuMat
&
,
int
,
int
,
double
,
Stream
&
)
{
throw_nogpu
();
}
void
cv
::
gpu
::
Laplacian
(
const
GpuMat
&
,
GpuMat
&
,
int
,
int
,
double
,
int
,
Stream
&
)
{
throw_nogpu
();
}
#else
...
...
@@ -664,8 +664,8 @@ namespace cv { namespace gpu { namespace device
namespace
imgproc
{
template
<
typename
T
,
typename
D
>
void
filter2D_gpu
(
DevMem2Db
srcWhole
,
int
ofsX
,
int
ofsY
,
DevMem2Db
dst
,
int
kWidth
,
int
kHeight
,
int
anchorX
,
int
anchorY
,
const
float
*
kernel
,
void
filter2D_gpu
(
DevMem2Db
srcWhole
,
int
ofsX
,
int
ofsY
,
DevMem2Db
dst
,
int
kWidth
,
int
kHeight
,
int
anchorX
,
int
anchorY
,
const
float
*
kernel
,
int
borderMode
,
const
float
*
borderValue
,
cudaStream_t
stream
);
}
}}}
...
...
@@ -708,14 +708,14 @@ namespace
nppFilter2D_t
func
;
};
typedef
void
(
*
gpuFilter2D_t
)(
DevMem2Db
srcWhole
,
int
ofsX
,
int
ofsY
,
DevMem2Db
dst
,
int
kWidth
,
int
kHeight
,
int
anchorX
,
int
anchorY
,
const
float
*
kernel
,
typedef
void
(
*
gpuFilter2D_t
)(
DevMem2Db
srcWhole
,
int
ofsX
,
int
ofsY
,
DevMem2Db
dst
,
int
kWidth
,
int
kHeight
,
int
anchorX
,
int
anchorY
,
const
float
*
kernel
,
int
borderMode
,
const
float
*
borderValue
,
cudaStream_t
stream
);
struct
GpuFilter2D
:
public
BaseFilter_GPU
{
GpuFilter2D
(
Size
ksize_
,
Point
anchor_
,
gpuFilter2D_t
func_
,
const
GpuMat
&
kernel_
,
int
brd_type_
)
:
BaseFilter_GPU
(
ksize_
,
anchor_
),
func
(
func_
),
kernel
(
kernel_
),
brd_type
(
brd_type_
)
BaseFilter_GPU
(
ksize_
,
anchor_
),
func
(
func_
),
kernel
(
kernel_
),
brd_type
(
brd_type_
)
{
}
...
...
@@ -1193,7 +1193,7 @@ void cv::gpu::Scharr(const GpuMat& src, GpuMat& dst, int ddepth, int dx, int dy,
sepFilter2D
(
src
,
dst
,
ddepth
,
kx
,
ky
,
buf
,
Point
(
-
1
,
-
1
),
rowBorderType
,
columnBorderType
,
stream
);
}
void
cv
::
gpu
::
Laplacian
(
const
GpuMat
&
src
,
GpuMat
&
dst
,
int
ddepth
,
int
ksize
,
double
scale
,
Stream
&
stream
)
void
cv
::
gpu
::
Laplacian
(
const
GpuMat
&
src
,
GpuMat
&
dst
,
int
ddepth
,
int
ksize
,
double
scale
,
int
borderType
,
Stream
&
stream
)
{
CV_Assert
(
ksize
==
1
||
ksize
==
3
);
...
...
@@ -1206,7 +1206,7 @@ void cv::gpu::Laplacian(const GpuMat& src, GpuMat& dst, int ddepth, int ksize, d
if
(
scale
!=
1
)
kernel
*=
scale
;
filter2D
(
src
,
dst
,
ddepth
,
kernel
,
Point
(
-
1
,
-
1
),
stream
);
filter2D
(
src
,
dst
,
ddepth
,
kernel
,
Point
(
-
1
,
-
1
),
borderType
,
stream
);
}
////////////////////////////////////////////////////////////////////////////////////////////////////
...
...
modules/gpu/test/test_filters.cpp
浏览文件 @
1bc9ec0d
...
...
@@ -334,10 +334,7 @@ TEST_P(Laplacian, Accuracy)
cv
::
Mat
dst_gold
;
cv
::
Laplacian
(
src
,
dst_gold
,
-
1
,
ksize
.
width
);
if
(
type
==
CV_32FC1
)
EXPECT_MAT_NEAR
(
dst_gold
,
dst
,
0.0
);
else
EXPECT_MAT_NEAR
(
getInnerROI
(
dst_gold
,
cv
::
Size
(
3
,
3
)),
getInnerROI
(
dst
,
cv
::
Size
(
3
,
3
)),
0.0
);
EXPECT_MAT_NEAR
(
dst_gold
,
dst
,
0.0
);
}
INSTANTIATE_TEST_CASE_P
(
GPU_Filter
,
Laplacian
,
testing
::
Combine
(
...
...
samples/gpu/performance/tests.cpp
浏览文件 @
1bc9ec0d
...
...
@@ -273,7 +273,7 @@ TEST(SURF)
SURF
surf
;
vector
<
KeyPoint
>
keypoints
;
vector
<
float
>
descriptors
;
Mat
descriptors
;
surf
(
src
,
Mat
(),
keypoints
,
descriptors
);
...
...
@@ -899,7 +899,6 @@ TEST(solvePnPRansac)
}
}
TEST
(
GaussianBlur
)
{
for
(
int
size
=
1000
;
size
<=
4000
;
size
+=
1000
)
...
...
@@ -928,6 +927,39 @@ TEST(GaussianBlur)
}
}
TEST
(
filter2D
)
{
for
(
int
size
=
512
;
size
<=
2048
;
size
*=
2
)
{
Mat
src
;
gen
(
src
,
size
,
size
,
CV_8UC4
,
0
,
256
);
for
(
int
ksize
=
3
;
ksize
<=
16
;
ksize
+=
2
)
{
SUBTEST
<<
"ksize = "
<<
ksize
<<
", "
<<
size
<<
'x'
<<
size
<<
", 8UC4"
;
Mat
kernel
;
gen
(
kernel
,
ksize
,
ksize
,
CV_32FC1
,
0.0
,
1.0
);
Mat
dst
;
cv
::
filter2D
(
src
,
dst
,
-
1
,
kernel
);
CPU_ON
;
cv
::
filter2D
(
src
,
dst
,
-
1
,
kernel
);
CPU_OFF
;
gpu
::
GpuMat
d_src
(
src
);
gpu
::
GpuMat
d_dst
;
gpu
::
filter2D
(
d_src
,
d_dst
,
-
1
,
kernel
);
GPU_ON
;
gpu
::
filter2D
(
d_src
,
d_dst
,
-
1
,
kernel
);
GPU_OFF
;
}
}
}
TEST
(
pyrDown
)
{
for
(
int
size
=
4000
;
size
>=
1000
;
size
-=
1000
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录