Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Opencv
提交
fba70ca1
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,发现更多精彩内容 >>
提交
fba70ca1
编写于
8月 15, 2011
作者:
V
Vadim Pisarevsky
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fixed bug #1306 (Vec assignment); added tests for Vec & Matx multiplication
上级
58c0bea6
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
59 addition
and
10 deletion
+59
-10
modules/core/include/opencv2/core/core.hpp
modules/core/include/opencv2/core/core.hpp
+0
-1
modules/core/include/opencv2/core/operations.hpp
modules/core/include/opencv2/core/operations.hpp
+1
-9
modules/core/test/test_operations.cpp
modules/core/test/test_operations.cpp
+58
-0
未找到文件。
modules/core/include/opencv2/core/core.hpp
浏览文件 @
fba70ca1
...
...
@@ -592,7 +592,6 @@ public:
explicit
Vec
(
const
_Tp
*
values
);
Vec
(
const
Vec
<
_Tp
,
cn
>&
v
);
Vec
<
_Tp
,
cn
>&
operator
=
(
const
Matx
<
_Tp
,
cn
,
1
>&
m
);
static
Vec
all
(
_Tp
alpha
);
...
...
modules/core/include/opencv2/core/operations.hpp
浏览文件 @
fba70ca1
...
...
@@ -1038,15 +1038,7 @@ template<typename _Tp, int cn> template<typename _T2> inline
Vec
<
_Tp
,
cn
>::
Vec
(
const
Matx
<
_Tp
,
cn
,
1
>&
a
,
_T2
alpha
,
Matx_ScaleOp
op
)
:
Matx
<
_Tp
,
cn
,
1
>
(
a
,
alpha
,
op
)
{}
template
<
typename
_Tp
,
int
cn
>
inline
Vec
<
_Tp
,
cn
>&
Vec
<
_Tp
,
cn
>::
operator
=
(
const
Matx
<
_Tp
,
cn
,
1
>&
m
)
{
for
(
int
i
=
0
;
i
<
cn
;
i
++
)
this
->
val
[
i
]
=
m
.
val
[
i
];
return
*
this
;
}
template
<
typename
_Tp
,
int
cn
>
inline
Vec
<
_Tp
,
cn
>
Vec
<
_Tp
,
cn
>::
all
(
_Tp
alpha
)
{
Vec
v
;
...
...
modules/core/test/test_operations.cpp
浏览文件 @
fba70ca1
...
...
@@ -72,6 +72,8 @@ protected:
bool
TestTemplateMat
();
bool
TestMatND
();
bool
TestSparseMat
();
bool
TestVec
();
bool
TestMatxMultiplication
();
bool
operations1
();
void
checkDiff
(
const
Mat
&
m1
,
const
Mat
&
m2
,
const
string
&
s
)
{
if
(
norm
(
m1
,
m2
,
NORM_INF
)
!=
0
)
throw
test_excep
(
s
);
}
...
...
@@ -747,6 +749,56 @@ bool CV_OperationsTest::TestSparseMat()
return
true
;
}
bool
CV_OperationsTest
::
TestMatxMultiplication
()
{
try
{
Matx33f
mat
(
1
,
0
,
0
,
0
,
1
,
0
,
0
,
0
,
1
);
// Identity matrix
Point2f
pt
(
3
,
4
);
Point3f
res
=
mat
*
pt
;
// Correctly assumes homogeneous coordinates
if
(
res
.
x
!=
3.0
)
throw
test_excep
();
if
(
res
.
y
!=
4.0
)
throw
test_excep
();
if
(
res
.
z
!=
1.0
)
throw
test_excep
();
}
catch
(
const
test_excep
&
)
{
ts
->
set_failed_test_info
(
cvtest
::
TS
::
FAIL_INVALID_OUTPUT
);
return
false
;
}
return
true
;
}
bool
CV_OperationsTest
::
TestVec
()
{
try
{
cv
::
Mat
hsvImage_f
(
5
,
5
,
CV_32FC3
),
hsvImage_b
(
5
,
5
,
CV_8UC3
);
int
i
=
0
,
j
=
0
;
cv
::
Vec3f
a
;
//these compile
cv
::
Vec3b
b
=
a
;
hsvImage_f
.
at
<
cv
::
Vec3f
>
(
i
,
j
)
=
cv
::
Vec3f
(
i
,
0
,
1
);
hsvImage_b
.
at
<
cv
::
Vec3b
>
(
i
,
j
)
=
cv
::
Vec3b
(
cv
::
Vec3f
(
i
,
0
,
1
));
//these don't
b
=
cv
::
Vec3f
(
1
,
0
,
0
);
cv
::
Vec3b
c
;
c
=
cv
::
Vec3f
(
0
,
0
,
1
);
hsvImage_b
.
at
<
cv
::
Vec3b
>
(
i
,
j
)
=
cv
::
Vec3f
(
i
,
0
,
1
);
hsvImage_b
.
at
<
cv
::
Vec3b
>
(
i
,
j
)
=
a
;
hsvImage_b
.
at
<
cv
::
Vec3b
>
(
i
,
j
)
=
cv
::
Vec3f
(
1
,
2
,
3
);
}
catch
(
const
test_excep
&
)
{
ts
->
set_failed_test_info
(
cvtest
::
TS
::
FAIL_INVALID_OUTPUT
);
return
false
;
}
return
true
;
}
bool
CV_OperationsTest
::
operations1
()
{
try
...
...
@@ -819,6 +871,12 @@ void CV_OperationsTest::run( int /* start_from */)
if
(
!
TestSparseMat
())
return
;
if
(
!
TestVec
())
return
;
if
(
!
TestMatxMultiplication
())
return
;
if
(
!
operations1
())
return
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录