Skip to content

[RSDK-13312] Fixing order of parameters for Brown Conrady K6#63

Merged
SebastianMunozP merged 1 commit intoviam-modules:mainfrom
SebastianMunozP:fix-support-for-get-properties-brown-conrady-k6
Feb 3, 2026
Merged

[RSDK-13312] Fixing order of parameters for Brown Conrady K6#63
SebastianMunozP merged 1 commit intoviam-modules:mainfrom
SebastianMunozP:fix-support-for-get-properties-brown-conrady-k6

Conversation

@SebastianMunozP
Copy link
Contributor

@SebastianMunozP SebastianMunozP commented Feb 2, 2026

This PR fixes the order of parameters for Brown Conrady K6 distortion model used in Astra2 for the get_properties call

The counterpart to this fix, to actually support such distortion model is in this PR: viamrobotics/rdk#5702

The order of parameters that the RDK is as follows:

            type BrownConradyK6 struct {
            RadialK1     float64 `json:"rk1"`
            RadialK2     float64 `json:"rk2"`
            RadialK3     float64 `json:"rk3"`
            RadialK4     float64 `json:"rk4"`
            RadialK5     float64 `json:"rk5"`
            RadialK6     float64 `json:"rk6"`
            TangentialP1 float64 `json:"tp1"`
            TangentialP2 float64 `json:"tp2"`
            }

Testing

With this test we confirm that the order of parameters is correct:
Parameters sent by Orbbec (taken from logs below):

0.114636, //K1
-0.328871, //K2
0.256854, //K3
0, //K4
0, //K5
0, //K6
-0.000840949, //P1
9.80989e-05//P2

Parameters received by Python client (taken from logs below)

    "distortion": {
      "model": "BROWN_CONRADY_K6",
      "k1": 0.11463635414838791,
      "k2": -0.3288709819316864
      "k3": 0.2568541169166565,,
      "k4": 0,
      "k5": 0
      "k6": 0,
      "p1": -0.0008409488946199417,
      "p2": 0.00009809886250877753,
    },

Logs

Orbbec Get Properties Log:

2/2/2026, 2:38:47 PM debug orbbec-1     [module/orbbec.cpp:1273] [get_properties] end   log_ts 2026-02-02T14:38:47.570Z

2/2/2026, 2:38:47 PM debug orbbec-1     [module/orbbec.cpp:1271] [get_properties] Properties: distortion parameters: [model: BROWN_CONRADY_K6, parameters: [0.114636, -0.328871, 0.256854, 0, 0, 0, -0.000840949, 9.80989e-05, ]], intrinsic parameters: [1280, 720, 836.655, 837.041, 640.232, 351.624]   log_ts 2026-02-02T14:38:47.570Z

2/2/2026, 2:38:47 PM debug orbbec-1     [module/orbbec.cpp:1195] [get_properties] start   log_ts 2026-02-02T14:38:47.570Z

Getting distortion parameters through DoCommand confirms that the order of parameters is correct

{
  "Color": {
    "intrinsics": {
      "fx": 836.6552124023438,
      "cx": 640.2318725585938,
      "cy": 351.623779296875,
      "width": 1280,
      "fy": 837.0411987304688,
      "height": 720
    },
    "height": 720,
    "width": 1280,
    "distortion": {
      "p1": -0.0008409488946199417,
      "k6": 0,
      "k4": 0,
      "k3": 0.2568541169166565,
      "k1": 0.11463635414838791,
      "k2": -0.3288709819316864,
      "model": "BROWN_CONRADY_K6",
      "p2": 0.00009809886250877753,
      "k5": 0
    },
    "format": "MJPG",
    "fps": 30
  },
  "Depth": {
    "width": 1600,
    "distortion": {
      "k3": 0,
      "k6": 0,
      "k2": 0,
      "model": "BROWN_CONRADY_K6",
      "k1": 0,
      "k5": 0,
      "p1": 0,
      "k4": 0,
      "p2": 0
    },
    "format": "Y16",
    "intrinsics": {
      "cx": 800.1470336914062,
      "fy": 1424.7021484375,
      "height": 1200,
      "fx": 1424.67822265625,
      "width": 1600,
      "cy": 596.7117919921875
    },
    "fps": 30,
    "height": 1200
  }
}

@SebastianMunozP SebastianMunozP changed the title [RSDK-12432] Fixing order of parameters for Brown Conrady K6 [RSDK-13312] Fixing order of parameters for Brown Conrady K6 Feb 2, 2026
Copy link

@seanavery seanavery left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Are we planning to use Brown Conrady distortion model for camera calibration in a surface finishing or other use case?

@SebastianMunozP
Copy link
Contributor Author

LGTM. Are we planning to use Brown Conrady distortion model for camera calibration in a surface finishing or other use case?

Not really, this is mainly to fix the get_properties call that was broken in Orbbec, to circumvent this we were using a do_command, so this is just tech debt.

@SebastianMunozP SebastianMunozP merged commit 45ce94c into viam-modules:main Feb 3, 2026
1 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants