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