主要内容

e57FileReader

R2026b

Read point cloud data from E57 file

Since R2023a

    Description

    The e57FileReader object reads point cloud data from an E57 file.

    Creation

    Description

    e57Reader = e57FileReader(fileName) creates an e57FileReader object that reads point cloud data from an E57 file. The fileName argument, which specifies the absolute or relative path to the E57 file, sets the FileName object property. You specify fileName as character vector or string scalar.

    example

    Properties

    expand all

    This property is read-only.

    Name of the E57 file, stored as a character vector.

    This property is read-only.

    Format name in the E57 file header, stored as a character vector.

    This property is read-only.

    Globally unique identifier in the E57 file header, stored as a character vector.

    This property is read-only.

    E57 file version, stored as a character vector.

    This property is read-only.

    Library version used to save the E57 file, stored as a character vector.

    This property is read-only.

    File creation date and time, stored as a datetime object.

    This property is read-only.

    Number of point clouds in the E57 file, stored as a nonnegative integer.

    Since R2026b

    Index of the next point cloud to read, specified as a positive integer. If you do not specify an index to the readPointCloud object function, it reads the point cloud at this index and increments this property value by one after completing the read operation. The value of this index cannot not exceed the number of point clouds in the E57 file when a read operation begins.

    Data Types: single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64

    Object Functions

    readPointCloudRead point cloud data from E57 file
    readCRSRead coordinate reference system data from E57 file
    hasPointCloudDetermine if another point cloud is available in E57 file
    resetReset e57FileReader object to first frame

    Examples

    collapse all

    Download a ZIP file containing an E57 file, and then unzip the file.

    zipFile = matlab.internal.examples.downloadSupportFile("lidar","data/e57ParkingLot.zip");
    saveFolder = fileparts(zipFile);
    e57FileName = [saveFolder filesep 'parkingLot.e57'];
    if ~exist(e57FileName,"file")
        unzip(zipFile,saveFolder)
    end

    Create an e57FileReader object using the downloaded E57 file.

    e57Reader = e57FileReader(e57FileName);

    Define a variable for storing point clouds, ptCloudArr and their corresponding poses, tformArr.

    ptCloudArr = [];
    tformArr = []; 

    Read the point clouds sequentially. Use the hasPointCloud object function to check whether the next point cloud is available.

    while hasPointCloud(e57Reader)
       [ptCloud,pcMetadata] = readPointCloud(e57Reader);
        for j = 1:numel(ptCloud) % To read multiple returns
            ptCloudArr = [ptCloudArr ptCloud(j)];
            tformArr = [tformArr pcMetadata.RelativePose];
        end
    end

    Align the point clouds from the file to create a map.

    pcMap = pcalign(ptCloudArr,tformArr); 

    Display the map.

    figure
    pcshow(pcMap)

    Figure contains an axes object. The axes object contains an object of type scatter.

    More About

    expand all

    Version History

    Introduced in R2023a

    expand all