Skip to content

Applying any non-zero DistortionRGB parameters has no visible effect on D435 (misalignment between RGB and IR textures) #13864

@Zauzolkov

Description

@Zauzolkov
Required Info
Camera Model D435
Firmware Version 5.16.0.1
Operating System & Version GNU/Linux (Ubuntu 22.04 and NixOS)
Kernel Version (Linux Only) 6.6.76
Platform PC
SDK Version 2.56.2
Language Not applicable
Segment Underwater Robotics

Issue Description

There is no observable effect on image from RGB camera after applying custom calibration parameters with DistortionRGB values filled.

Actions performed

  1. Executed CustomCalibration example to calculate distortion parameters (DynamicCalibrationAPI/2.14.2.0/examples/CustomCalibration), so I got XML file after this step.
  2. Executed CustomRW tool (from DEB package) to write new calibration parameters to device:
    $ Intel.Realsense.CustomRW  -w -rgb -f CalibrationParameters.xml 
    CustomRW for Intel RealSense D400, Version: 2.13.1.0
    
      >>> TOO LONG LOG CROPPED <<<
    
      HasRGB: 1
    
      resolutionRGB: 1920 1080
    
      FocalLengthColor: 2413.610107 2413.610107
      PrincipalPointColor: 995.437988 774.578003
      DistortionColor: 1.084310 -1.286550 0.091234 0.003310 0.502163
      RotationLeftColor: 0.999957 0.009198 0.000679
                        -0.009133 0.997752 -0.066389
                        -0.001289 0.066379 0.997794
      TranslationLeftColor: 12.566200 -25.375401 195.740997
    
  3. Started video streams in realsense-viewer to observe images from cameras.

Observed results

The image from the RGB camera does not change, while the IR cameras demonstrate different profiles of optical distortion (depending on applied configuration).

There is demonstration of same static scene captured by D435 with different calibration configurations:

Factory Calib Custom Calib
Factory Calib Custom Calib

As you can see, RGB image remains unchanged.

Please ignore the low quality of the depth map on "Custom Calib" screenshot as this configuration is intended for underwater conditions.

DistortionRGB values from XML files

Factory:

<param name = "DistortionRGB">
    <value>0</value>
    <value>0</value>
    <value>0</value>
    <value>0</value>
    <value>0</value>
</param>

Custom:

<param name = "DistortionRGB">
    <value>1.08431</value>
    <value>-1.28655</value>
    <value>0.0912345</value>
    <value>0.00331035</value>
    <value>0.502163</value>
</param>

Intrinsic parameters read from D435

These values were obtained using the rs-enumerate-devices -c, so calibration parameters are stored on device (confirmation that write operation was actually performed by CustomCW).

 Intrinsic of "Color" / 640x480 / {YUYV/RGB8/BGR8/RGBA8/BGRA8/Y8}
  Width:        640
  Height:       480
  PPX:          335.750244140625
  PPY:          344.256866455078
  Fx:           1072.71557617188
  Fy:           1072.71557617188
  Distortion:   Inverse Brown Conrady
  Coeffs:       2.08431005477905        -2.28655004501343       2.0912344455719         2.00331044197083  2.50216293334961
  FOV (deg):    33.21 x 25

Expected results

I expected that the RGB camera image would change (after writing the distortion parameters) in a similar way as IR cameras does. But should it?

What have I tried to resolve this problem

  • Turned video streams off and on (in realsense-viewer), since this is necessary to observe changes after writing custom parameters via CustomRW.
  • Performed hardware reset and USB re-plugging.
  • Performed factory reset of calibration settings (using both "Camera Calibration" menu in realsense-viewer and Intel.Realsense.CustomRW -g).
  • Upgraded firmware to latest available version.
  • Tried to write parameters while video streams are turned off (disabled in realsense-viewer).
  • Executed CustomRW with and without -rgb / --force-rgb argument.
  • Tried to manually set bigger values in DistortionRGB section of XML file, but there are still no any observable changes in image.

Context

Here is some additional context, in case I am approaching the problem incorrectly — i.e., a possible XY problem regarding this issue.

Why do we try to perform custom calibration

There is known problem of distorted (curved) depth map that occur in underwater conditions. The custom calibration procedure resolved this problem: planar objects now remain flat in the depth map thanks to proper undistortion of the depth images.

Why do we try to apply RGB camera calibration parameters

We noticed some alignment issues: while the 3D mesh is textured correctly using IR images, there is a serious mismatch when RGB Color Stream is selected in the Texture Source menu. We used realsense-viewer tool to check 3D mesh texturing, so our custom (client) software is not causing this issue itself (as it reproduced with tool from official Intel SDK).

Example of misalignment

Misalignment between mesh and texture

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions