Main Content


Segment building points from aerial lidar data

Since R2022b


    buildingPtsIdx = segmentAerialLidarBuildings(ptCloud) segments the building points and non-building points from the input unorganized point cloud ptCloud using a pretrained PointNet++ model and returns the building point indices..


    • The input point cloud dimensions must be in meters.

    • This function requires Deep Learning Toolbox™.


    [buildingPtsIdx,nonBuildingPtCloud,buildingPtCloud] = segmentAerialLidarBuildings(ptCloud) additionally returns the building points and non-building points as individual pointCloud objects.

    [___] = segmentAerialLidarBuildings(___,ExecutionEnvironment=env) specifies the execution environment for the function in addition to any combination of arguments from previous syntaxes.


    collapse all

    Specify a LAZ file that contains aerial lidar data.

    fileName = fullfile(toolboxdir("lidar"),"lidardata","las", ...

    Read point cloud data from the LAZ file into the workspace.

    lasReader = lasFileReader(fileName);
    ptCloud = readPointCloud(lasReader);

    Segment the building points from the point cloud.

    [~,nonBuildingPtCloud,buildingPtCloud] = segmentAerialLidarBuildings(ptCloud);

    Visualize the building and non-building points.


    Input Arguments

    collapse all

    Unorganized point cloud data, specified as a pointCloud object.

    Hardware resource to use to process the point cloud, specified as one of these options.

    • "auto" — Use a GPU if available. Otherwise, use the CPU. The use of a GPU requires Parallel Computing Toolbox™ and a CUDA®-enabled NVIDIA® GPU. For information about the supported compute capabilities, see GPU Computing Requirements (Parallel Computing Toolbox).

    • "gpu" — The function runs on a GPU. If a suitable GPU is not available, the function returns an error message.

    • "cpu" — The function runs on a CPU.

    Data Types: char | string

    Output Arguments

    collapse all

    Binary map of the segmented point cloud, returned as an M-element logical vector. Elements that correspond to building points in the point cloud are true, and non-building points are false.

    Point cloud of non-building points, returned as a pointCloud object.

    Point cloud of building points, returned as a pointCloud object.

    Version History

    Introduced in R2022b