如何更改pcl::PointXYZRGBA的RGB值?
How can I change RGB values of pcl::PointXYZRGBA?
我有一个类型为pcl::PointXYZRGBA
的点。我如何分配/改变它的rgb值?
对于更改xyz坐标,我可以简单地执行point.x = some_value
。
或者直接使用
point.r = 255;
point.b = 0;
point.g = 0;
point.a = 255;
可以用pcl::PointXYZRGB
代替pcl::PointXYZRGBA
。我想它们都是一样的。然后将一个点涂成红色(255,0,0),你可以这样做:
pcl::PointXYZRGB point = pcl::PointXYZRGB(255, 0, 0);
然后分别分配xyz坐标:
point.x = x;
point.y = y;
point.z = z;
EDIT:或者如果你必须坚持使用pcl::PointXYZRGBA
,你可以使用
pcl::PointXYZRGBA point;
uint8_t r = 255;
uint8_t g = 0;
uint8_t b = 0;
int32_t rgb = (r << 16) | (g << 8) | b;
point.rgba = *(float *)(&rgb); // makes the point red
相关文章:
- 使用FFMPEG将RGB图像序列保存到.mp4时出现问题
- 将RGB图像保存为PPM格式
- 在 C++ 中将 RGB 更改为灰度
- Qt中的RGB图像处理
- 在C++中查找像素 RGB 数据的最快方法是什么?
- 无法获取要在 OpenGL ES2 中显示的 RGB 纹理
- 如何将 MJPEG 解码为原始 RGB(或 YUV)数据
- 我们可以将阈值应用于色彩空间模型的单个组件(如 RGB 和 LAB)吗?
- 如何使用 C++将 2D RGB 数组转换为 dds 文件?
- 在RAW图像中提取RGB通道值的库或方法
- 将Kinect v2帧速率(rgb、深度、骨架)设置为每秒25帧
- Qmage:如何将灰色图像转换为RGB热图
- 使用范围(OpenCV)脱粒RGB图像
- 如何将RGB像素缓冲区转换为IRandomAccessStream^
- (C++)(Visual Studio) 将高斯模糊滤镜应用于 RGB 中的灰度图像
- #Define , RGB colors for NeoPIxel
- 根据 C++ 中生成的随机数的值生成 Html RGB 值
- 用 c++ 将函数 RGB 写入 HSL
- 为什么延迟太高,即使只是 RGB 到灰色转换 (Vivado HLS)?
- 如何更改pcl::PointXYZRGBA的RGB值?