Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to set camera intrinsics for edge? #31

Open
medakk opened this issue May 29, 2019 · 5 comments
Open

How to set camera intrinsics for edge? #31

medakk opened this issue May 29, 2019 · 5 comments

Comments

@medakk
Copy link

medakk commented May 29, 2019

For EdgeSE3ProjectXYZ, we can set the camera intrinsics with the public fx, fy, cx, cy values, in the g2o codebase.

How do I set these values in g2opy?

@medakk
Copy link
Author

medakk commented May 29, 2019

For now, I changed the definition of EdgeSE3ProjectXYZ in this file:

    // Projection using focal_length in x and y directions
    py::class_<EdgeSE3ProjectXYZ, BaseBinaryEdge<2, Vector2D, VertexSBAPointXYZ, VertexSE3Expmap>>(m, "EdgeSE3ProjectXYZ")
        .def(py::init<>())
        .def("compute_error", &EdgeSE3ProjectXYZ::computeError)
        .def("is_depth_positive", &EdgeSE3ProjectXYZ::isDepthPositive)
        .def("linearize_oplus", &EdgeSE3ProjectXYZ::linearizeOplus)
        .def("cam_project", &EdgeSE3ProjectXYZ::cam_project)
        .def_readwrite("fx", &EdgeSE3ProjectXYZ::fx)
        .def_readwrite("fy", &EdgeSE3ProjectXYZ::fy)
        .def_readwrite("cx", &EdgeSE3ProjectXYZ::cx)
        .def_readwrite("cy", &EdgeSE3ProjectXYZ::cy)
    ;

@yiakwy-enterprise-roborock
Copy link

yiakwy-enterprise-roborock commented Apr 20, 2020

@medakk does it work well ? @uoip Some projects such as ORB-SLam use the same way to add poses as vertices.

@medakk
Copy link
Author

medakk commented Apr 20, 2020

@yiakwy-enterprise-roborock Its been a while since I used g2opy, but IIRC it worked fine.

@yiakwy-enterprise-roborock

I confirmed that modifying these attributes works well with EdgeSE3ProjectXYZ python bindings. @medakk I suggested mark this question as resolved.

@medakk
Copy link
Author

medakk commented Apr 21, 2020

I wouldn't consider it resolved yet: ideally this should be a part of the g2opy codebase, and I'm not sure how many other classes have such missing attributes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants