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

encoding MONO16 support #80

Closed
furuya-kenji opened this issue Nov 29, 2022 · 5 comments
Closed

encoding MONO16 support #80

furuya-kenji opened this issue Nov 29, 2022 · 5 comments

Comments

@furuya-kenji
Copy link
Contributor

furuya-kenji commented Nov 29, 2022

Dear Rajivo,

I use ros_openpose with RGBcamera and ToF camera.
The encoding of depth data from ToF camera is MONO16.
When doing [rostopic echo /frame] , z data unit is not adequate, compared to RealSense.

So, I want to change a part of source code as below.


src/cameraReader.cpp (line 82)
before:

if (depthMsg->encoding == sensor_msgs::image_encodings::TYPE_16UC1)

after:

if (depthMsg->encoding == sensor_msgs::image_encodings::TYPE_16UC1 || depthMsg->encoding == sensor_msgs::image_encodings::MONO16)

Is this right and valid?
Thank you and regards.

@ravijo
Copy link
Owner

ravijo commented Nov 30, 2022

@furuya-kenji

In the case of '16UC1' encoding, the depth values are represented in millimeters. Therefore a conversion from millimeters to meters is performed by multiplying every element of the depth image by 0.001.

after:

if (depthMsg->encoding == sensor_msgs::image_encodings::TYPE_16UC1 || depthMsg->encoding == sensor_msgs::image_encodings::MONO16)

Is this right and valid? Thank you and regards.

This seems correct. However, I can not test it as of now. Please compile it and make sure to execute CPP node. The repository contains python node as well.

Let me know, how it goes!

Cheers

@furuya-kenji
Copy link
Contributor Author

@ravijo

Thank you for replying.
The modified code works well.(point z values show in meters)

If you don't mind, is it possible to merge the source code?
Thanks and regards.

pic

@ravijo
Copy link
Owner

ravijo commented Dec 1, 2022

@furuya-kenji

Thank you very much for the update. I am glad it works!

Yes, please create a pull request. Thank you for the great contribution!

@furuya-kenji
Copy link
Contributor Author

@ravijo
Thank you for replying.
I created pull request below.
#81

if any problem, please leave a comment.
Thanks and regards.

@ravijo
Copy link
Owner

ravijo commented Dec 1, 2022

@furuya-kenji

💯 done

Thanks a lot

@ravijo ravijo closed this as completed Dec 1, 2022
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

2 participants