def pixel_to_point(intrinsics, pixel, depth):
    """
    Compute the 3D camera coordinates from pixel coordinates and depth in an image
    :param intrinsics: camera intrinsics
    :param pixel: [x, y] of picture coordinate
    :param depth: depth of pixel
    :return: [x, y, z] of camera 3D coordinate
    """

    x = (pixel[0] - intrinsics.ppx) / intrinsics.fx
    y = (pixel[1] - intrinsics.ppy) / intrinsics.fy

    # meters to mm
    m_to_mm = 1000
    point = [0, 0, 0]
    point[0] = m_to_mm * depth * x  # camera 3D coordinate x, same as robot coordinate -z
    point[1] = m_to_mm * depth * y  # camera 3D coordinate y, same as robot coordinate -y
    point[2] = m_to_mm * depth  # camera 3D coordinate z, same as robot coordinate x

    return point