Skip to content

Conversation

@maloel
Copy link
Contributor

@maloel maloel commented Mar 11, 2020

Tracked on: DSO-13910


auto get_color = [&]( object_in_frame const & object ) -> ImColor
{
ColorIdx & color = id2color[object.id];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

id2color[object.id % colors.size()]; ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The idea here is that the object ID would be mapped to a color index. You don't normally want two IDs mapping to the same color, and I assumed we know nothing about the nature of the ID.

if( color < int( colors.size() ) )
{
if( color > 0 )
return colors[color].first;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we have a color for the ID?
yes -> return it
find next available color; found it?
yes -> mark it as used; return it
no -> we have more objects than colors; use the the default!

@dorodnic dorodnic merged commit 5e62d3f into IntelRealSense:development Mar 18, 2020
@maloel maloel deleted the openvino branch March 25, 2021 14:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants