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

Be consistent in RGB channel notation for ogre2 segmentation camera #419

Merged
merged 1 commit into from
Sep 22, 2021

Conversation

adlarkin
Copy link
Contributor

@adlarkin adlarkin commented Sep 21, 2021

Signed-off-by: Ashton Larkin [email protected]

🦟 Bug fix

Summary

When we updated the segmentation sensor (#329) to ogre2.2, it looks like inconsistencies were introduced in what pixel channels were considered RGB.

In Ogre2SegmentationCamera::LabelMapFromColoredBuffer, the notation is GBR: https://github.com/ignitionrobotics/ign-rendering/blob/7aade51f83171f2ada47089e6f8594fc3ccdddc5/ogre2/src/Ogre2SegmentationCamera.cc#L371-L373

But, in the material switcher, RGB is used:
https://github.com/ignitionrobotics/ign-rendering/blob/7aade51f83171f2ada47089e6f8594fc3ccdddc5/ogre2/src/Ogre2SegmentationMaterialSwitcher.cc#L233-L234
https://github.com/ignitionrobotics/ign-rendering/blob/7aade51f83171f2ada47089e6f8594fc3ccdddc5/ogre2/src/Ogre2SegmentationMaterialSwitcher.cc#L280-L281

This PR updates the indexing in Ogre2SegmentationCamera::LabelMapFromColoredBuffer to RGB instead of GBR.

Making this update fixes the label map data produced in gazebosim/gz-sensors#133. Before, the segmentation labels map was an image with all pixels set to the background label. Now, labels appear correctly:

fixed_label_map

Checklist

  • Signed all commits for DCO
  • Added tests
  • Updated documentation (as needed)
  • Updated migration guide (as needed)
  • codecheck passed (See contributing)
  • All tests passed (See test coverage)
  • While waiting for a review on your PR, please help review another open pull request to support the maintainers

Note to maintainers: Remember to use Squash-Merge

@adlarkin adlarkin requested a review from iche033 September 21, 2021 23:04
@github-actions github-actions bot added the 🏯 fortress Ignition Fortress label Sep 21, 2021
@adlarkin
Copy link
Contributor Author

@iche033 do you think it's better to update the Ogre::Vector4s in the material switcher to be GBR instead of RGB, or is it best to leave those as RGB and update the indexing in Ogre2SegmentationCamera::LabelMapFromColoredBuffer? I tested both, and they each seem to work fine.

@chapulina chapulina added beta Targeting beta release of upcoming collection bug Something isn't working labels Sep 21, 2021
@codecov
Copy link

codecov bot commented Sep 21, 2021

Codecov Report

Merging #419 (d2945ca) into main (8e7c876) will not change coverage.
The diff coverage is 0.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #419   +/-   ##
=======================================
  Coverage   55.06%   55.06%           
=======================================
  Files         191      191           
  Lines       19265    19265           
=======================================
  Hits        10608    10608           
  Misses       8657     8657           
Impacted Files Coverage Δ
ogre2/src/Ogre2SegmentationCamera.cc 75.67% <0.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8e7c876...d2945ca. Read the comment docs.

@iche033 iche033 merged commit 064bdf5 into main Sep 22, 2021
@iche033 iche033 deleted the adlarkin/fix_segmentation_colors branch September 22, 2021 01:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
beta Targeting beta release of upcoming collection bug Something isn't working 🏯 fortress Ignition Fortress
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants