I am working on a project here I need to render a 3D cuboid into a 2D camera image. I have a 3D world where a cuboid is defined with the following data:
{
"contour": {
"center3D": {
"x": 25.129086913771097,
"y": -4.677377594728334,
"z": 0.4883814126253128
},
"size3D": {
"x": 3.8895241389987945,
"y": 2.008808489565424,
"z": 1.4863840997219087
},
"rotation3D": {
"x": 0,
"y": 0,
"z": 3.07177948351002
}
}
}
i have the camera image of this 3D world along with the calibration data:
"calibration": {
"intrinsics_pinhole": {
"camera_matrix": [
4609.471892628096, 0.0, 1257.158605934, 0.0, 0.0,
4609.471892628096, 820.0498076210201, 0.0, 0.0, 0.0, 1.0, 0.0
],
"distortion_coeffs": [-0.0914603, 0.605326, 0.0, 0.0, 0.417134],
"width_px": 2464,
"height_px": 1600
},
"coordinate_systems": {
"pose_wrt_parent": {
"translation": [0.0669458, -0.000911152, 2.05432],
"quaternion": [0.00193374, -0.00293566, 0.00271082, 0.99999]
}
}
}
I need help with projecting the 3D cuboid onto the 2D camera image using the given calibration data. I’m not sure how to properly apply the transformations and use the camera intrinsics to achieve this.