From f9e5a8db4f3fece9759ee1ce7ec5912c35c1788b Mon Sep 17 00:00:00 2001 From: Ian Chen Date: Tue, 20 Aug 2024 09:45:41 -0700 Subject: [PATCH] Fix segmentation camera color id calculation (#1040) Signed-off-by: Ian Chen --- ogre2/src/Ogre2SegmentationMaterialSwitcher.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ogre2/src/Ogre2SegmentationMaterialSwitcher.cc b/ogre2/src/Ogre2SegmentationMaterialSwitcher.cc index b96fbaf45..d189d20af 100644 --- a/ogre2/src/Ogre2SegmentationMaterialSwitcher.cc +++ b/ogre2/src/Ogre2SegmentationMaterialSwitcher.cc @@ -187,9 +187,9 @@ math::Color Ogre2SegmentationMaterialSwitcher::LabelToColor(int64_t _label, int b = distribution(this->generator); math::Color color( - static_cast(r), - static_cast(g), - static_cast(b)); + static_cast(r / 255.0f), + static_cast(g / 255.0f), + static_cast(b / 255.0f)); // if the label is colored before return the color // don't check for taken colors in that case, all items