Easy3D 2.6.1
|
Implementation of file input/output operations for ASCII Cyclone point cloud export format (PTX). More...
#include <easy3d/fileio/point_cloud_io_ptx.h>
Public Member Functions | |
PointCloudIO_ptx (const std::string &file_name) | |
TODO: Translator not implemented. | |
PointCloud * | load_next () |
Reads a single point cloud from the file. | |
Implementation of file input/output operations for ASCII Cyclone point cloud export format (PTX).
PTX is an ASCII based interchange format for point cloud data. It utilizes the concept of separate scans, each with points defined in their own coordinate system and a 'Registration' of all of those point clouds into a single coordinate system. The point data for each cloud is stored in its original coordinate system and a matrix of transforms for each point cloud are provided as header information.
A PTX file can have one or more point cloud. Each point cloud starts with a header. Each following line then describes one point in the cloud. Cyclone exports PTX with 7 columns when the cloud has RGB values from the digital camera (x, y, z, intensity, red, green, blue). Red, Green, Blue have the integer range [0, 255]. A cloud in PTX has 4 columns (x, y, z, intensity) when the cloud does not have RGB values. PTX intensities use the decimal range [0, 1]. Individual values on the same line are separated by a blank space. The coordinate unit is always in meters. PTX can only be used on "[[KB:132:gridded]]" clouds (directly from scans), not unordered or unified clouds. Each cloud is "fully populated", in that even missing points are represented (as a line with "0 0 0" for the XYZ coordinate). This gives the importing software enough information to restore the original scan-line ordering of the cloud (for example, to estimate normal vectors).
PTX point cloud header:
The first four lines of three numbers each are the position and primary axes of the scanner after any registration/transformation. The next four lines of four numbers each may look similar in some cases, but if you have a non-identity UCS when the PTX was exported, the numbers will look different. If the cloud was untransformed by a registration (or not registered), the first four lines of three numbers each would be 0,0,0; 1,0,0; 0,1,0; 0,0,1. The 4x4 matrix may not be identity if there is a UCS applied.
Note that a cloud that was registered may have a 4x4 identity matrix due to a UCS that is set to that scanner's registered position. For both formats, in a point cloud with color (i.e., the R G B values a re present for each point in that cloud), the RGB value (0, 0, 0) is reserved to mean "no color". An example where this might happen would be if a digital camera did not cover that point. That point then has "no color", even though other points may have color.
Example data file:
See http://w3.leica-geosystems.com/kb/?guid=5532D590-114C-43CD-A55F-FE79E5937CB2
Example usage: