Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Opencv
提交
34b4a35e
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,发现更多精彩内容 >>
提交
34b4a35e
编写于
10月 18, 2012
作者:
V
Vladislav Vinogradov
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
gpu separable filters for CV_8UC3, CV_32FC3 and CV_32FC4 types
上级
9a97c74e
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
31 addition
and
7 deletion
+31
-7
modules/gpu/src/cuda/column_filter.cu
modules/gpu/src/cuda/column_filter.cu
+3
-0
modules/gpu/src/cuda/row_filter.cu
modules/gpu/src/cuda/row_filter.cu
+3
-0
modules/gpu/src/filtering.cpp
modules/gpu/src/filtering.cpp
+20
-2
modules/gpu/test/test_filters.cpp
modules/gpu/test/test_filters.cpp
+5
-5
未找到文件。
modules/gpu/src/cuda/column_filter.cu
浏览文件 @
34b4a35e
...
...
@@ -377,10 +377,13 @@ namespace cv { namespace gpu { namespace device
}
template
void
linearColumnFilter_gpu
<
float
,
uchar
>(
PtrStepSzb
src
,
PtrStepSzb
dst
,
const
float
*
kernel
,
int
ksize
,
int
anchor
,
int
brd_type
,
int
cc
,
cudaStream_t
stream
);
template
void
linearColumnFilter_gpu
<
float3
,
uchar3
>(
PtrStepSzb
src
,
PtrStepSzb
dst
,
const
float
*
kernel
,
int
ksize
,
int
anchor
,
int
brd_type
,
int
cc
,
cudaStream_t
stream
);
template
void
linearColumnFilter_gpu
<
float4
,
uchar4
>(
PtrStepSzb
src
,
PtrStepSzb
dst
,
const
float
*
kernel
,
int
ksize
,
int
anchor
,
int
brd_type
,
int
cc
,
cudaStream_t
stream
);
template
void
linearColumnFilter_gpu
<
float3
,
short3
>(
PtrStepSzb
src
,
PtrStepSzb
dst
,
const
float
*
kernel
,
int
ksize
,
int
anchor
,
int
brd_type
,
int
cc
,
cudaStream_t
stream
);
template
void
linearColumnFilter_gpu
<
float
,
int
>(
PtrStepSzb
src
,
PtrStepSzb
dst
,
const
float
*
kernel
,
int
ksize
,
int
anchor
,
int
brd_type
,
int
cc
,
cudaStream_t
stream
);
template
void
linearColumnFilter_gpu
<
float
,
float
>(
PtrStepSzb
src
,
PtrStepSzb
dst
,
const
float
*
kernel
,
int
ksize
,
int
anchor
,
int
brd_type
,
int
cc
,
cudaStream_t
stream
);
template
void
linearColumnFilter_gpu
<
float3
,
float3
>(
PtrStepSzb
src
,
PtrStepSzb
dst
,
const
float
*
kernel
,
int
ksize
,
int
anchor
,
int
brd_type
,
int
cc
,
cudaStream_t
stream
);
template
void
linearColumnFilter_gpu
<
float4
,
float4
>(
PtrStepSzb
src
,
PtrStepSzb
dst
,
const
float
*
kernel
,
int
ksize
,
int
anchor
,
int
brd_type
,
int
cc
,
cudaStream_t
stream
);
}
// namespace column_filter
}}}
// namespace cv { namespace gpu { namespace device
...
...
modules/gpu/src/cuda/row_filter.cu
浏览文件 @
34b4a35e
...
...
@@ -376,10 +376,13 @@ namespace cv { namespace gpu { namespace device
}
template
void
linearRowFilter_gpu
<
uchar
,
float
>(
PtrStepSzb
src
,
PtrStepSzb
dst
,
const
float
*
kernel
,
int
ksize
,
int
anchor
,
int
brd_type
,
int
cc
,
cudaStream_t
stream
);
template
void
linearRowFilter_gpu
<
uchar3
,
float3
>(
PtrStepSzb
src
,
PtrStepSzb
dst
,
const
float
*
kernel
,
int
ksize
,
int
anchor
,
int
brd_type
,
int
cc
,
cudaStream_t
stream
);
template
void
linearRowFilter_gpu
<
uchar4
,
float4
>(
PtrStepSzb
src
,
PtrStepSzb
dst
,
const
float
*
kernel
,
int
ksize
,
int
anchor
,
int
brd_type
,
int
cc
,
cudaStream_t
stream
);
template
void
linearRowFilter_gpu
<
short3
,
float3
>(
PtrStepSzb
src
,
PtrStepSzb
dst
,
const
float
*
kernel
,
int
ksize
,
int
anchor
,
int
brd_type
,
int
cc
,
cudaStream_t
stream
);
template
void
linearRowFilter_gpu
<
int
,
float
>(
PtrStepSzb
src
,
PtrStepSzb
dst
,
const
float
*
kernel
,
int
ksize
,
int
anchor
,
int
brd_type
,
int
cc
,
cudaStream_t
stream
);
template
void
linearRowFilter_gpu
<
float
,
float
>(
PtrStepSzb
src
,
PtrStepSzb
dst
,
const
float
*
kernel
,
int
ksize
,
int
anchor
,
int
brd_type
,
int
cc
,
cudaStream_t
stream
);
template
void
linearRowFilter_gpu
<
float3
,
float3
>(
PtrStepSzb
src
,
PtrStepSzb
dst
,
const
float
*
kernel
,
int
ksize
,
int
anchor
,
int
brd_type
,
int
cc
,
cudaStream_t
stream
);
template
void
linearRowFilter_gpu
<
float4
,
float4
>(
PtrStepSzb
src
,
PtrStepSzb
dst
,
const
float
*
kernel
,
int
ksize
,
int
anchor
,
int
brd_type
,
int
cc
,
cudaStream_t
stream
);
}
// namespace row_filter
}}}
// namespace cv { namespace gpu { namespace device
...
...
modules/gpu/src/filtering.cpp
浏览文件 @
34b4a35e
...
...
@@ -922,7 +922,7 @@ Ptr<BaseRowFilter_GPU> cv::gpu::getLinearRowFilter_GPU(int srcType, int bufType,
int
gpuBorderType
;
CV_Assert
(
tryConvertToGpuBorderType
(
borderType
,
gpuBorderType
));
CV_Assert
(
srcType
==
CV_8UC1
||
srcType
==
CV_8UC
4
||
srcType
==
CV_16SC3
||
srcType
==
CV_32SC1
||
srcType
==
CV_32FC1
);
CV_Assert
(
srcType
==
CV_8UC1
||
srcType
==
CV_8UC
3
||
srcType
==
CV_8UC4
||
srcType
==
CV_16SC3
||
srcType
==
CV_32SC1
||
srcType
==
CV_32FC1
||
srcType
==
CV_32FC3
||
srcType
==
CV_32FC4
);
CV_Assert
(
CV_MAT_DEPTH
(
bufType
)
==
CV_32F
&&
CV_MAT_CN
(
srcType
)
==
CV_MAT_CN
(
bufType
));
...
...
@@ -942,6 +942,9 @@ Ptr<BaseRowFilter_GPU> cv::gpu::getLinearRowFilter_GPU(int srcType, int bufType,
case
CV_8UC1
:
func
=
linearRowFilter_gpu
<
uchar
,
float
>
;
break
;
case
CV_8UC3
:
func
=
linearRowFilter_gpu
<
uchar3
,
float3
>
;
break
;
case
CV_8UC4
:
func
=
linearRowFilter_gpu
<
uchar4
,
float4
>
;
break
;
...
...
@@ -954,6 +957,12 @@ Ptr<BaseRowFilter_GPU> cv::gpu::getLinearRowFilter_GPU(int srcType, int bufType,
case
CV_32FC1
:
func
=
linearRowFilter_gpu
<
float
,
float
>
;
break
;
case
CV_32FC3
:
func
=
linearRowFilter_gpu
<
float3
,
float3
>
;
break
;
case
CV_32FC4
:
func
=
linearRowFilter_gpu
<
float4
,
float4
>
;
break
;
}
return
Ptr
<
BaseRowFilter_GPU
>
(
new
GpuLinearRowFilter
(
ksize
,
anchor
,
gpu_row_krnl
,
func
,
gpuBorderType
));
...
...
@@ -1034,7 +1043,7 @@ Ptr<BaseColumnFilter_GPU> cv::gpu::getLinearColumnFilter_GPU(int bufType, int ds
int
gpuBorderType
;
CV_Assert
(
tryConvertToGpuBorderType
(
borderType
,
gpuBorderType
));
CV_Assert
(
dstType
==
CV_8UC1
||
dstType
==
CV_8UC
4
||
dstType
==
CV_16SC3
||
dstType
==
CV_32SC1
||
dstType
==
CV_32FC1
);
CV_Assert
(
dstType
==
CV_8UC1
||
dstType
==
CV_8UC
3
||
dstType
==
CV_8UC4
||
dstType
==
CV_16SC3
||
dstType
==
CV_32SC1
||
dstType
==
CV_32FC1
||
dstType
==
CV_32FC3
||
dstType
==
CV_32FC4
);
CV_Assert
(
CV_MAT_DEPTH
(
bufType
)
==
CV_32F
&&
CV_MAT_CN
(
dstType
)
==
CV_MAT_CN
(
bufType
));
...
...
@@ -1054,6 +1063,9 @@ Ptr<BaseColumnFilter_GPU> cv::gpu::getLinearColumnFilter_GPU(int bufType, int ds
case
CV_8UC1
:
func
=
linearColumnFilter_gpu
<
float
,
uchar
>
;
break
;
case
CV_8UC3
:
func
=
linearColumnFilter_gpu
<
float3
,
uchar3
>
;
break
;
case
CV_8UC4
:
func
=
linearColumnFilter_gpu
<
float4
,
uchar4
>
;
break
;
...
...
@@ -1066,6 +1078,12 @@ Ptr<BaseColumnFilter_GPU> cv::gpu::getLinearColumnFilter_GPU(int bufType, int ds
case
CV_32FC1
:
func
=
linearColumnFilter_gpu
<
float
,
float
>
;
break
;
case
CV_32FC3
:
func
=
linearColumnFilter_gpu
<
float3
,
float3
>
;
break
;
case
CV_32FC4
:
func
=
linearColumnFilter_gpu
<
float4
,
float4
>
;
break
;
}
return
Ptr
<
BaseColumnFilter_GPU
>
(
new
GpuLinearColumnFilter
(
ksize
,
anchor
,
gpu_col_krnl
,
func
,
gpuBorderType
));
...
...
modules/gpu/test/test_filters.cpp
浏览文件 @
34b4a35e
...
...
@@ -152,13 +152,13 @@ TEST_P(Sobel, Accuracy)
cv
::
Mat
dst_gold
;
cv
::
Sobel
(
src
,
dst_gold
,
-
1
,
dx
,
dy
,
ksize
.
width
,
1.0
,
0.0
,
borderType
);
EXPECT_MAT_NEAR
(
dst_gold
,
dst
,
0.0
);
EXPECT_MAT_NEAR
(
dst_gold
,
dst
,
CV_MAT_DEPTH
(
type
)
<
CV_32F
?
0.0
:
0.1
);
}
INSTANTIATE_TEST_CASE_P
(
GPU_Filter
,
Sobel
,
testing
::
Combine
(
ALL_DEVICES
,
DIFFERENT_SIZES
,
testing
::
Values
(
MatType
(
CV_8UC1
),
MatType
(
CV_8UC4
)),
testing
::
Values
(
MatType
(
CV_8UC1
),
MatType
(
CV_8UC
3
),
MatType
(
CV_8UC4
),
MatType
(
CV_32FC1
),
MatType
(
CV_32FC3
),
MatType
(
CV_32FC
4
)),
testing
::
Values
(
KSize
(
cv
::
Size
(
3
,
3
)),
KSize
(
cv
::
Size
(
5
,
5
)),
KSize
(
cv
::
Size
(
7
,
7
))),
testing
::
Values
(
Deriv_X
(
0
),
Deriv_X
(
1
),
Deriv_X
(
2
)),
testing
::
Values
(
Deriv_Y
(
0
),
Deriv_Y
(
1
),
Deriv_Y
(
2
)),
...
...
@@ -208,13 +208,13 @@ TEST_P(Scharr, Accuracy)
cv
::
Mat
dst_gold
;
cv
::
Scharr
(
src
,
dst_gold
,
-
1
,
dx
,
dy
,
1.0
,
0.0
,
borderType
);
EXPECT_MAT_NEAR
(
dst_gold
,
dst
,
0.0
);
EXPECT_MAT_NEAR
(
dst_gold
,
dst
,
CV_MAT_DEPTH
(
type
)
<
CV_32F
?
0.0
:
0.1
);
}
INSTANTIATE_TEST_CASE_P
(
GPU_Filter
,
Scharr
,
testing
::
Combine
(
ALL_DEVICES
,
DIFFERENT_SIZES
,
testing
::
Values
(
MatType
(
CV_8UC1
),
MatType
(
CV_8UC4
)),
testing
::
Values
(
MatType
(
CV_8UC1
),
MatType
(
CV_8UC
3
),
MatType
(
CV_8UC4
),
MatType
(
CV_32FC1
),
MatType
(
CV_32FC3
),
MatType
(
CV_32FC
4
)),
testing
::
Values
(
Deriv_X
(
0
),
Deriv_X
(
1
)),
testing
::
Values
(
Deriv_Y
(
0
),
Deriv_Y
(
1
)),
testing
::
Values
(
BorderType
(
cv
::
BORDER_REFLECT101
),
...
...
@@ -281,7 +281,7 @@ TEST_P(GaussianBlur, Accuracy)
INSTANTIATE_TEST_CASE_P
(
GPU_Filter
,
GaussianBlur
,
testing
::
Combine
(
ALL_DEVICES
,
DIFFERENT_SIZES
,
testing
::
Values
(
MatType
(
CV_8UC1
),
MatType
(
CV_8UC4
)),
testing
::
Values
(
MatType
(
CV_8UC1
),
MatType
(
CV_8UC
3
),
MatType
(
CV_8UC4
),
MatType
(
CV_32FC1
),
MatType
(
CV_32FC3
),
MatType
(
CV_32FC
4
)),
testing
::
Values
(
KSize
(
cv
::
Size
(
3
,
3
)),
KSize
(
cv
::
Size
(
5
,
5
)),
KSize
(
cv
::
Size
(
7
,
7
)),
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录