Transform Point Cloud from Millimeters to Meters
To convert a point cloud from millimeters to meters, build a 4x4 homogeneous transformation matrix with 0.001 scaling on the diagonal and apply it with PointCloud::transform().
먼저 포인트 클라우드를 로드합니다.
const auto dataFile = std::string(ZIVID_SAMPLE_DATA_DIR) + "/CalibrationBoardInCameraOrigin.zdf";
std::cout << "Reading " << dataFile << " point cloud" << std::endl;
auto frame = Zivid::Frame(dataFile);
auto pointCloud = frame.pointCloud();
그런 다음 0.001 스케일링으로 4x4 변환 행렬을 만듭니다.
그런 다음 이 변환 행렬을 사용하여 포인트 클라우드를 변환합니다.
마지막으로 변환된 포인트 클라우드를 저장합니다.
const auto transformedFile = "FrameInMeters.zdf";
std::cout << "Saving transformed point cloud to file: " << transformedFile << std::endl;
frame.save(transformedFile);