pcl_helper.py 文件源码

python
阅读 27 收藏 0 点赞 0 评论 0

项目:PCL-ROS-cluster-Segmentation 作者: jupidity 项目源码 文件源码
def float_to_rgb(float_rgb):
    """ Converts a packed float RGB format to an RGB list    

        Args:
            float_rgb: RGB value packed as a float

        Returns:
            color (list): 3-element list of integers [0-255,0-255,0-255]
    """
    s = struct.pack('>f', float_rgb)
    i = struct.unpack('>l', s)[0]
    pack = ctypes.c_uint32(i).value

    r = (pack & 0x00FF0000) >> 16
    g = (pack & 0x0000FF00) >> 8
    b = (pack & 0x000000FF)

    color = [r,g,b]

    return color
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号