OpenCV line fitting algorithm

Viewed 34944

I'm trying to understand OpenCV fitLine() algorithm.

This is fragment of code from OpenCV: icvFitLine2D function - icvFitLine2D

I see that there is some random function that chooses points for approximation, then computes distances from points to fitted line (with choosen points), then choose other points and tries to minimize distance with choosen distType.

Can someone clarify what happens from this moment without hard mathematics and assuming no great statistic knowledge?. OpenCV code comments and variable names does not help me in understanding this code.

1 Answers
Related