Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ERROR] [1548154452.152836138]: Could not convert depth image to laserscan: Depth image has unsupported encoding: rgb8 #36

Open
christenbc opened this issue Jan 22, 2019 · 7 comments

Comments

@christenbc
Copy link

The camera is an Intel Sense.
Is there any solution to this issue?

@BQuin
Copy link

BQuin commented Mar 13, 2019

I have a similar issue with an intel sense camera, but with mono16 encoding. Were you able to fix it? Thank you

@Ahmedkoptan
Copy link

Same issue here

@zouyonghao
Copy link

same here with

Could not convert depth image to laserscan: Depth image has unsupported encoding: mono16

@LuigiCerone
Copy link

Any update on this?

@clalancette
Copy link
Contributor

As it stands, depthimage_to_laserscan only supports image encodings of TYPE_16UC1 and TYPE_32FC1 (see

if (depth_msg->encoding == sensor_msgs::image_encodings::TYPE_16UC1)
). All other encodings throw that exception. To fix this issue, you'll have to open a pull request that adds support for converting from another encoding.

@Pomu0708
Copy link

you should convert the type of the image

def callback(self,data):
    try:
        cv_image = self.bridge.imgmsg_to_cv2(data, "bgr8")
    except CvBridgeError as e:
        print(e)
    
    img = cv2.cvtColor(cv_image,cv2.COLOR_BGR2GRAY)
    img2 = np.array(img, dtype=np.float32) 
    cv2.waitKey(1)

    try:
        self.image_pub.publish(self.bridge.cv2_to_imgmsg(img2, "32FC1"))
    except CvBridgeError as e:
        print(e)

@han88
Copy link

han88 commented Sep 13, 2023

Hi same problem..where do I have to place that code snippet?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants