Skip to content

Visualizer: color coding of multiple point clouds #576

@schapotschnikow

Description

@schapotschnikow

I noticed the following behavior of the PCLvisualizer when using PointCloudColorHandlerGenericField for color coding. This is used, for example, to color the points according to a specific scalar feature. Example:

PointCloud<PointXYZI>::Ptr cloud;
/*
Fill the cloud somehow. Write the feature value to the intensity-field of the points.
*/
pcl::visualization::PCLVisualizer viewer;
pcl::visualization::PointCloudColorHandlerGenericField<pcl::PointXYZI> handler(cloud,"intensity");
string cloud_id = "My cloud";
viewer.addPointCloud<PointXYZI>(cloud,handler,cloud_id);

When you add multiple point clouds, each point cloud is colored according to its own range of intensity. If you display the legend (color bar) in the visualizer, it makes little sense, as you don't even know, to which cloud it belongs. But what you, probably, want, is that all clouds are colored according to the same range, and the color scale is the same for all clouds.

There are, of course, different ways to get the expected behavior. IMHO, the easiest one is to add a method in the PCLvisualizer class, something like
PCLVisualizer::alignColorScales(string field, int viewport = 0);

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions