1. RGBA
1.1 Packing
int rgb = ((int)r) << 16 | ((int)g) << 8 | ((int)b);
R(8bit) | G(8bit) | B(8bit)
1.2 Unpacking
int rgb = ...;
std::uint8_t r = (rgb >> 16) & 0x0000ff;
std::uint8_t g = (rgb >> 8) & 0x0000ff;
std::uint8_t b = (rgb) & 0x0000ff;
5가지 입력
더보기
(1) 인자를 안 받는 경우(RGBL의 경우는 라벨만 입력을 받는 경우)
constexpr pcl::RGB::RGB( )
constexpr pcl::PointXYZRGBA::PointXYZRGBA( )
constexpr pcl::PointXYZRGBL::PointXYZRGBL(std::uint32_t _label = 0)
(2) 포인트 한 점을 입력으로 받는 경우
constexpr pcl::RGB::RGB(const _RGB &p)
constexpr pcl::PointXYZRGBA::PointXYZRGBA(const _PointXYZRGBA &p)
constexpr pcl::PointXYZRGBL::PointXYZRGBL(const _PointXYZRGBL &p)
(3) RGB 값을 입력으로 받는 경우
constexpr pcl::RGB::RGB(
std::uint8_t _r,
std::uint8_t _g,
std::uint8_t _b,
std::uint8_t _a = 255
)
constexpr pcl::PointXYZRGBA::PointXYZRGBA(
std::uint8_t _r,
std::uint8_t _g,
std::uint8_t _b,
std::uint8_t _a
)
constexpr pcl::PointXYZRGBL::PointXYZRGBL(
std::uint8_t _r,
std::uint8_t _g,
std::uint8_t _b
)
(4) X, Y, Z 값을 입력으로 받는 경우
constexpr pcl::PointXYZRGBA::PointXYZRGBA(
float _x,
float _y,
float _z
)
constexpr pcl::PointXYZRGBL::PointXYZRGBL(
float _x,
float _y,
float _z
)
(5) RGB, XYZ 모두 입력으로 받는 경우
constexpr pcl::PointXYZRGBA::PointXYZRGBA(
float _x,
float _y,
float _z,
std::uint8_t _r,
std::uint8_t _g,
std::uint8_t _b,
std::uint8_t _a
)
constexpr pcl::PointXYZRGBL::PointXYZRGBL(
float _x,
float _y,
float _z,
std::uint8_t _r,
std::uint8_t _g,
std::uint8_t _b,
std::uint32_t _label = 0,
std::uint8_t _a = 255
)
Operator
std::ostream& operator<<(
std::ostream &os,
const RGB &p
)
std::ostream& operator<<(
std::ostream &os,
const PointXYZRGBA &p
)
std::ostream& operator<<(
std::ostream &os,
const PointXYZRGBL &p
)
그외 포인트 타입은 아래에 정리되어 있다
- https://pointclouds.org/documentation/point__types_8hpp_source.html
※ RGB 값을 포함하는 포인트 타입만 해도 5가지 이다
// Define all point types that include RGB data
#define PCL_RGB_POINT_TYPES \
(pcl::PointXYZRGBA) \
(pcl::PointXYZRGB) \
(pcl::PointXYZRGBL) \
(pcl::PointXYZRGBNormal) \
(pcl::PointSurfel) \
출처)
- https://pointclouds.org/documentation/structpcl_1_1_r_g_b.html
- https://pointclouds.org/documentation/structpcl_1_1_point_x_y_z_r_g_b_a.html
- https://pointclouds.org/documentation/structpcl_1_1_point_x_y_z_r_g_b_l.html
-
반응형
'심화 > 포인트 클라우드 기반' 카테고리의 다른 글
PCL Window Install (0) | 2022.09.01 |
---|---|
Semantic-Kitti 데이터셋 설명 (0) | 2022.07.25 |
[1] Open3D 제공 기능 목록 정리(PointCloud) (0) | 2022.07.14 |
DBSCAN(밀도 기반 클러스터링) (0) | 2022.06.21 |