3 Replies Latest reply on Aug 23, 2018 8:22 AM by rjo___

    intrinsics, laser power python

    rjo___

      item 1) I cannot find python code to actively manage the laser power or to toggle the emitter.  My attempts to translate the C++ code were (as expected:) no good.

      item 2) Intrinsic Madness->

       

      Not exactly sure what I am doing wrong here. 

       

      The following code is a lightly modified version posted by Intel in answer to a similar question.

      I'm using a D435 with most recent updates across the board.  Windows 8.1.

       

      ##Trying to get intrinsics (fx, etc.)
      # First import the library
      import pyrealsense2 as rs

       

      pipe = rs.pipeline()

      cfg = rs.config
      cfg.enable_stream(rs.stream.color, 1920, 1080, rs.format. rgb8, 30)

      cfg.enable_stream(rs.stream.infrared, 1,848,480,rs.format.y8,30)

      cfg.enable_stream(rs.stream.infrared, 2,848,480,rs.format.y8,30)

      cfg.enable_stream(rs.stream.depth,848,480,rs.format.z16,30)

       

      prof = pipe.start(cfg)

      ds = prof.get_stream(rs.stream.depth)

      intr = ds.as_video_stream_profile().get_intrinsics()

      print "depth"
      print intr

      s = prof.get_stream(rs.stream.infrared, 1)

      intr = ds.as_video_stream_profile().get_intrinsics()

      print"IR1:"
      print intr

      s = prof.get_stream(rs.stream.infrared, 2)

      intr = ds.as_video_stream_profile().get_intrinsics()

      print"IR2:"
      print intr

      ds = prof.get_stream(rs.stream.color)

      intr = ds.as_video_stream_profile().get_intrinsics()

      print"color:"
      print intr

       

      And this gives the following:

       

      depth
      width: 848, height: 480, ppx: 424.713, ppy: 242.321, fx: 420.367, fy: 420.367, model: Brown Conrady
      IR1:
      width: 848, height: 480, ppx: 424.713, ppy: 242.321, fx: 420.367, fy: 420.367, model: Brown Conrady
      IR2:
      width: 848, height: 480, ppx: 424.713, ppy: 242.321, fx: 420.367, fy: 420.367, model: Brown Conrady
      color:
      width: 1920, height: 1080, ppx: 968.251, ppy: 536.9, fx: 1392.01, fy: 1392.87, model: Brown Conrady

      Process finished with exit code 0

       

      BUT:

      If I change the order of getting the streams so that the color stream is looked at just after depth and before IR1 and IR2 I get:

       

       

      depth
      width: 848, height: 480, ppx: 424.713, ppy: 242.321, fx: 420.367, fy: 420.367, model: Brown Conrady
      color:
      width: 1920, height: 1080, ppx: 968.251, ppy: 536.9, fx: 1392.01, fy: 1392.87, model: Brown Conrady
      IR1:
      width: 1920, height: 1080, ppx: 968.251, ppy: 536.9, fx: 1392.01, fy: 1392.87, model: Brown Conrady
      IR2:
      width: 1920, height: 1080, ppx: 968.251, ppy: 536.9, fx: 1392.01, fy: 1392.87, model: Brown Conrady

      Process finished with exit code 0

       

       

      item 3)

       

      I convert from fx(pixel relative) to:   fx(mm) = image_width/fx. For the Depth camera I get a reasonable answer(about 2), but for the color camera the answer is about 1.3... way far off.

       

      Thanks,

       

      Rich