Main Content

evaluateLaneBoundaries

Evaluate lane boundary models against ground truth

Description

numMatches = evaluateLaneBoundaries(boundaries,worldGroundTruthPoints,threshold) evaluates candidate lane boundary models, boundaries, against lane boundaries formed by world coordinate ground truth points, worldGroundTruthPoints, and returns the total number of matching lane boundaries, numMatches. If all points within a candidate boundary are within the lateral distance threshold of the ground truth lane boundary, then that boundary is considered a valid match (true positive).

example

[numMatches,numMissed,numFalsePositives] = evaluateLaneBoundaries(___) also returns the total number of misses (false negatives) and false positives, using the previous inputs.

[___] = evaluateLaneBoundaries(___,xWorld) specifies the x-axis points at which to perform the comparisons. Points specified in worldGroundTruthPoints are linearly interpolated at the given x-axis locations.

[___] = evaluateLaneBoundaries(boundaries,groundTruthBoundaries,threshold) compares the boundaries against ground truth models that are specified in an array of lane boundary objects or a cell array of arrays.

[___,assignments] = evaluateLaneBoundaries(___) also returns the assignment indices that are specified in groundTruthBoundaries. Each boundary is matched to the corresponding class assignment in groundTruthBoundaries. The kth boundary in boundaries is matched to the assignments(k) element of worldGroundTruthPoints. Zero indicates a false positive (no match found).

Examples

collapse all

Create a set of ground truth points, add noise to simulate actual lane boundary points, and compare the simulated data to the model.

Create a set of points representing ground truth by using parabolic parameters.

parabolaParams1 = [-0.001 0.01 0.5];
parabolaParams2 = [0.001 0.02 0.52];
x = (0:0.1:20)';
y1 = polyval(parabolaParams1,x);
y2 = polyval(parabolaParams1,x);

Add noise relative to the offset parameter.

y1 = y1 + 0.10*parabolaParams1(3)*(rand(length(y1),1)-0.5);
y2 = y2 + 0.10*parabolaParams2(3)*(rand(length(y2),1)-0.5);

Create a set of test boundary models.

testlbs = parabolicLaneBoundary([-0.002 0.01 0.5;
                                 -0.001 0.02 0.45;
                                 -0.001 0.01 0.5;
                                  0.000 0.02 0.52;
                                 -0.001 0.01 0.51]);

Compare the boundary models to the ground truth points. Calculate the precision and sensitivity of the models based on the number of matches, misses, and false positives.

threshold = 0.1;
[numMatches,numMisses,numFalsePositives,~] = ...
        evaluateLaneBoundaries(testlbs,{[x y1],[x y2]},threshold);

disp('Precision:');
Precision:
disp(numMatches/(numMatches+numFalsePositives));
    0.4000
disp('Sensitivity/Recall:');
Sensitivity/Recall:
disp(numMatches/(numMatches+numMisses));
     1

Input Arguments

collapse all

Ground truth points of lane boundaries, specified as an [x y] array or cell array of [x y] arrays. The x-axis points must be unique and in the same coordinate system as the boundary models. A lane boundary must contain at least two points, but for a robust comparison, four or more points are recommended. Each element of the cell array represents a separate lane boundary.

Maximum lateral distance between a model and ground truth point in order for that point to be considered a valid match (true positive), specified as a real scalar.

Lane boundary models, specified as an array of parabolicLaneBoundary objects or cubicLaneBoundary objects. Lane boundary models contain the following properties:

  • Parameters — A vector corresponding to the coefficients of the boundary model. The size of the vector depends on the degree of polynomial for the model.

    Lane Boundary ObjectParameters
    parabolicLaneBoundary

    [A B C], corresponding to coefficients of a second-degree polynomial equation of the form y = Ax2 + Bx + C

    cubicLaneBoundary[A B C D], corresponding to coefficients of a third-degree polynomial equation of the form y = Ax3 + Bx2 + Cx + D
  • BoundaryType — A LaneBoundaryType enumeration of supported lane boundaries:

    • Unmarked

    • Solid

    • Dashed

    • BottsDots

    • DoubleSolid

    Specify a lane boundary type as LaneBoundaryType.BoundaryType. For example:

    LaneBoundaryType.BottsDots
    
  • Strength — The ratio of the number of unique x-axis locations on the boundary to the total number of points along the line based on the XExtent property.

  • XExtent — A two-element vector describing the minimum and maximum x-axis locations for the boundary points.

x-axis locations of boundary, specified as a real-valued vector. Points in worldGroundTruthPoints are linearly interpolated at the given x-axis locations. Boundaries outside of these locations are excluded and count as false negatives.

Ground truth boundary models, specified as an array of parabolicLaneBoundary or cubicLaneBoundary objects or cell array of parabolicLaneBoundary or cubicLaneBoundary arrays.

Output Arguments

collapse all

Number of matches (true positives), returned as a real scalar.

Number of misses (false negatives), returned as a real scalar.

Number of false positives, returned as a real scalar.

Assignment indices for ground truth boundaries, returned as a cell array of real-valued arrays. Each boundary is matched to the corresponding assignment in groundTruthBoundaries. The kth boundary in boundaries is matched to the assignments(k) element of worldGroundTruthPoints. Zero indicates a false positive (no match found).

Version History

Introduced in R2017a