Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Opencv
提交
796553d0
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,发现更多精彩内容 >>
提交
796553d0
编写于
7月 07, 2010
作者:
V
Vadim Pisarevsky
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
added some quaternion operations on Scalar's.
上级
609ad4e4
变更
3
显示空白变更内容
内联
并排
Showing
3 changed file
with
143 addition
and
1 deletion
+143
-1
modules/core/include/opencv2/core/core.hpp
modules/core/include/opencv2/core/core.hpp
+5
-0
modules/core/include/opencv2/core/operations.hpp
modules/core/include/opencv2/core/operations.hpp
+137
-0
modules/features2d/src/detectors.cpp
modules/features2d/src/detectors.cpp
+1
-1
未找到文件。
modules/core/include/opencv2/core/core.hpp
浏览文件 @
796553d0
...
...
@@ -448,6 +448,9 @@ public:
_Tp
dot
(
const
Vec
&
v
)
const
;
//! dot product computed in double-precision arithmetics
double
ddot
(
const
Vec
&
v
)
const
;
//! per-element multiplication
Vec
mul
(
const
Vec
<
_Tp
,
cn
>&
v
)
const
;
/*!
cross product of the two 3D vectors.
...
...
@@ -924,6 +927,8 @@ public:
Scalar_
<
_Tp
>
mul
(
const
Scalar_
<
_Tp
>&
t
,
double
scale
=
1
)
const
;
//! another helper conversion method. \see cvScalarToRawData
template
<
typename
T2
>
void
convertTo
(
T2
*
buf
,
int
channels
,
int
unroll_to
=
0
)
const
;
Scalar_
<
_Tp
>
conj
()
const
;
};
typedef
Scalar_
<
double
>
Scalar
;
...
...
modules/core/include/opencv2/core/operations.hpp
浏览文件 @
796553d0
...
...
@@ -321,6 +321,14 @@ template<typename _Tp, int cn> inline double Vec<_Tp, cn>::ddot(const Vec<_Tp, c
}
template
<
typename
_Tp
,
int
cn
>
inline
Vec
<
_Tp
,
cn
>
Vec
<
_Tp
,
cn
>::
mul
(
const
Vec
<
_Tp
,
cn
>&
v
)
const
{
Vec
<
_Tp
,
cn
>
w
;
for
(
int
i
=
0
;
i
<
cn
;
i
++
)
w
.
val
[
i
]
=
saturate_cast
<
_Tp
>
(
val
[
i
]
*
v
.
val
[
i
]);
return
w
;
}
template
<
typename
_Tp
,
int
cn
>
inline
Vec
<
_Tp
,
cn
>
Vec
<
_Tp
,
cn
>::
cross
(
const
Vec
<
_Tp
,
cn
>&
v
)
const
{
CV_Error
(
CV_StsError
,
"for arbitrary-size vector there is no cross-product defined"
);
...
...
@@ -439,6 +447,25 @@ operator * (_Tp alpha, const Vec<_Tp, cn>& a)
return
a
*
alpha
;
}
template
<
typename
_Tp
>
static
inline
Vec
<
_Tp
,
4
>
operator
*
(
const
Vec
<
_Tp
,
4
>&
a
,
const
Vec
<
_Tp
,
4
>&
b
)
{
return
Vec
<
_Tp
,
4
>
(
saturate_cast
<
_Tp
>
(
a
[
0
]
*
b
[
0
]
-
a
[
1
]
*
b
[
1
]
-
a
[
2
]
*
b
[
2
]
-
a
[
3
]
*
b
[
3
]),
saturate_cast
<
_Tp
>
(
a
[
0
]
*
b
[
1
]
+
a
[
1
]
*
b
[
0
]
+
a
[
2
]
*
b
[
3
]
-
a
[
3
]
*
b
[
2
]),
saturate_cast
<
_Tp
>
(
a
[
0
]
*
b
[
2
]
-
a
[
1
]
*
b
[
3
]
+
a
[
2
]
*
b
[
0
]
-
a
[
3
]
*
b
[
1
]),
saturate_cast
<
_Tp
>
(
a
[
0
]
*
b
[
3
]
+
a
[
1
]
*
b
[
2
]
-
a
[
2
]
*
b
[
1
]
-
a
[
3
]
*
b
[
0
]));
}
template
<
typename
_Tp
>
static
inline
Vec
<
_Tp
,
4
>&
operator
*=
(
Vec
<
_Tp
,
4
>&
a
,
const
Vec
<
_Tp
,
4
>&
b
)
{
a
=
a
*
b
;
return
a
;
}
template
<
typename
_Tp
,
int
cn
>
static
inline
Vec
<
_Tp
,
cn
>
operator
-
(
const
Vec
<
_Tp
,
cn
>&
a
)
{
...
...
@@ -971,6 +998,41 @@ Vec<_Tp, m> operator * (const Matx<_Tp, m, n>& a, const Vec<_Tp, n>& b)
}
template
<
typename
_Tp
>
static
inline
Point_
<
_Tp
>
operator
*
(
const
Matx
<
_Tp
,
2
,
2
>&
a
,
const
Point_
<
_Tp
>&
b
)
{
return
Point_
<
_Tp
>
(
a
*
Vec
<
_Tp
,
2
>
(
b
));
}
template
<
typename
_Tp
>
static
inline
Point3_
<
_Tp
>
operator
*
(
const
Matx
<
_Tp
,
3
,
3
>&
a
,
const
Point3_
<
_Tp
>&
b
)
{
return
Point3_
<
_Tp
>
(
a
*
Vec
<
_Tp
,
3
>
(
b
));
}
template
<
typename
_Tp
>
static
inline
Point3_
<
_Tp
>
operator
*
(
const
Matx
<
_Tp
,
3
,
3
>&
a
,
const
Point_
<
_Tp
>&
b
)
{
return
Point3_
<
_Tp
>
(
a
*
Vec
<
_Tp
,
3
>
(
b
.
x
,
b
.
y
,
1
));
}
template
<
typename
_Tp
>
static
inline
Vec
<
_Tp
,
4
>
operator
*
(
const
Matx
<
_Tp
,
4
,
4
>&
a
,
const
Point3_
<
_Tp
>&
b
)
{
return
a
*
Vec
<
_Tp
,
4
>
(
b
.
x
,
b
.
y
,
b
.
z
,
1
);
}
template
<
typename
_Tp
>
static
inline
Scalar
operator
*
(
const
Matx
<
_Tp
,
4
,
4
>&
a
,
const
Scalar
&
b
)
{
return
Scalar
(
a
*
Vec
<
_Tp
,
4
>
(
b
));
}
template
<
typename
_Tp
,
int
m
,
int
n
>
inline
Matx
<
_Tp
,
m
,
n
>
Matx
<
_Tp
,
m
,
n
>::
mul
(
const
Matx
<
_Tp
,
m
,
n
>&
a
)
const
{
...
...
@@ -1909,6 +1971,81 @@ template<typename _Tp> static inline Scalar_<_Tp> operator - (const Scalar_<_Tp>
saturate_cast
<
_Tp
>
(
-
a
.
val
[
2
]),
saturate_cast
<
_Tp
>
(
-
a
.
val
[
3
]));
}
template
<
typename
_Tp
>
static
inline
Scalar_
<
_Tp
>
operator
*
(
const
Scalar_
<
_Tp
>&
a
,
const
Scalar_
<
_Tp
>&
b
)
{
return
Scalar_
<
_Tp
>
(
saturate_cast
<
_Tp
>
(
a
[
0
]
*
b
[
0
]
-
a
[
1
]
*
b
[
1
]
-
a
[
2
]
*
b
[
2
]
-
a
[
3
]
*
b
[
3
]),
saturate_cast
<
_Tp
>
(
a
[
0
]
*
b
[
1
]
+
a
[
1
]
*
b
[
0
]
+
a
[
2
]
*
b
[
3
]
-
a
[
3
]
*
b
[
2
]),
saturate_cast
<
_Tp
>
(
a
[
0
]
*
b
[
2
]
-
a
[
1
]
*
b
[
3
]
+
a
[
2
]
*
b
[
0
]
-
a
[
3
]
*
b
[
1
]),
saturate_cast
<
_Tp
>
(
a
[
0
]
*
b
[
3
]
+
a
[
1
]
*
b
[
2
]
-
a
[
2
]
*
b
[
1
]
-
a
[
3
]
*
b
[
0
]));
}
template
<
typename
_Tp
>
static
inline
Scalar_
<
_Tp
>&
operator
*=
(
Scalar_
<
_Tp
>&
a
,
const
Scalar_
<
_Tp
>&
b
)
{
a
=
a
*
b
;
return
a
;
}
template
<
typename
_Tp
>
inline
Scalar_
<
_Tp
>
Scalar_
<
_Tp
>::
conj
()
const
{
return
Scalar_
<
_Tp
>
(
saturate_cast
<
_Tp
>
(
this
->
val
[
0
]),
saturate_cast
<
_Tp
>
(
-
this
->
val
[
1
]),
saturate_cast
<
_Tp
>
(
-
this
->
val
[
2
]),
saturate_cast
<
_Tp
>
(
-
this
->
val
[
3
]));
}
template
<
typename
_Tp
>
static
inline
Scalar_
<
_Tp
>
operator
/
(
const
Scalar_
<
_Tp
>&
a
,
_Tp
alpha
)
{
return
Scalar_
<
_Tp
>
(
saturate_cast
<
_Tp
>
(
a
.
val
[
0
]
/
alpha
),
saturate_cast
<
_Tp
>
(
a
.
val
[
1
]
/
alpha
),
saturate_cast
<
_Tp
>
(
a
.
val
[
2
]
/
alpha
),
saturate_cast
<
_Tp
>
(
a
.
val
[
3
]
/
alpha
));
}
template
<
>
static
inline
Scalar_
<
float
>
operator
/
(
const
Scalar_
<
float
>&
a
,
float
alpha
)
{
float
s
=
1
/
alpha
;
return
Scalar_
<
float
>
(
a
.
val
[
0
]
*
s
,
a
.
val
[
1
]
*
s
,
a
.
val
[
2
]
*
s
,
a
.
val
[
3
]
*
s
);
}
template
<
>
static
inline
Scalar_
<
double
>
operator
/
(
const
Scalar_
<
double
>&
a
,
double
alpha
)
{
double
s
=
1
/
alpha
;
return
Scalar_
<
double
>
(
a
.
val
[
0
]
*
s
,
a
.
val
[
1
]
*
s
,
a
.
val
[
2
]
*
s
,
a
.
val
[
3
]
*
s
);
}
template
<
typename
_Tp
>
static
inline
Scalar_
<
_Tp
>&
operator
/=
(
Scalar_
<
_Tp
>&
a
,
_Tp
alpha
)
{
a
=
a
/
alpha
;
return
a
;
}
template
<
typename
_Tp
>
static
inline
Scalar_
<
_Tp
>
operator
/
(
_Tp
a
,
const
Scalar_
<
_Tp
>&
b
)
{
_Tp
s
=
a
/
(
b
[
0
]
*
b
[
0
]
+
b
[
1
]
*
b
[
1
]
+
b
[
2
]
*
b
[
2
]
+
b
[
3
]
*
b
[
3
]);
return
b
.
conj
()
*
s
;
}
template
<
typename
_Tp
>
static
inline
Scalar_
<
_Tp
>
operator
/
(
const
Scalar_
<
_Tp
>&
a
,
const
Scalar_
<
_Tp
>&
b
)
{
return
a
*
((
_Tp
)
1
/
b
);
}
template
<
typename
_Tp
>
static
inline
Scalar_
<
_Tp
>&
operator
/=
(
Scalar_
<
_Tp
>&
a
,
const
Scalar_
<
_Tp
>&
b
)
{
a
=
a
/
b
;
return
a
;
}
//////////////////////////////// Range /////////////////////////////////
inline
Range
::
Range
()
:
start
(
0
),
end
(
0
)
{}
...
...
modules/features2d/src/detectors.cpp
浏览文件 @
796553d0
...
...
@@ -52,7 +52,7 @@ struct MaskPredicate
{
MaskPredicate
(
const
Mat
&
_mask
)
:
mask
(
_mask
)
{}
MaskPredicate
&
operator
=
(
const
MaskPredicate
&
)
{}
MaskPredicate
&
operator
=
(
const
MaskPredicate
&
)
{
return
*
this
;
}
bool
operator
()
(
const
KeyPoint
&
key_pt
)
const
{
return
mask
.
at
<
uchar
>
(
(
int
)(
key_pt
.
pt
.
y
+
0.5
f
),
(
int
)(
key_pt
.
pt
.
x
+
0.5
f
)
)
==
0
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录