Skip to content

Commit 48fd71a

Browse files
Extend python bindings
Extend EdgeSE3ProjectXYZOnlyPose and EdgeStereoSE3ProjectXYZ to read/write access to the camera parameters.
1 parent e8d3ccf commit 48fd71a

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

python/types/sba/py_types_six_dof_expmap.cpp

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,12 @@ void declareTypesSixDofExpmap(py::module& m) {
9898
.def("compute_error", &EdgeSE3ProjectXYZOnlyPose::computeError)
9999
.def("is_depth_positive", &EdgeSE3ProjectXYZOnlyPose::isDepthPositive)
100100
.def("linearize_oplus", &EdgeSE3ProjectXYZOnlyPose::linearizeOplus)
101-
.def("cam_project", &EdgeSE3ProjectXYZOnlyPose::cam_project);
101+
.def("cam_project", &EdgeSE3ProjectXYZOnlyPose::cam_project)
102+
.def_readwrite("fx", &EdgeSE3ProjectXYZOnlyPose::fx)
103+
.def_readwrite("fy", &EdgeSE3ProjectXYZOnlyPose::fy)
104+
.def_readwrite("cx", &EdgeSE3ProjectXYZOnlyPose::cx)
105+
.def_readwrite("cy", &EdgeSE3ProjectXYZOnlyPose::cy)
106+
.def_readwrite("Xw", &EdgeSE3ProjectXYZOnlyPose::Xw);
102107

103108
// Projection using focal_length in x and y directions stereo
104109
py::class_<EdgeStereoSE3ProjectXYZ,
@@ -109,7 +114,12 @@ void declareTypesSixDofExpmap(py::module& m) {
109114
.def("compute_error", &EdgeStereoSE3ProjectXYZ::computeError)
110115
.def("is_depth_positive", &EdgeStereoSE3ProjectXYZ::isDepthPositive)
111116
.def("linearize_oplus", &EdgeStereoSE3ProjectXYZ::linearizeOplus)
112-
.def("cam_project", &EdgeStereoSE3ProjectXYZ::cam_project);
117+
.def("cam_project", &EdgeStereoSE3ProjectXYZ::cam_project)
118+
.def_readwrite("fx", &EdgeStereoSE3ProjectXYZ::fx)
119+
.def_readwrite("fy", &EdgeStereoSE3ProjectXYZ::fy)
120+
.def_readwrite("cx", &EdgeStereoSE3ProjectXYZ::cx)
121+
.def_readwrite("cy", &EdgeStereoSE3ProjectXYZ::cy)
122+
.def_readwrite("bf", &EdgeStereoSE3ProjectXYZ::bf);
113123

114124
// Edge to optimize only the camera pose stereo
115125
templatedBaseUnaryEdge<3, Vector3, VertexSE3Expmap>(

0 commit comments

Comments
 (0)