Skip to content

msg.encoding map ? #6

@CRAZY-LY

Description

@CRAZY-LY

What are the corresponding rules of msg.encoding and "encoding" in bridge.imgmsg_to_cv2(msg, "encoding")?(encoding = "bgr8" or "rgb8"...)
if msg.encoding.find("mono8")!=-1 : pix_fmt = "gray" #np_arr = np.fromstring(msg.data, np.uint8) if opt_display_images: cv_image = bridge.imgmsg_to_cv2(msg, "bgr8") elif msg.encoding.find("bgr8")!=-1 : pix_fmt = "bgr24" #np_arr = np.fromstring(msg.data, np.uint8) if opt_display_images: cv_image = bridge.imgmsg_to_cv2(msg, "bgr8") elif msg.encoding.find("rgb8")!=-1 : pix_fmt = "rgb24" #np_arr = np.fromstring(msg.data, np.uint8) if opt_display_images: cv_image = bridge.imgmsg_to_cv2(msg, "bgr8")

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions