Main Content

segmentCurbPoints

Segment curb points from point cloud

Since R2022b

    Description

    curbPtsIdx = segmentCurbPoints(onRoadPointCloud) segments the indices of the feature curb points from an organized point cloud which contains on-road points. A curb usually defines the road boundary, and forms an edge for the sidewalk.

    example

    curbPtsIdx = segmentCurbPoints(onRoadPointCloud,roadAngles) specifies the road angles. The function further processes the feature curb points using these road angles and returns the candidate curb points.

    curbPtsIdx = segmentCurbPoints(onRoadPointCloud,roadAngles,prevCurbPoints) specifies the curb points segmented from the previous point cloud frames. The function uses the previous curb points to improve robustness when the input point cloud has occlusions.

    [curbPtsIdx,curbPtCloud] = segmentCurbPoints(___) returns the segmented curb points in the on-road point cloud as a pointCloud object, using any combination of input arguments from previous syntaxes.

    [___] = segmentCurbPoints(___,Name=Value) specifies options using one or more name-value arguments in addition to any combination of arguments from previous syntaxes. For example, HeightLimits=[0.1 0.3] specifies the minimum and the maximum height of the road curb as 0.1 and 0.3 meters, respectively.

    Examples

    collapse all

    Read point cloud data from a PCD file by using the pcread function.

    ptCloud = pcread("HDL64LidarData.pcd");

    Organize the point cloud data by using the pcorganize function.

    ptCloud = pcorganize(ptCloud,lidarParameters("HDL64E",1024));

    Extract a region of interest, which contains a road, from the point cloud data.

    roi = [-25 25 -10 24 ptCloud.ZLimits];
    indices = findPointsInROI(ptCloud,roi);
    ptCloud = select(ptCloud,indices,OutputSize="full");

    Segment the on-road and off-road points from the point cloud by using the segmentGroundSMRF function.

    [~,offRoadPtCloud,onRoadPtCloud] = segmentGroundSMRF(ptCloud);

    Detect road angles from the off-road points.

    roadAngles = detectRoadAngles(offRoadPtCloud,MinSectorSize=10,SectorMergeThreshold=30);

    Segment curb points from the on-road points of the point cloud.

    [~,curbPtCloud] = segmentCurbPoints(onRoadPtCloud,roadAngles,NumScanNeighbors=10, ...
            HeightLimits=[0.001 0.5],HeightDeviationLimits=[0.001 0.5], ...
            SmoothnessThreshold=0.0001,HorizontalAngularResolution=0.33);

    Visualize the segmented curb points.

    figure
    pcshow(ptCloud.Location,"w")
    hold on;
    pcshow(curbPtCloud.Location,"r",MarkerSize=200)
    hold off
    view(2)
    title("Curb points")

    Figure contains an axes object. The axes object with title Curb points contains 2 objects of type scatter.

    Input Arguments

    collapse all

    Organized point cloud with on-road points, specified as a pointCloud object. The on-road area consists of sidewalks, curb surfaces, and road surfaces. You can apply ground segmentation or plane-fitting algorithms to your point cloud data to extract on-road points. For more details, see Extract On-Road and Off-Road Points from Point Cloud.

    Road segmentation angles, specified as an M-element vector. The value of M depends on the road type.

    Road TypeM Value
    Straight or curved road2
    T-shaped or Y-shaped road3
    Cross-road (+)4
    6-way junction6

    You can compute road angles by using the detectRoadAngles function or input them manually to the function.

    When you specify the road angles, the function processes the feature curb points using RANSAC polynomial fitting to return the candidate curb points.

    Segmented curb points from the previous point cloud frames, specified as a pointCloud object or an array of pointCloud objects. These point clouds must be in the onRoadPointCloud frame of reference. Detections from the previous frames can improve the robustness of the function when the input point cloud has occlusions.

    Name-Value Arguments

    Specify optional pairs of arguments as Name1=Value1,...,NameN=ValueN, where Name is the argument name and Value is the corresponding value. Name-value arguments must appear after other arguments, but the order of the pairs does not matter.

    Example: segmentCurbPoints(onRoadPtCloud,HeightLimits=[0.1 0.3]) specifies the minimum and the maximum height of the road curb as 0.1 and 0.3 meters, respectively.

    Number of left and right neighbors for each point in a scan line, specified as a positive integer. Increasing this value can improve the accuracy of curb segmentation.

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

    Height limits for the road curb, specified as a two-element nonnegative vector of the form [min max]. The min, max values specify the minimum and the maximum height of the road curb, respectively. The typical range of the minimum height is [0.001, 0.05], and the typical range of the maximum height is [0.15, 0.5]. The values are in meters.

    Data Types: single | double

    Minimum and maximum standard deviation in the curb height, specified as a two-element nonnegative vector of the form [min max]. The min, max values specify the minimum and the maximum standard deviation in the curb height, respectively.

    Data Types: single | double

    Minimum smoothness value for curb points, specified as a positive scalar. The typical range of this value is (0, 0.005]. Increasing this value can decrease the number of curb points segmented.

    Data Types: single | double

    Horizontal angular resolution of the lidar sensor, specified as a positive scalar in degrees. When you do not specify this value, the function internally computes it as 360/(size(onRoadPointCloud.Location,2)). The typical range for horizontal angular resolution is [0.1, 0.4]. Increasing this value can decrease the number of curb points segmented.

    Data Types: single | double

    Output Arguments

    collapse all

    Binary map of the point cloud with the indices of the curb points, returned as an M-by-N logical matrix. M and N are the number of rows and columns, respectively in the input onRoadPointCloud.

    Point cloud of the segmented curb points, returned as a pointCloud object.

    Algorithms

    The function extracts curb points from onRoadPointCloud using these steps.

    1. For each point in a scan line, the function computes these three features.

      • Height Difference Feature — Computes the standard deviation and the height maximum difference around a point. The standard deviation and height difference of a curb point must be within the specified HeightDeviationLimits and HeightLimits, respectively.

      • Smoothness Feature — Computes the smoothness of the area around a point. A higher smoothness value indicates that the point is an edge point, and a lower values indicates that the point is a plane point. The smoothness value for a curb point must be greater than the SmoothnessThreshold value.

      • Horizontal and Vertical Continuity Feature — Computes the horizontal and vertical distance between a point and its immediate neighbors. These horizontal and vertical distance values must be less than the horizontal and the vertical continuity thresholds, respectively. The function computes the thresholds values from the HorizontalAngularResolution of the lidar sensor.

    2. If a point satisfies all computed features, then it as a feature curb point.

    3. If you specify road angles as an input, the function further fine tunes the feature curb points using RANSAC polynomial fitting, and returns the candidate curb points.

    Version History

    Introduced in R2022b