Skip to content

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

Merged
iche033 merged 1 commit intomainfrom
adlarkin/fix_segmentation_colors
Sep 22, 2021
Merged

Be consistent in RGB channel notation for ogre2 segmentation camera#419
iche033 merged 1 commit intomainfrom
adlarkin/fix_segmentation_colors

Conversation

@adlarkin
Copy link
Contributor

@adlarkin adlarkin commented Sep 21, 2021

Signed-off-by: Ashton Larkin ashton@openrobotics.org

🦟 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

Signed-off-by: Ashton Larkin <ashton@openrobotics.org>
@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.

5 participants