I am using the python wrapper for the SDK 2 for the D435 camera.
I need to get the intrinsic values of my camera, but when I run rs.intrinsics() in python I get
width: 0, height: 0, ppx: 0, ppy: 0, fx: 0, fy: 0, model: None, coeffs: [0, 0, 0, 0, 0]
Can I get intrinsic values for my camera easily within python or in some other way?
連結已複製
RealSense SDK 2.0 uses the instruction rs2_intrinsics instead of rs_intrinsics Are you using rs2?
https://github.com/IntelRealSense/librealsense/wiki/Projection-in-RealSense-SDK-2.0# intrinsic-camera-parameters Projection in RealSense SDK 2.0 · IntelRealSense/librealsense Wiki · GitHub
The Python wrapper in SDK 2.0 is supposed to allow extrinsics and intrinsics creation and modification, according to the release notes since version 2.10.0. I have yet to find documentation for this feature though and as Python programming is not a specialist area of mine, an Intel support team member may be able to give better advice on this subject than I can. I apologize for you having to wait for an answer.
Hello Valerio1988,
Please try downcasting to "video_stream_profile" like below:
cfg = pipeline.start() # Start pipeline and get the configuration it found
profile = cfg.get_stream(rs.stream.depth) # Fetch stream profile for depth stream
intr = profile.as_video_stream_profile().get_intrinsics() # Downcast to video_stream_profile and fetch intrinsics
print intr.ppx
Please let us know if this solution works for you.
Regards,
Jesus
Intel Customer Support
They are not zero in my case, they are what appear to be the correct value.
check this
https://github.com/IntelRealSense/librealsense/wiki/API-How-To# get-video-stream-intrinsics API How To · IntelRealSense/librealsense Wiki · GitHub
I am able to get the intrinsic data with CPP but I cannot figure out how to do this Python. Is there some documentation for the Python wrapper that will teach me how to do this? Has anyone had success getting the intrinsic data with Python and can help? I am trying to keep everything to one language.
Hello pault587,
Thank you for your contacting Intel® RealSense™ Technology support.
Use the following script to get intrinsics with Python:
/// Intrinsics:
pipe = rs.pipeline()
cfg = rs.config()
cfg.enable_stream(rs.stream.infrared, 1)
cfg.enable_stream(rs.stream.infrared, 2)
cfg.enable_stream(rs.stream.depth)
prof = self.pipe.start(cfg)
ds = prof.get_stream(rs.stream.depth)
intr = ds.as_video_stream_profile().get_intrinsics()
self.fx = intr.fx
I hope you find this information helpful.
Best regards.
Josh B.
