Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Opencv
提交
ed749c4b
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,发现更多精彩内容 >>
提交
ed749c4b
编写于
10月 10, 2011
作者:
V
Vladislav Vinogradov
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
added missing arithm operations to gpu module
上级
f947c2eb
变更
6
展开全部
隐藏空白更改
内联
并排
Showing
6 changed file
with
1781 addition
and
427 deletion
+1781
-427
modules/gpu/include/opencv2/gpu/gpu.hpp
modules/gpu/include/opencv2/gpu/gpu.hpp
+31
-33
modules/gpu/src/cuda/element_operations.cu
modules/gpu/src/cuda/element_operations.cu
+1174
-168
modules/gpu/src/element_operations.cpp
modules/gpu/src/element_operations.cpp
+560
-210
modules/gpu/src/filtering.cpp
modules/gpu/src/filtering.cpp
+3
-3
modules/gpu/test/test_arithm.cpp
modules/gpu/test/test_arithm.cpp
+11
-11
modules/gpu/test/test_imgproc.cpp
modules/gpu/test/test_imgproc.cpp
+2
-2
未找到文件。
modules/gpu/include/opencv2/gpu/gpu.hpp
浏览文件 @
ed749c4b
...
...
@@ -539,32 +539,41 @@ namespace cv
//////////////////////////// Per-element operations ////////////////////////////////////
//! adds one matrix to another (c = a + b)
//! supports CV_8UC1, CV_8UC4, CV_32SC1, CV_32FC1 types
CV_EXPORTS
void
add
(
const
GpuMat
&
a
,
const
GpuMat
&
b
,
GpuMat
&
c
,
Stream
&
stream
=
Stream
::
Null
());
CV_EXPORTS
void
add
(
const
GpuMat
&
a
,
const
GpuMat
&
b
,
GpuMat
&
c
,
const
GpuMat
&
mask
=
GpuMat
(),
int
dtype
=
-
1
,
Stream
&
stream
=
Stream
::
Null
());
//! adds scalar to a matrix (c = a + s)
//! supports CV_32FC1 and CV_32FC2 type
CV_EXPORTS
void
add
(
const
GpuMat
&
a
,
const
Scalar
&
sc
,
GpuMat
&
c
,
Stream
&
stream
=
Stream
::
Null
());
CV_EXPORTS
void
add
(
const
GpuMat
&
a
,
const
Scalar
&
sc
,
GpuMat
&
c
,
const
GpuMat
&
mask
=
GpuMat
(),
int
dtype
=
-
1
,
Stream
&
stream
=
Stream
::
Null
());
//! subtracts one matrix from another (c = a - b)
//! supports CV_8UC1, CV_8UC4, CV_32SC1, CV_32FC1 types
CV_EXPORTS
void
subtract
(
const
GpuMat
&
a
,
const
GpuMat
&
b
,
GpuMat
&
c
,
Stream
&
stream
=
Stream
::
Null
());
CV_EXPORTS
void
subtract
(
const
GpuMat
&
a
,
const
GpuMat
&
b
,
GpuMat
&
c
,
const
GpuMat
&
mask
=
GpuMat
(),
int
dtype
=
-
1
,
Stream
&
stream
=
Stream
::
Null
());
//! subtracts scalar from a matrix (c = a - s)
//! supports CV_32FC1 and CV_32FC2 type
CV_EXPORTS
void
subtract
(
const
GpuMat
&
a
,
const
Scalar
&
sc
,
GpuMat
&
c
,
Stream
&
stream
=
Stream
::
Null
());
//! computes element-wise product of the two arrays (c = a * b)
//! supports CV_8UC1, CV_8UC4, CV_32SC1, CV_32FC1 types
CV_EXPORTS
void
multiply
(
const
GpuMat
&
a
,
const
GpuMat
&
b
,
GpuMat
&
c
,
Stream
&
stream
=
Stream
::
Null
());
//! multiplies matrix to a scalar (c = a * s)
//! supports CV_32FC1 type
CV_EXPORTS
void
multiply
(
const
GpuMat
&
a
,
const
Scalar
&
sc
,
GpuMat
&
c
,
Stream
&
stream
=
Stream
::
Null
());
//! computes element-wise quotient of the two arrays (c = a / b)
//! supports CV_8UC1, CV_8UC4, CV_32SC1, CV_32FC1 types
CV_EXPORTS
void
divide
(
const
GpuMat
&
a
,
const
GpuMat
&
b
,
GpuMat
&
c
,
Stream
&
stream
=
Stream
::
Null
());
//! computes element-wise quotient of matrix and scalar (c = a / s)
//! supports CV_32FC1 type
CV_EXPORTS
void
divide
(
const
GpuMat
&
a
,
const
Scalar
&
sc
,
GpuMat
&
c
,
Stream
&
stream
=
Stream
::
Null
());
CV_EXPORTS
void
subtract
(
const
GpuMat
&
a
,
const
Scalar
&
sc
,
GpuMat
&
c
,
const
GpuMat
&
mask
=
GpuMat
(),
int
dtype
=
-
1
,
Stream
&
stream
=
Stream
::
Null
());
//! computes element-wise weighted product of the two arrays (c = scale * a * b)
CV_EXPORTS
void
multiply
(
const
GpuMat
&
a
,
const
GpuMat
&
b
,
GpuMat
&
c
,
double
scale
=
1
,
int
dtype
=
-
1
,
Stream
&
stream
=
Stream
::
Null
());
//! weighted multiplies matrix to a scalar (c = scale * a * s)
CV_EXPORTS
void
multiply
(
const
GpuMat
&
a
,
const
Scalar
&
sc
,
GpuMat
&
c
,
double
scale
=
1
,
int
dtype
=
-
1
,
Stream
&
stream
=
Stream
::
Null
());
//! computes element-wise weighted quotient of the two arrays (c = a / b)
CV_EXPORTS
void
divide
(
const
GpuMat
&
a
,
const
GpuMat
&
b
,
GpuMat
&
c
,
double
scale
=
1
,
int
dtype
=
-
1
,
Stream
&
stream
=
Stream
::
Null
());
//! computes element-wise weighted quotient of matrix and scalar (c = a / s)
CV_EXPORTS
void
divide
(
const
GpuMat
&
a
,
const
Scalar
&
sc
,
GpuMat
&
c
,
double
scale
=
1
,
int
dtype
=
-
1
,
Stream
&
stream
=
Stream
::
Null
());
//! computes element-wise weighted reciprocal of an array (dst = scale/src2)
CV_EXPORTS
void
divide
(
double
scale
,
const
GpuMat
&
src2
,
GpuMat
&
dst
,
int
dtype
=
-
1
,
Stream
&
stream
=
Stream
::
Null
());
//! computes the weighted sum of two arrays (dst = alpha*src1 + beta*src2 + gamma)
CV_EXPORTS
void
addWeighted
(
const
GpuMat
&
src1
,
double
alpha
,
const
GpuMat
&
src2
,
double
beta
,
double
gamma
,
GpuMat
&
dst
,
int
dtype
=
-
1
,
Stream
&
stream
=
Stream
::
Null
());
//! adds scaled array to another one (dst = alpha*src1 + src2)
static
inline
void
scaleAdd
(
const
GpuMat
&
src1
,
double
alpha
,
const
GpuMat
&
src2
,
GpuMat
&
dst
,
Stream
&
stream
=
Stream
::
Null
())
{
addWeighted
(
src1
,
alpha
,
src2
,
1.0
,
0.0
,
dst
,
-
1
,
stream
);
}
//! computes element-wise absolute difference of two arrays (c = abs(a - b))
CV_EXPORTS
void
absdiff
(
const
GpuMat
&
a
,
const
GpuMat
&
b
,
GpuMat
&
c
,
Stream
&
stream
=
Stream
::
Null
());
//! computes element-wise absolute difference of array and scalar (c = abs(a - s))
CV_EXPORTS
void
absdiff
(
const
GpuMat
&
a
,
const
Scalar
&
s
,
GpuMat
&
c
,
Stream
&
stream
=
Stream
::
Null
());
//! computes exponent of each matrix element (b = e**a)
//! supports only CV_32FC1 type
...
...
@@ -580,13 +589,6 @@ namespace cv
//! supports only CV_32FC1 type
CV_EXPORTS
void
log
(
const
GpuMat
&
a
,
GpuMat
&
b
,
Stream
&
stream
=
Stream
::
Null
());
//! computes element-wise absolute difference of two arrays (c = abs(a - b))
//! supports CV_8UC1, CV_8UC4, CV_32SC1, CV_32FC1 types
CV_EXPORTS
void
absdiff
(
const
GpuMat
&
a
,
const
GpuMat
&
b
,
GpuMat
&
c
,
Stream
&
stream
=
Stream
::
Null
());
//! computes element-wise absolute difference of array and scalar (c = abs(a - s))
//! supports only CV_32FC1 type
CV_EXPORTS
void
absdiff
(
const
GpuMat
&
a
,
const
Scalar
&
s
,
GpuMat
&
c
,
Stream
&
stream
=
Stream
::
Null
());
//! compares elements of two arrays (c = a <cmpop> b)
//! supports CV_8UC4, CV_32FC1 types
CV_EXPORTS
void
compare
(
const
GpuMat
&
a
,
const
GpuMat
&
b
,
GpuMat
&
c
,
int
cmpop
,
Stream
&
stream
=
Stream
::
Null
());
...
...
@@ -615,10 +617,6 @@ namespace cv
//! computes per-element maximum of array and scalar (dst = max(src1, src2))
CV_EXPORTS
void
max
(
const
GpuMat
&
src1
,
double
src2
,
GpuMat
&
dst
,
Stream
&
stream
=
Stream
::
Null
());
//! computes the weighted sum of two arrays
CV_EXPORTS
void
addWeighted
(
const
GpuMat
&
src1
,
double
alpha
,
const
GpuMat
&
src2
,
double
beta
,
double
gamma
,
GpuMat
&
dst
,
int
dtype
=
-
1
,
Stream
&
stream
=
Stream
::
Null
());
////////////////////////////// Image processing //////////////////////////////
...
...
modules/gpu/src/cuda/element_operations.cu
浏览文件 @
ed749c4b
此差异已折叠。
点击以展开。
modules/gpu/src/element_operations.cpp
浏览文件 @
ed749c4b
此差异已折叠。
点击以展开。
modules/gpu/src/filtering.cpp
浏览文件 @
ed749c4b
...
...
@@ -639,17 +639,17 @@ void cv::gpu::morphologyEx(const GpuMat& src, GpuMat& dst, int op, const Mat& ke
case
CV_MOP_GRADIENT
:
erode
(
src
,
buf2
,
kernel
,
buf1
,
anchor
,
iterations
,
stream
);
dilate
(
src
,
dst
,
kernel
,
buf1
,
anchor
,
iterations
,
stream
);
subtract
(
dst
,
buf2
,
dst
,
stream
);
subtract
(
dst
,
buf2
,
dst
,
GpuMat
(),
-
1
,
stream
);
break
;
case
CV_MOP_TOPHAT
:
erode
(
src
,
dst
,
kernel
,
buf1
,
anchor
,
iterations
,
stream
);
dilate
(
dst
,
buf2
,
kernel
,
buf1
,
anchor
,
iterations
,
stream
);
subtract
(
src
,
buf2
,
dst
,
stream
);
subtract
(
src
,
buf2
,
dst
,
GpuMat
(),
-
1
,
stream
);
break
;
case
CV_MOP_BLACKHAT
:
dilate
(
src
,
dst
,
kernel
,
buf1
,
anchor
,
iterations
,
stream
);
erode
(
dst
,
buf2
,
kernel
,
buf1
,
anchor
,
iterations
,
stream
);
subtract
(
buf2
,
src
,
dst
,
stream
);
subtract
(
buf2
,
src
,
dst
,
GpuMat
(),
-
1
,
stream
);
break
;
default:
CV_Error
(
CV_StsBadArg
,
"unknown morphological operation"
);
...
...
modules/gpu/test/test_arithm.cpp
浏览文件 @
ed749c4b
...
...
@@ -96,7 +96,7 @@ TEST_P(AddArray, Accuracy)
INSTANTIATE_TEST_CASE_P
(
Arithm
,
AddArray
,
testing
::
Combine
(
testing
::
ValuesIn
(
devices
()),
testing
::
Values
(
CV_8UC1
,
CV_8UC4
,
CV_32SC1
,
CV_32FC1
)));
testing
::
Values
(
CV_8UC1
,
CV_8UC4
,
CV_
16UC1
,
CV_
32SC1
,
CV_32FC1
)));
struct
AddScalar
:
ArithmTest
{};
...
...
@@ -130,7 +130,7 @@ TEST_P(AddScalar, Accuracy)
INSTANTIATE_TEST_CASE_P
(
Arithm
,
AddScalar
,
testing
::
Combine
(
testing
::
ValuesIn
(
devices
()),
testing
::
Values
(
CV_32FC1
,
CV_32FC2
)));
testing
::
Values
(
CV_
8UC1
,
CV_16UC1
,
CV_32SC1
,
CV_
32FC1
,
CV_32FC2
)));
////////////////////////////////////////////////////////////////////////////////
// subtract
...
...
@@ -161,7 +161,7 @@ TEST_P(SubtractArray, Accuracy)
INSTANTIATE_TEST_CASE_P
(
Arithm
,
SubtractArray
,
testing
::
Combine
(
testing
::
ValuesIn
(
devices
()),
testing
::
Values
(
CV_8UC1
,
CV_8UC4
,
CV_32SC1
,
CV_32FC1
)));
testing
::
Values
(
CV_8UC1
,
CV_8UC4
,
CV_
16UC1
,
CV_
32SC1
,
CV_32FC1
)));
struct
SubtractScalar
:
ArithmTest
{};
...
...
@@ -195,7 +195,7 @@ TEST_P(SubtractScalar, Accuracy)
INSTANTIATE_TEST_CASE_P
(
Arithm
,
SubtractScalar
,
testing
::
Combine
(
testing
::
ValuesIn
(
devices
()),
testing
::
Values
(
CV_32FC1
,
CV_32FC2
)));
testing
::
Values
(
CV_
8UC1
,
CV_16UC1
,
CV_32SC1
,
CV_
32FC1
,
CV_32FC2
)));
////////////////////////////////////////////////////////////////////////////////
// multiply
...
...
@@ -226,7 +226,7 @@ TEST_P(MultiplyArray, Accuracy)
INSTANTIATE_TEST_CASE_P
(
Arithm
,
MultiplyArray
,
testing
::
Combine
(
testing
::
ValuesIn
(
devices
()),
testing
::
Values
(
CV_8UC1
,
CV_8UC4
,
CV_32SC1
,
CV_32FC1
)));
testing
::
Values
(
CV_8UC1
,
CV_8UC4
,
CV_
16UC1
,
CV_
32SC1
,
CV_32FC1
)));
struct
MultiplyScalar
:
ArithmTest
{};
...
...
@@ -260,7 +260,7 @@ TEST_P(MultiplyScalar, Accuracy)
INSTANTIATE_TEST_CASE_P
(
Arithm
,
MultiplyScalar
,
testing
::
Combine
(
testing
::
ValuesIn
(
devices
()),
testing
::
Values
(
CV_32FC1
)));
testing
::
Values
(
CV_
8UC1
,
CV_16UC1
,
CV_32SC1
,
CV_
32FC1
)));
////////////////////////////////////////////////////////////////////////////////
// divide
...
...
@@ -291,7 +291,7 @@ TEST_P(DivideArray, Accuracy)
INSTANTIATE_TEST_CASE_P
(
Arithm
,
DivideArray
,
testing
::
Combine
(
testing
::
ValuesIn
(
devices
()),
testing
::
Values
(
CV_8UC1
,
CV_8UC4
,
CV_32SC1
,
CV_32FC1
)));
testing
::
Values
(
CV_8UC1
,
CV_8UC4
,
CV_
16UC1
,
CV_
32SC1
,
CV_32FC1
)));
struct
DivideScalar
:
ArithmTest
{};
...
...
@@ -325,7 +325,7 @@ TEST_P(DivideScalar, Accuracy)
INSTANTIATE_TEST_CASE_P
(
Arithm
,
DivideScalar
,
testing
::
Combine
(
testing
::
ValuesIn
(
devices
()),
testing
::
Values
(
CV_32FC1
)));
testing
::
Values
(
CV_
8UC1
,
CV_16UC1
,
CV_32SC1
,
CV_
32FC1
)));
////////////////////////////////////////////////////////////////////////////////
// transpose
...
...
@@ -387,7 +387,7 @@ TEST_P(AbsdiffArray, Accuracy)
INSTANTIATE_TEST_CASE_P
(
Arithm
,
AbsdiffArray
,
testing
::
Combine
(
testing
::
ValuesIn
(
devices
()),
testing
::
Values
(
CV_8UC1
,
CV_8UC4
,
CV_32SC1
,
CV_32FC1
)));
testing
::
Values
(
CV_8UC1
,
CV_8UC4
,
CV_
16UC1
,
CV_
32SC1
,
CV_32FC1
)));
struct
AbsdiffScalar
:
ArithmTest
{};
...
...
@@ -421,7 +421,7 @@ TEST_P(AbsdiffScalar, Accuracy)
INSTANTIATE_TEST_CASE_P
(
Arithm
,
AbsdiffScalar
,
testing
::
Combine
(
testing
::
ValuesIn
(
devices
()),
testing
::
Values
(
CV_32FC1
)));
testing
::
Values
(
CV_
8UC1
,
CV_16UC1
,
CV_32SC1
,
CV_
32FC1
)));
////////////////////////////////////////////////////////////////////////////////
// compare
...
...
@@ -813,7 +813,7 @@ TEST_P(Pow, Accuracy)
/*std::cout << mat << std::endl << std::endl;
std::cout << dst << std::endl << std::endl;
std::cout << dst_gold << std::endl;*/
EXPECT_MAT_NEAR
(
dst_gold
,
dst
,
1
);
EXPECT_MAT_NEAR
(
dst_gold
,
dst
,
2
);
}
INSTANTIATE_TEST_CASE_P
(
Arithm
,
Pow
,
testing
::
Combine
(
...
...
modules/gpu/test/test_imgproc.cpp
浏览文件 @
ed749c4b
...
...
@@ -169,8 +169,8 @@ TEST_P(Resize, Accuracy)
gpuRes2
.
download
(
dst2
);
);
EXPECT_MAT_SIMILAR
(
dst_gold1
,
dst1
,
0.2
);
EXPECT_MAT_SIMILAR
(
dst_gold2
,
dst2
,
0.2
);
EXPECT_MAT_SIMILAR
(
dst_gold1
,
dst1
,
0.2
1
);
EXPECT_MAT_SIMILAR
(
dst_gold2
,
dst2
,
0.2
1
);
}
INSTANTIATE_TEST_CASE_P
(
ImgProc
,
Resize
,
testing
::
Combine
(
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录