目录
效果
las点云读取使用了laslib这个库。
laslib 关键代码
{
// 这里演示读取一个 .txt 点云文件
const char* lasfile = path.c_str();
std::ifstream ifs;
ifs.open(lasfile, std::ios::in | std::ios::binary);
liblas::ReaderFactory f;
liblas::Reader reader = f.CreateWithStream(ifs);
liblas::Header const & header = reader.GetHeader();
int count = header.GetPointRecordsCount();
int i = 0;
while (reader.ReadNextPoint() && i < 10)
{
liblas::Point const& p = reader.GetPoint();
double time = p.GetTime();
double x = p.GetX();
double y = p.GetY();
double z = p.GetZ();
float intensity = p.GetIntensity();
liblas