Items with no label
告知
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.
3338 ディスカッション

Intrinsics always return 0?

VBisc
ビギナー
4,575件の閲覧回数

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?

0 件の賞賛
12 返答(返信)
MartyG
名誉コントリビューター III
2,765件の閲覧回数

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

VBisc
ビギナー
2,765件の閲覧回数

I am doing

import pyrealsense2 as rs

which I think is correct?

MartyG
名誉コントリビューター III
2,765件の閲覧回数

Someone else who was converting a script for Pyrealsense in SDK 2.0 used:

import pyrealsense2 as rs2

VBisc
ビギナー
2,765件の閲覧回数

Hello, thank you for your answer.

rs is an alias, I could have used rs or rs2 or realSenseRandomName, wouldn't change

MartyG
名誉コントリビューター III
2,765件の閲覧回数

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.

idata
従業員
2,765件の閲覧回数

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
VBisc
ビギナー
2,765件の閲覧回数

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!

idata
従業員
2,765件の閲覧回数

^^ 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++?

VBisc
ビギナー
2,765件の閲覧回数

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

idata
従業員
2,765件の閲覧回数

Thanks!

idata
従業員
2,765件の閲覧回数

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.

idata
従業員
2,765件の閲覧回数

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.

 

返信