-
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
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
Changed the Glasbey Color Lookup, such that label ids get consistent colors. #1156
Changed the Glasbey Color Lookup, such that label ids get consistent colors. #1156
Conversation
I think this is a very nice change, since it eliminates lots of unnecessary overhead (since label colors are modulo GlasbeyLUT::size () anyways), especially on large point clouds. The degenerate case is if the only labels present just happen to be exact multiples of GlasbeyLUT::size (), but that seems unlikely. |
Just saw that the glasbey colormapping is used in other files like |
I get your point regarding consistent mapping between labels and colors and agree that it is useful. On the other hand, the idea of using Glasbey table is to select optimal (most distinctive) set of colors of given size. If you only have three labels and select first three colors from the table, then they as distinctive as possible. But if you select some (according to labels) three colors from the table, there are no guarantees. (Or, strictly speaking, there is a guarantee that distinctiveness will not be worse than between optimal 256 colors.) What about providing an option at construction time? By default the users will get most distinctive colors. As an opt-in, they can have static color assignment. |
I think your proposal with providing an option at construction time |
Fine for me. I would suggest a After we merge your pull request, I'll take care of point cloud image extractor myself, because it will also require to change the |
sounds good
|
d0c56d0
to
e3c4106
Compare
here we go. @taketwo I hope I got all the dependencies. But my tests worked all fine. |
ae1fd89
to
f322d1d
Compare
I thought we'd make |
Mmh, from your comment
I thought you want to have the optimal assignment as default. But I would totally agree that due to the additional overhead (and also hard to predict color-assignments) of the optimal mapping I would make |
Yep, that was my idea in the beginning. But then after your comment
I reconsidered. So my "Fine for me" was referring to making static default everywhere. |
…olor. This is especially important, if labels have a semantic meaning (class) (say 1=chair, 2=door, 3=floor, 4=wall ). If a chair is missing in a pointcloud (label 1 is absent) than the colors of all objects would change. Additionally, it is much faster, since we do not iterate through clouds multiple times as well as saving time on various map lo
f322d1d
to
377a5bd
Compare
ok, got that. Here are the changes 😄 |
Changed the Glasbey Color Lookup, such that label ids get consistent colors.
This is especially important, if labels have a semantic meaning (classes) (say 1=chair, 2=door, 3=floor, 4=wall ).
If a chair is missing in a pointcloud (label 1 is absent) than the colors of all objects would change.
Additionally, it is much faster, since we do not iterate through clouds multiple times as well as saving time on various map lookups.