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

Saving/Loading intrinsics to/from a file #4061

Closed
jimwormold opened this issue May 23, 2019 · 0 comments
Closed

Saving/Loading intrinsics to/from a file #4061

jimwormold opened this issue May 23, 2019 · 0 comments

Comments

@jimwormold
Copy link

jimwormold commented May 23, 2019


Required Info
Camera Model { D400 }
Firmware Version (5.10.03)
Operating System & Version Win 7
Kernel Version (Linux Only)
Platform PC
SDK Version { 2.20 }
Language python
Segment {others }

Issue Description

I would like to be able to save off the intrinsics and reload them as required for running unit tests against individual frames rather than having to open a bagfile each time (storing multiple bag frames is not an option due to size).

This is related to this issue, but I can't find an issue raised on github...

https://forums.intel.com/s/question/0D50P0000490LwGSAU/how-to-save-load-intrinsics-to-from-file-python?language=en_US

UPDATE:

While I can't save/serialize them, I notice that I can now create an rs2.intrinsics object and set the parameters based upon those from the camera (I think these used to be read-only), so this is an accepable work around:

 def make_intrinsics(self):
        '''
        Avoid having to read a bagfile to get the camera intrinsics
        '''
        # Copied from a bagfile's intrinsics
        intrinsics = rs.intrinsics()
        intrinsics.coeffs = [0,0,0,0,0]
        intrinsics.fx = 639.2603759765625
        intrinsics.fy = 639.2603759765625
        intrinsics.height = 720
        intrinsics.ppx = 640.6775512695312
        intrinsics.ppy = 355.451171875
        intrinsics.width=1280
        return intrinsics
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

1 participant