The method (P1) for detecting a boundary (L1, L2, L3) of a traffic lane (VC1, VC2) for a motor vehicle (1) involves detecting the boundary by a vehicle environment detection means, the boundary being defined by a function (typically polynomial), determining a plurality of first vectors characterizing the boundary based on map data and vehicle pose, determining a plurality of second vectors characterizing the boundary through orthogonal projection onto said function, and calculating Mahalanobis distances between each first and second vector.