fix(sim): remove alpha channel for improved performance (#37602)

fix: update RGB image processing in CopyRamRGBCamera
This commit is contained in:
David
2026-03-10 18:02:02 -05:00
committed by GitHub
parent 40b61a8212
commit b750229e70

View File

@@ -13,10 +13,8 @@ class CopyRamRGBCamera(RGBCamera):
def get_rgb_array_cpu(self):
origin_img = self.cpu_texture
img = np.frombuffer(origin_img.getRamImageAs("RGBA").getData(), dtype=np.uint8)
img = img.reshape((origin_img.getYSize(), origin_img.getXSize(), 4))
img = img[:, :, :3]
# img = np.swapaxes(img, 1, 0)
img = np.frombuffer(origin_img.getRamImageAs("RGB").getData(), dtype=np.uint8)
img = img.reshape((origin_img.getYSize(), origin_img.getXSize(), 3))
img = img[::-1] # Flip on vertical axis
return img