Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Opencv
提交
75c99d65
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,发现更多精彩内容 >>
提交
75c99d65
编写于
1月 09, 2015
作者:
J
Josep Bosch
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fisheye calibration methods available now in python
上级
28833421
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
24 addition
and
12 deletion
+24
-12
modules/calib3d/include/opencv2/calib3d.hpp
modules/calib3d/include/opencv2/calib3d.hpp
+10
-10
modules/calib3d/src/fisheye.cpp
modules/calib3d/src/fisheye.cpp
+14
-2
未找到文件。
modules/calib3d/include/opencv2/calib3d.hpp
浏览文件 @
75c99d65
...
@@ -1651,7 +1651,7 @@ namespace fisheye
...
@@ -1651,7 +1651,7 @@ namespace fisheye
InputArray
K
,
InputArray
D
,
double
alpha
=
0
,
OutputArray
jacobian
=
noArray
());
InputArray
K
,
InputArray
D
,
double
alpha
=
0
,
OutputArray
jacobian
=
noArray
());
/** @overload */
/** @overload */
CV_EXPORTS
void
projectPoints
(
InputArray
objectPoints
,
OutputArray
imagePoints
,
InputArray
rvec
,
InputArray
tvec
,
CV_EXPORTS
_W
void
projectPoints
(
InputArray
objectPoints
,
OutputArray
imagePoints
,
InputArray
rvec
,
InputArray
tvec
,
InputArray
K
,
InputArray
D
,
double
alpha
=
0
,
OutputArray
jacobian
=
noArray
());
InputArray
K
,
InputArray
D
,
double
alpha
=
0
,
OutputArray
jacobian
=
noArray
());
/** @brief Distorts 2D points using fisheye model.
/** @brief Distorts 2D points using fisheye model.
...
@@ -1663,7 +1663,7 @@ namespace fisheye
...
@@ -1663,7 +1663,7 @@ namespace fisheye
@param alpha The skew coefficient.
@param alpha The skew coefficient.
@param distorted Output array of image points, 1xN/Nx1 2-channel, or vector\<Point2f\> .
@param distorted Output array of image points, 1xN/Nx1 2-channel, or vector\<Point2f\> .
*/
*/
CV_EXPORTS
void
distortPoints
(
InputArray
undistorted
,
OutputArray
distorted
,
InputArray
K
,
InputArray
D
,
double
alpha
=
0
);
CV_EXPORTS
_W
void
distortPoints
(
InputArray
undistorted
,
OutputArray
distorted
,
InputArray
K
,
InputArray
D
,
double
alpha
=
0
);
/** @brief Undistorts 2D points using fisheye model
/** @brief Undistorts 2D points using fisheye model
...
@@ -1676,7 +1676,7 @@ namespace fisheye
...
@@ -1676,7 +1676,7 @@ namespace fisheye
@param P New camera matrix (3x3) or new projection matrix (3x4)
@param P New camera matrix (3x3) or new projection matrix (3x4)
@param undistorted Output array of image points, 1xN/Nx1 2-channel, or vector\<Point2f\> .
@param undistorted Output array of image points, 1xN/Nx1 2-channel, or vector\<Point2f\> .
*/
*/
CV_EXPORTS
void
undistortPoints
(
InputArray
distorted
,
OutputArray
undistorted
,
CV_EXPORTS
_W
void
undistortPoints
(
InputArray
distorted
,
OutputArray
undistorted
,
InputArray
K
,
InputArray
D
,
InputArray
R
=
noArray
(),
InputArray
P
=
noArray
());
InputArray
K
,
InputArray
D
,
InputArray
R
=
noArray
(),
InputArray
P
=
noArray
());
/** @brief Computes undistortion and rectification maps for image transform by cv::remap(). If D is empty zero
/** @brief Computes undistortion and rectification maps for image transform by cv::remap(). If D is empty zero
...
@@ -1693,7 +1693,7 @@ namespace fisheye
...
@@ -1693,7 +1693,7 @@ namespace fisheye
@param map1 The first output map.
@param map1 The first output map.
@param map2 The second output map.
@param map2 The second output map.
*/
*/
CV_EXPORTS
void
initUndistortRectifyMap
(
InputArray
K
,
InputArray
D
,
InputArray
R
,
InputArray
P
,
CV_EXPORTS
_W
void
initUndistortRectifyMap
(
InputArray
K
,
InputArray
D
,
InputArray
R
,
InputArray
P
,
const
cv
::
Size
&
size
,
int
m1type
,
OutputArray
map1
,
OutputArray
map2
);
const
cv
::
Size
&
size
,
int
m1type
,
OutputArray
map1
,
OutputArray
map2
);
/** @brief Transforms an image to compensate for fisheye lens distortion.
/** @brief Transforms an image to compensate for fisheye lens distortion.
...
@@ -1724,7 +1724,7 @@ namespace fisheye
...
@@ -1724,7 +1724,7 @@ namespace fisheye
![image](pics/fisheye_undistorted.jpg)
![image](pics/fisheye_undistorted.jpg)
*/
*/
CV_EXPORTS
void
undistortImage
(
InputArray
distorted
,
OutputArray
undistorted
,
CV_EXPORTS
_W
void
undistortImage
(
InputArray
distorted
,
OutputArray
undistorted
,
InputArray
K
,
InputArray
D
,
InputArray
Knew
=
cv
::
noArray
(),
const
Size
&
new_size
=
Size
());
InputArray
K
,
InputArray
D
,
InputArray
Knew
=
cv
::
noArray
(),
const
Size
&
new_size
=
Size
());
/** @brief Estimates new camera matrix for undistortion or rectification.
/** @brief Estimates new camera matrix for undistortion or rectification.
...
@@ -1740,7 +1740,7 @@ namespace fisheye
...
@@ -1740,7 +1740,7 @@ namespace fisheye
@param new_size
@param new_size
@param fov_scale Divisor for new focal length.
@param fov_scale Divisor for new focal length.
*/
*/
CV_EXPORTS
void
estimateNewCameraMatrixForUndistortRectify
(
InputArray
K
,
InputArray
D
,
const
Size
&
image_size
,
InputArray
R
,
CV_EXPORTS
_W
void
estimateNewCameraMatrixForUndistortRectify
(
InputArray
K
,
InputArray
D
,
const
Size
&
image_size
,
InputArray
R
,
OutputArray
P
,
double
balance
=
0.0
,
const
Size
&
new_size
=
Size
(),
double
fov_scale
=
1.0
);
OutputArray
P
,
double
balance
=
0.0
,
const
Size
&
new_size
=
Size
(),
double
fov_scale
=
1.0
);
/** @brief Performs camera calibaration
/** @brief Performs camera calibaration
...
@@ -1774,7 +1774,7 @@ namespace fisheye
...
@@ -1774,7 +1774,7 @@ namespace fisheye
zero.
zero.
@param criteria Termination criteria for the iterative optimization algorithm.
@param criteria Termination criteria for the iterative optimization algorithm.
*/
*/
CV_EXPORTS
double
calibrate
(
InputArrayOfArrays
objectPoints
,
InputArrayOfArrays
imagePoints
,
const
Size
&
image_size
,
CV_EXPORTS
_W
double
calibrate
(
InputArrayOfArrays
objectPoints
,
InputArrayOfArrays
imagePoints
,
const
Size
&
image_size
,
InputOutputArray
K
,
InputOutputArray
D
,
OutputArrayOfArrays
rvecs
,
OutputArrayOfArrays
tvecs
,
int
flags
=
0
,
InputOutputArray
K
,
InputOutputArray
D
,
OutputArrayOfArrays
rvecs
,
OutputArrayOfArrays
tvecs
,
int
flags
=
0
,
TermCriteria
criteria
=
TermCriteria
(
TermCriteria
::
COUNT
+
TermCriteria
::
EPS
,
100
,
DBL_EPSILON
));
TermCriteria
criteria
=
TermCriteria
(
TermCriteria
::
COUNT
+
TermCriteria
::
EPS
,
100
,
DBL_EPSILON
));
...
@@ -1808,7 +1808,7 @@ namespace fisheye
...
@@ -1808,7 +1808,7 @@ namespace fisheye
length. Balance is in range of [0, 1].
length. Balance is in range of [0, 1].
@param fov_scale Divisor for new focal length.
@param fov_scale Divisor for new focal length.
*/
*/
CV_EXPORTS
void
stereoRectify
(
InputArray
K1
,
InputArray
D1
,
InputArray
K2
,
InputArray
D2
,
const
Size
&
imageSize
,
InputArray
R
,
InputArray
tvec
,
CV_EXPORTS
_W
void
stereoRectify
(
InputArray
K1
,
InputArray
D1
,
InputArray
K2
,
InputArray
D2
,
const
Size
&
imageSize
,
InputArray
R
,
InputArray
tvec
,
OutputArray
R1
,
OutputArray
R2
,
OutputArray
P1
,
OutputArray
P2
,
OutputArray
Q
,
int
flags
,
const
Size
&
newImageSize
=
Size
(),
OutputArray
R1
,
OutputArray
R2
,
OutputArray
P1
,
OutputArray
P2
,
OutputArray
Q
,
int
flags
,
const
Size
&
newImageSize
=
Size
(),
double
balance
=
0.0
,
double
fov_scale
=
1.0
);
double
balance
=
0.0
,
double
fov_scale
=
1.0
);
...
@@ -1844,9 +1844,9 @@ namespace fisheye
...
@@ -1844,9 +1844,9 @@ namespace fisheye
zero.
zero.
@param criteria Termination criteria for the iterative optimization algorithm.
@param criteria Termination criteria for the iterative optimization algorithm.
*/
*/
CV_EXPORTS
double
stereoCalibrate
(
InputArrayOfArrays
objectPoints
,
InputArrayOfArrays
imagePoints1
,
InputArrayOfArrays
imagePoints2
,
CV_EXPORTS
_W
double
stereoCalibrate
(
InputArrayOfArrays
objectPoints
,
InputArrayOfArrays
imagePoints1
,
InputArrayOfArrays
imagePoints2
,
InputOutputArray
K1
,
InputOutputArray
D1
,
InputOutputArray
K2
,
InputOutputArray
D2
,
Size
imageSize
,
InputOutputArray
K1
,
InputOutputArray
D1
,
InputOutputArray
K2
,
InputOutputArray
D2
,
Size
imageSize
,
OutputArray
R
,
OutputArray
T
,
int
flags
=
CALIB_FIX_INTRINSIC
,
OutputArray
R
,
OutputArray
T
,
int
flags
=
fisheye
::
CALIB_FIX_INTRINSIC
,
TermCriteria
criteria
=
TermCriteria
(
TermCriteria
::
COUNT
+
TermCriteria
::
EPS
,
100
,
DBL_EPSILON
));
TermCriteria
criteria
=
TermCriteria
(
TermCriteria
::
COUNT
+
TermCriteria
::
EPS
,
100
,
DBL_EPSILON
));
//! @} calib3d_fisheye
//! @} calib3d_fisheye
...
...
modules/calib3d/src/fisheye.cpp
浏览文件 @
75c99d65
...
@@ -794,8 +794,20 @@ double cv::fisheye::calibrate(InputArrayOfArrays objectPoints, InputArrayOfArray
...
@@ -794,8 +794,20 @@ double cv::fisheye::calibrate(InputArrayOfArrays objectPoints, InputArrayOfArray
if
(
K
.
needed
())
cv
::
Mat
(
_K
).
convertTo
(
K
,
K
.
empty
()
?
CV_64FC1
:
K
.
type
());
if
(
K
.
needed
())
cv
::
Mat
(
_K
).
convertTo
(
K
,
K
.
empty
()
?
CV_64FC1
:
K
.
type
());
if
(
D
.
needed
())
cv
::
Mat
(
finalParam
.
k
).
convertTo
(
D
,
D
.
empty
()
?
CV_64FC1
:
D
.
type
());
if
(
D
.
needed
())
cv
::
Mat
(
finalParam
.
k
).
convertTo
(
D
,
D
.
empty
()
?
CV_64FC1
:
D
.
type
());
if
(
rvecs
.
kind
()
==
_InputArray
::
STD_VECTOR_MAT
)
{
int
i
;
for
(
i
=
0
;
i
<
(
int
)
objectPoints
.
total
();
i
++
)
{
rvecs
.
getMat
(
i
)
=
omc
[
i
];
tvecs
.
getMat
(
i
)
=
Tc
[
i
];
}
}
else
{
if
(
rvecs
.
needed
())
cv
::
Mat
(
omc
).
convertTo
(
rvecs
,
rvecs
.
empty
()
?
CV_64FC3
:
rvecs
.
type
());
if
(
rvecs
.
needed
())
cv
::
Mat
(
omc
).
convertTo
(
rvecs
,
rvecs
.
empty
()
?
CV_64FC3
:
rvecs
.
type
());
if
(
tvecs
.
needed
())
cv
::
Mat
(
Tc
).
convertTo
(
tvecs
,
tvecs
.
empty
()
?
CV_64FC3
:
tvecs
.
type
());
if
(
tvecs
.
needed
())
cv
::
Mat
(
Tc
).
convertTo
(
tvecs
,
tvecs
.
empty
()
?
CV_64FC3
:
tvecs
.
type
());
}
return
rms
;
return
rms
;
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录