- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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?
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am doing
import pyrealsense2 as rs
which I think is correct?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Someone else who was converting a script for Pyrealsense in SDK 2.0 used:
import pyrealsense2 as rs2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello, thank you for your answer.
rs is an alias, I could have used rs or rs2 or realSenseRandomName, wouldn't change
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I ended up doing something very similar:
self.profile = self.pipeline.start(self.config)
depth_stream=rs.video_stream_profile(self.profile.get_stream(rs.stream.depth))
a= depth_stream.get_intrinsics()
thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
^^ Can we please clarify here that the intrinsics should not be {0}'s? Per the above thread, it was indicated that the reason for the 0's was that the streams were rectified.
If not 0's, can we also please supply the correct mechanism for accessing them via C++?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page