Skip to content

pcl::PassThrough<pcl::PointXYZRGB> for the rgb field should filter on the rgb intensity/grayscale value #5328

@1ros0

Description

@1ros0

Hi,

Applying the pcl::PassThrough to a pcl::PointXYZRGB on the "rgb" field results in unintuitive/meaningless behavior. The filter checks against the float representation of the rgb field which isn't a meaningful number when considering a min and max filter range.

Here is the float representation:
std::uint8_t r = 255, g = 0, b = 0; // Example: Red color std::uint32_t rgb = ((std::uint32_t)r << 16 | (std::uint32_t)g << 8 | (std::uint32_t)b); p.rgb = *reinterpret_cast<float*>(&rgb);
Comparing against this representation doesn't result in filtering values, in the manner the caller would expect. For instance, the above red color example results in a really large negative number when represented as a float.

Todo: The passthrough filter for the "rgb" field should convert the rgb value into a intensity/grayscale value and then filter min and max based on that grayscale value.

Thank you

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