PointCloudLibrary / PointCloudLibrary/pcl
pcl_viewer lookup table does not display correct colors when using random or label field.
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 11.1k
- Forks
- 4.7k
- Avg merge
- 4d 10h
- Merged PRs (30d)
- 6
Description
Using a random color for the pointcloud display or the label field together with display lookup table (pressing u in the viewer) gives a colorbar, which has meaningless colors for the label field. It would be very nice if the colorbar shows the right color per label. I tried to work on that, but I'm not familiar with the pcl_visualizer and pcl_viewer code. So I just could not find the place which needs to be changed.
However the numbers displayed on the bottom are the ones which are returned for minmax in the function call scalars->GetRange (minmax) pcl_visualizer.cpp line 2640
Attached is a screenshot showing this for a labeled pointcloud (labels 0-3).

Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in pcl_visualizer.cpp around line 2640, where scalars->GetRange supplies the displayed min and max, and trace how pcl_viewer builds the lookup-table colorbar for random and label fields. Compare the label values 0–3 with the colors shown in the attached example. Done means the colorbar assigns the correct color to each label while preserving the existing random-color behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- computer-vision
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100