librealsense icon indicating copy to clipboard operation
librealsense copied to clipboard

How to get the intrinsic parameters with the Python wrapper?

Open felix-tracxpoint opened this issue 9 years ago • 4 comments

Required Info
Camera Model D400
Firmware Version SDK 2.0
Operating System & Version Windows 10
Kernel Version (Linux Only)

I presume it's something obvious I had overlooked.

felix-tracxpoint avatar Nov 30 '17 10:11 felix-tracxpoint

Hi @felix-tracxpoint Unfortunately, it is not as obvious as we would like:

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

We are trying to keep the SDK open to non-video extensions in the future, that's why a downcast (to video_stream_profile) is required before you can fetch the intrinsics.

dorodnic avatar Nov 30 '17 12:11 dorodnic

Thanks, this is very helpful!

felix-tracxpoint avatar Nov 30 '17 13:11 felix-tracxpoint

Has this been improved since this issue was created? Or do we still need to start a pipeline to retrieve the intrinsics from the camera?

erikcummins avatar Aug 08 '19 22:08 erikcummins

you no longer need to create a pipeline. You can query devices from a context object and then query it's sensors, or just query all available sensors directly from the context object. From here you can grab a list of all supported stream profiles, and use the same logic as above to get the intrinsics for each

lramati avatar Aug 20 '19 15:08 lramati