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

Segmentation labels/masks from depth camera image #342

Open
k-maheshkumar opened this issue Apr 20, 2023 · 5 comments
Open

Segmentation labels/masks from depth camera image #342

k-maheshkumar opened this issue Apr 20, 2023 · 5 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@k-maheshkumar
Copy link

k-maheshkumar commented Apr 20, 2023

I see that there is segmentaion camera, that ouputs labels/masks for the instance and semantic segmentation. This is based on the 2D images, Is there any way to get 2D masks from the depth camera output and not setting up a seperate camera?

Desired behavior

  1. Add rgb/depth camera into simulation
  2. publish segmentation labels/masks from the above camera (incase of depth camera, labels on the depth image) instead of adding new segmentation camera

Alternatives considered

If there is already a solution or a workaround, I would be happy to know about it :)

@k-maheshkumar k-maheshkumar added the enhancement New feature or request label Apr 20, 2023
@k-maheshkumar
Copy link
Author

similarly, it would be nicer to have the same behaviour for other camera sensors

@azeey azeey added the help wanted Extra attention is needed label May 1, 2023
@iche033
Copy link
Contributor

iche033 commented May 2, 2023

This is currently not possible. Another option would be to extend the segmentation camera to output depth images with labels but that would also require some work. The easiest workaround is to set up 2 separate sensors for now.

@k-maheshkumar
Copy link
Author

sorry, it was a typo, I meant 2D masks. In other words, can we integrate depth camera and segmentation camera?

@mjcarroll
Copy link
Contributor

I believe that if you place two cameras, a segmentation and a depth camera, in the same location with the same parameters (focal length and resolution), the results may be what you are looking for. This is essentially how the RGB-Depth camera works as well.

@k-maheshkumar
Copy link
Author

Thnaks for the suggestion. I have tried the same and got the expected output, but are those cameras time synchronized?.

Also I have some problems (see below), you can refer to the attached sdf example and the screenshot.

Scenario: spawned few objects and three set of camera (each set has monochrome, depth and segmentation camera)
System specs: AMD Ryzen 7 5800X, 16 GB RAM, NVIDIA GeForce RTX 3070 Ti
Gazebo version: Fortress (with real_time_update_rate set to 100)

Problems:
Looking into the source code, I know, when the cameras are not subscribed, nothing happens in the background, but

  • Whenever the cameras are visualized, the real time factor (RTF) drops
  • more camera visualized, more RTF drops, this is more significant when monochrome image is subscribed

Could please let me know if miss something or is it a known issue or got solved in the newest version already?

Also I have tried to create a custom plugin and found that ConnectNewImageFrame (for camera) callback is never triggered similar to the callback from ConnectNewDepthFrame (for depth camera). Is there a way that we get the callback triggered, so I have an access to the raw buffer?

Attachments:
cameras.sdf.txt
1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

4 participants