hongbo-miao/hongbomiao.com

View on GitHub
automobile/detect-lane-by-lidar-point-cloud/fitPolynomial.m

Summary

Maintainability
Test Coverage
function [P, score] = fitPolynomial(pts, degree, resolution)
    P = fitPolynomialRANSAC(pts, degree, resolution);
    ptsSquare = (polyval(P, pts(:, 1)) - pts(:, 2)).^2;
    score = sqrt(mean(ptsSquare));
end