View my account

D455 camera matrix

Comments

3 comments

  • Zahid Iqbal

    On the realsense-viewer, I choose More --> Calibration Data and then rectified resolution 1280 x 720. These are the values that I obtain:

    Focal Length: 659.186. 659.186

    Principal Point: 646.592, 353.885

    On the other hand, I run the following script:

    rs2_intrinsics realSenseWrapper :: print_intrinsic_parameters() {
        selection = pipe.start();
                
        auto color_stream = selection.get_stream(RS2_STREAM_COLOR).as<rs2::video_stream_profile>();
        auto resolution = std::make_pair(color_stream.width(), color_stream.height());

        auto i = color_stream.get_intrinsics();
        auto principal_point = std::make_pair(i.ppx, i.ppy);
        auto focal_length = std::make_pair(i.fx, i.fy);
        rs2_distortion model = i.model;
        
        //print the parameters
        cout << "Resolution: " << resolution.first << "," << resolution.second << endl;
        cout << "Principle point: " << principal_point.first << "," << principal_point.second << endl;
        cout << "Focal length: " << focal_length.first << "," << focal_length.second << endl;
        cout << "distortion model: " << model << endl;

                
        // Find first depth sensor (devices can have zero or more then one)
        auto sensor = selection.get_device().first<rs2::depth_sensor>();
        auto scale =  sensor.get_depth_scale();

        printf("sensor.depth_scale: %0.5f\n", scale);

        auto sensor_data = pipe.wait_for_frames();  
        rs2::depth_frame dpt_frame = sensor_data.get_depth_frame();           
        float pixel_distance_in_meters = dpt_frame.get_distance(23,23);     
        printf("and the distance in meters is: %0.5f\n", pixel_distance_in_meters); 

        pipe.stop();

        return i;
    }

    I receive the following information:

    Resolution: 1280,720
    Principle point: 652.595,360.33
    Focal length: 642.119,641.383
    distortion model: Inverse Brown Conrady
    sensor.depth_scale: 0.00100

    Why these two differ, and which one to choose.

    thanks,

     

     

     

    0
    Comment actions Permalink
  • MartyG

    Hi Zahid Iqbal  When depth is aligned to color, the color intrinsics should be used.  This is because after alignment to color, the depth origin changes from the centerline of the left IR sensor to the centerline of the RGB color sensor.

     

    You can list the intrinsics and extrinsics of a specific camera for each stream type and at different resolutions using the calibration information mode of the rs-enumerate-devices tool.  You can access this mode by launching rs-enumerate-devices with the following command:

    rs-enumerate-devices -c

    0
    Comment actions Permalink
  • Zahid Iqbal

    And, when I run rs-enumerate-device -c, I receive the following data:

    Intrinsic of "Color" / 1280x720 / {YUYV/RGB8/BGR8/RGBA8/BGRA8/Y8/Y16}
      Width:          1280
      Height:         720
      PPX:            652.594848632812
      PPY:            360.329559326172
      Fx:             642.293334960938
      Fy:             641.5576171875
      Distortion:     Inverse Brown Conrady
      Coeffs:         -0.0570749416947365      0.0687180981040001      -0.000155126384925097      0.00105448020622134      -0.0224851798266172  

    This seems to agree to what I receive from the software based method above. Does this confirm that camera matrix corresponds to an rgb stream? and for a particular chosen resolution?

    thanks,

     

    0
    Comment actions Permalink

Please sign in to leave a comment.