Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Opencv
提交
c7f6c0cb
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,发现更多精彩内容 >>
提交
c7f6c0cb
编写于
8月 11, 2014
作者:
E
edgarriba
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fixed warnings + RANSAC confidence to double
上级
213241c0
变更
10
隐藏空白更改
内联
并排
Showing
10 changed file
with
22 addition
and
22 deletion
+22
-22
modules/calib3d/doc/camera_calibration_and_3d_reconstruction.rst
.../calib3d/doc/camera_calibration_and_3d_reconstruction.rst
+1
-1
modules/calib3d/include/opencv2/calib3d.hpp
modules/calib3d/include/opencv2/calib3d.hpp
+1
-1
modules/calib3d/src/solvepnp.cpp
modules/calib3d/src/solvepnp.cpp
+1
-1
samples/cpp/tutorial_code/calib3d/real_time_pose_estimation/src/CsvReader.cpp
..._code/calib3d/real_time_pose_estimation/src/CsvReader.cpp
+3
-3
samples/cpp/tutorial_code/calib3d/real_time_pose_estimation/src/Mesh.cpp
...orial_code/calib3d/real_time_pose_estimation/src/Mesh.cpp
+2
-2
samples/cpp/tutorial_code/calib3d/real_time_pose_estimation/src/PnPProblem.cpp
...code/calib3d/real_time_pose_estimation/src/PnPProblem.cpp
+5
-5
samples/cpp/tutorial_code/calib3d/real_time_pose_estimation/src/PnPProblem.h
...l_code/calib3d/real_time_pose_estimation/src/PnPProblem.h
+1
-1
samples/cpp/tutorial_code/calib3d/real_time_pose_estimation/src/Utils.cpp
...rial_code/calib3d/real_time_pose_estimation/src/Utils.cpp
+1
-1
samples/cpp/tutorial_code/calib3d/real_time_pose_estimation/src/main_detection.cpp
.../calib3d/real_time_pose_estimation/src/main_detection.cpp
+4
-4
samples/cpp/tutorial_code/calib3d/real_time_pose_estimation/src/main_registration.cpp
...lib3d/real_time_pose_estimation/src/main_registration.cpp
+3
-3
未找到文件。
modules/calib3d/doc/camera_calibration_and_3d_reconstruction.rst
浏览文件 @
c7f6c0cb
...
...
@@ -599,7 +599,7 @@ solvePnPRansac
------------------
Finds an object pose from 3D-2D point correspondences using the RANSAC scheme.
.. ocv:function:: bool solvePnPRansac( InputArray objectPoints, InputArray imagePoints, InputArray cameraMatrix, InputArray distCoeffs, OutputArray rvec, OutputArray tvec, bool useExtrinsicGuess=false, int iterationsCount = 100, float reprojectionError = 8.0,
float
confidence = 0.99, OutputArray inliers = noArray(), int flags = ITERATIVE )
.. ocv:function:: bool solvePnPRansac( InputArray objectPoints, InputArray imagePoints, InputArray cameraMatrix, InputArray distCoeffs, OutputArray rvec, OutputArray tvec, bool useExtrinsicGuess=false, int iterationsCount = 100, float reprojectionError = 8.0,
double
confidence = 0.99, OutputArray inliers = noArray(), int flags = ITERATIVE )
.. ocv:pyfunction:: cv2.solvePnPRansac(objectPoints, imagePoints, cameraMatrix, distCoeffs[, rvec[, tvec[, useExtrinsicGuess[, iterationsCount[, reprojectionError[, minInliersCount[, inliers[, flags]]]]]]]]) -> rvec, tvec, inliers
...
...
modules/calib3d/include/opencv2/calib3d.hpp
浏览文件 @
c7f6c0cb
...
...
@@ -159,7 +159,7 @@ CV_EXPORTS_W bool solvePnPRansac( InputArray objectPoints, InputArray imagePoint
InputArray
cameraMatrix
,
InputArray
distCoeffs
,
OutputArray
rvec
,
OutputArray
tvec
,
bool
useExtrinsicGuess
=
false
,
int
iterationsCount
=
100
,
float
reprojectionError
=
8.0
,
float
confidence
=
0.99
,
float
reprojectionError
=
8.0
,
double
confidence
=
0.99
,
OutputArray
inliers
=
noArray
(),
int
flags
=
ITERATIVE
);
//! initializes camera matrix from a few 3D points and the corresponding projections.
...
...
modules/calib3d/src/solvepnp.cpp
浏览文件 @
c7f6c0cb
...
...
@@ -177,7 +177,7 @@ public:
bool
cv
::
solvePnPRansac
(
InputArray
_opoints
,
InputArray
_ipoints
,
InputArray
_cameraMatrix
,
InputArray
_distCoeffs
,
OutputArray
_rvec
,
OutputArray
_tvec
,
bool
useExtrinsicGuess
,
int
iterationsCount
,
float
reprojectionError
,
float
confidence
,
int
iterationsCount
,
float
reprojectionError
,
double
confidence
,
OutputArray
_inliers
,
int
flags
)
{
...
...
samples/cpp/tutorial_code/calib3d/real_time_pose_estimation/src/CsvReader.cpp
浏览文件 @
c7f6c0cb
...
...
@@ -45,9 +45,9 @@ void CsvReader::readPLY(vector<Point3f> &list_vertex, vector<vector<int> > &list
getline
(
liness
,
z
);
cv
::
Point3f
tmp_p
;
tmp_p
.
x
=
StringToInt
(
x
);
tmp_p
.
y
=
StringToInt
(
y
);
tmp_p
.
z
=
StringToInt
(
z
);
tmp_p
.
x
=
(
float
)
StringToInt
(
x
);
tmp_p
.
y
=
(
float
)
StringToInt
(
y
);
tmp_p
.
z
=
(
float
)
StringToInt
(
z
);
list_vertex
.
push_back
(
tmp_p
);
count
++
;
...
...
samples/cpp/tutorial_code/calib3d/real_time_pose_estimation/src/Mesh.cpp
浏览文件 @
c7f6c0cb
...
...
@@ -76,7 +76,7 @@ void Mesh::load(const std::string path)
csvReader
.
readPLY
(
list_vertex_
,
list_triangles_
);
// Update mesh attributes
num_vertexs_
=
list_vertex_
.
size
();
num_triangles_
=
list_triangles_
.
size
();
num_vertexs_
=
(
int
)
list_vertex_
.
size
();
num_triangles_
=
(
int
)
list_triangles_
.
size
();
}
samples/cpp/tutorial_code/calib3d/real_time_pose_estimation/src/PnPProblem.cpp
浏览文件 @
c7f6c0cb
...
...
@@ -133,9 +133,9 @@ bool PnPProblem::estimatePose( const std::vector<cv::Point3f> &list_points3d,
// Estimate the pose given a list of 2D/3D correspondences with RANSAC and the method to use
void
PnPProblem
::
estimatePoseRANSAC
(
const
std
::
vector
<
cv
::
Point3f
>
&
list_points3d
,
// list with model 3D coordinates
const
std
::
vector
<
cv
::
Point2f
>
&
list_points2d
,
// list with scene 2D coordinates
int
flags
,
cv
::
Mat
&
inliers
,
int
iterationsCount
,
// PnP method; inliers container
float
reprojectionError
,
float
confidence
)
// Ransac parameters
const
std
::
vector
<
cv
::
Point2f
>
&
list_points2d
,
// list with scene 2D coordinates
int
flags
,
cv
::
Mat
&
inliers
,
int
iterationsCount
,
// PnP method; inliers container
float
reprojectionError
,
double
confidence
)
// Ransac parameters
{
cv
::
Mat
distCoeffs
=
cv
::
Mat
::
zeros
(
4
,
1
,
CV_64FC1
);
// vector of distortion coefficients
cv
::
Mat
rvec
=
cv
::
Mat
::
zeros
(
3
,
1
,
CV_64FC1
);
// output rotation vector
...
...
@@ -187,8 +187,8 @@ cv::Point2f PnPProblem::backproject3DPoint(const cv::Point3f &point3d)
// Normalization of [u v]'
cv
::
Point2f
point2d
;
point2d
.
x
=
point2d_vec
.
at
<
double
>
(
0
)
/
point2d_vec
.
at
<
double
>
(
2
);
point2d
.
y
=
point2d_vec
.
at
<
double
>
(
1
)
/
point2d_vec
.
at
<
double
>
(
2
);
point2d
.
x
=
(
float
)(
point2d_vec
.
at
<
double
>
(
0
)
/
point2d_vec
.
at
<
double
>
(
2
)
);
point2d
.
y
=
(
float
)(
point2d_vec
.
at
<
double
>
(
1
)
/
point2d_vec
.
at
<
double
>
(
2
)
);
return
point2d
;
}
...
...
samples/cpp/tutorial_code/calib3d/real_time_pose_estimation/src/PnPProblem.h
浏览文件 @
c7f6c0cb
...
...
@@ -30,7 +30,7 @@ public:
bool
estimatePose
(
const
std
::
vector
<
cv
::
Point3f
>
&
list_points3d
,
const
std
::
vector
<
cv
::
Point2f
>
&
list_points2d
,
int
flags
);
void
estimatePoseRANSAC
(
const
std
::
vector
<
cv
::
Point3f
>
&
list_points3d
,
const
std
::
vector
<
cv
::
Point2f
>
&
list_points2d
,
int
flags
,
cv
::
Mat
&
inliers
,
int
iterationsCount
,
float
reprojectionError
,
float
confidence
);
int
iterationsCount
,
float
reprojectionError
,
double
confidence
);
cv
::
Mat
get_A_matrix
()
const
{
return
_A_matrix
;
}
cv
::
Mat
get_R_matrix
()
const
{
return
_R_matrix
;
}
...
...
samples/cpp/tutorial_code/calib3d/real_time_pose_estimation/src/Utils.cpp
浏览文件 @
c7f6c0cb
...
...
@@ -19,7 +19,7 @@
// For text
int
fontFace
=
cv
::
FONT_ITALIC
;
double
fontScale
=
0.75
;
double
thickness_font
=
2
;
int
thickness_font
=
2
;
// For circles
int
lineType
=
8
;
...
...
samples/cpp/tutorial_code/calib3d/real_time_pose_estimation/src/main_detection.cpp
浏览文件 @
c7f6c0cb
...
...
@@ -49,7 +49,7 @@ bool fast_match = true; // fastRobustMatch() or robustMatch()
// RANSAC parameters
int
iterationsCount
=
500
;
// number of Ransac iterations.
float
reprojectionError
=
2.0
;
// maximum allowed distance to consider it an inlier.
float
confidence
=
0.95
;
// ransac successful confidence.
double
confidence
=
0.95
;
// ransac successful confidence.
// Kalman Filter parameters
int
minInliersKalman
=
30
;
// Kalman threshold updating
...
...
@@ -287,7 +287,7 @@ int main(int argc, char *argv[])
drawObjectMesh
(
frame_vis
,
&
mesh
,
&
pnp_detection_est
,
yellow
);
// draw estimated pose
}
double
l
=
5
;
float
l
=
5
;
std
::
vector
<
cv
::
Point2f
>
pose_points2d
;
pose_points2d
.
push_back
(
pnp_detection_est
.
backproject3DPoint
(
cv
::
Point3f
(
0
,
0
,
0
)));
// axis center
pose_points2d
.
push_back
(
pnp_detection_est
.
backproject3DPoint
(
cv
::
Point3f
(
l
,
0
,
0
)));
// axis x
...
...
@@ -315,10 +315,10 @@ int main(int argc, char *argv[])
// Draw some debug text
int
inliers_int
=
inliers_idx
.
rows
;
int
outliers_int
=
good_matches
.
size
()
-
inliers_int
;
int
outliers_int
=
(
int
)
good_matches
.
size
()
-
inliers_int
;
std
::
string
inliers_str
=
IntToString
(
inliers_int
);
std
::
string
outliers_str
=
IntToString
(
outliers_int
);
std
::
string
n
=
IntToString
(
good_matches
.
size
());
std
::
string
n
=
IntToString
(
(
int
)
good_matches
.
size
());
std
::
string
text
=
"Found "
+
inliers_str
+
" of "
+
n
+
" matches"
;
std
::
string
text2
=
"Inliers: "
+
inliers_str
+
" - Outliers: "
+
outliers_str
;
...
...
samples/cpp/tutorial_code/calib3d/real_time_pose_estimation/src/main_registration.cpp
浏览文件 @
c7f6c0cb
...
...
@@ -67,7 +67,7 @@ static void onMouseModelRegistration( int event, int x, int y, int, void* )
int
n_regist
=
registration
.
getNumRegist
();
int
n_vertex
=
pts
[
n_regist
];
cv
::
Point2f
point_2d
=
cv
::
Point2f
(
x
,
y
);
cv
::
Point2f
point_2d
=
cv
::
Point2f
(
(
float
)
x
,(
float
)
y
);
cv
::
Point3f
point_3d
=
mesh
.
getVertex
(
n_vertex
-
1
);
bool
is_registrable
=
registration
.
is_registrable
();
...
...
@@ -224,12 +224,12 @@ int main()
std
::
vector
<
cv
::
Point2f
>
list_points_out
=
model
.
get_points2d_out
();
// Draw some debug text
std
::
string
num
=
IntToString
(
list_points_in
.
size
());
std
::
string
num
=
IntToString
(
(
int
)
list_points_in
.
size
());
std
::
string
text
=
"There are "
+
num
+
" inliers"
;
drawText
(
img_vis
,
text
,
green
);
// Draw some debug text
num
=
IntToString
(
list_points_out
.
size
());
num
=
IntToString
(
(
int
)
list_points_out
.
size
());
text
=
"There are "
+
num
+
" outliers"
;
drawText2
(
img_vis
,
text
,
red
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录