Forum

Author Topic: depth maps coordinate shift  (Read 1181 times)

forumname

  • Newbie
  • *
  • Posts: 36
    • View Profile
depth maps coordinate shift
« on: August 19, 2022, 03:34:24 AM »
I have noticed that the images of depth maps are horizontally shifted compared to the masks or input image. Is it possible to obtain the translation so that the mask will overlay the depth map?

Code used to obtain each image:

Code: [Select]
import matplotlib.pyplot as plt

frame = chunk.frames[0]

img = frame.cameras[0].image()
img = np.frombuffer(img.tostring(), dtype=np.uint8).reshape(img.height,img.width)

depth = frame.depth_maps[frame.cameras[0]].image()
depth = np.frombuffer(depth.tostring(), dtype=np.float32).reshape(depth.height,depth.width)

mask = frame.masks[frame.cameras[0]].image()
mask = np.frombuffer(mask.tostring(), dtype=np.uint8).reshape(mask.height,mask.width)

plt.imshow(img)
plt.imshow(mask)
plt.imshow(depth)

EDIT: this is solved by undistorting the mask with the camera calibration.
« Last Edit: August 19, 2022, 05:52:37 AM by forumname »