Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Opencv
提交
16fcd78f
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,发现更多精彩内容 >>
提交
16fcd78f
编写于
9月 04, 2015
作者:
P
Pavel Rojtberg
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add sampson distance error measure
the first order approximation of the geometric error
上级
c4edd86a
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
31 addition
and
0 deletion
+31
-0
modules/calib3d/include/opencv2/calib3d.hpp
modules/calib3d/include/opencv2/calib3d.hpp
+11
-0
modules/calib3d/src/fundam.cpp
modules/calib3d/src/fundam.cpp
+20
-0
未找到文件。
modules/calib3d/include/opencv2/calib3d.hpp
浏览文件 @
16fcd78f
...
...
@@ -1403,6 +1403,17 @@ CV_EXPORTS_W void reprojectImageTo3D( InputArray disparity,
bool
handleMissingValues
=
false
,
int
ddepth
=
-
1
);
/** @brief Calculates the Sampson Distance between two points.
The function sampsonDistance calculates and returns the first order approximation of the geometric error as:
\f[sd( \texttt{pt1} , \texttt{pt2} )= \frac{(\texttt{pt2}^t \cdot \texttt{F} \cdot \texttt{pt1})^2}{(\texttt{F} \cdot \texttt{pt1})(0) + (\texttt{F} \cdot \texttt{pt1})(1) + (\texttt{F}^t \cdot \texttt{pt2})(0) + (\texttt{F}^t \cdot \texttt{pt2})(1)}\f]
The fundamental matrix may be calculated using the cv::findFundamentalMat function. See HZ 11.4.3 for details.
@param pt1 first homogeneous 2d point
@param pt2 second homogeneous 2d point
@param F fundamental matrix
*/
CV_EXPORTS_W
double
sampsonDistance
(
InputArray
pt1
,
InputArray
pt2
,
InputArray
F
);
/** @brief Computes an optimal affine transformation between two 3D point sets.
@param src First input 3D point set.
...
...
modules/calib3d/src/fundam.cpp
浏览文件 @
16fcd78f
...
...
@@ -1039,4 +1039,24 @@ void cv::convertPointsHomogeneous( InputArray _src, OutputArray _dst )
convertPointsToHomogeneous
(
_src
,
_dst
);
}
double
cv
::
sampsonDistance
(
InputArray
_pt1
,
InputArray
_pt2
,
InputArray
_F
)
{
CV_Assert
(
_pt1
.
type
()
==
CV_64F
&&
_pt1
.
type
()
==
CV_64F
&&
_F
.
type
()
==
CV_64F
);
CV_DbgAssert
(
_pt1
.
rows
()
==
3
&&
_F
.
size
()
==
Size
(
3
,
3
)
&&
_pt1
.
rows
()
==
_pt2
.
rows
());
Mat
pt1
(
_pt1
.
getMat
());
Mat
pt2
(
_pt2
.
getMat
());
Mat
F
(
_F
.
getMat
());
Vec3d
F_pt1
=
*
F
.
ptr
<
Matx33d
>
()
*
*
pt1
.
ptr
<
Vec3d
>
();
Vec3d
Ft_pt2
=
F
.
ptr
<
Matx33d
>
()
->
t
()
*
*
pt2
.
ptr
<
Vec3d
>
();
double
v
=
pt2
.
ptr
<
Vec3d
>
()
->
dot
(
F_pt1
);
// square
Ft_pt2
=
Ft_pt2
.
mul
(
Ft_pt2
);
F_pt1
=
F_pt1
.
mul
(
F_pt1
);
return
v
*
v
/
(
F_pt1
[
0
]
+
F_pt1
[
1
]
+
Ft_pt2
[
0
]
+
Ft_pt2
[
1
]);
}
/* End of file. */
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录