The function image=least_square_fit (tobefit_Indx tobefit_Indy, image, nt, INDD)
X=tobefit_Indy;
Y=size (image 1) - tobefit_Indx + 1; % made fitting point (X, Y)
If ~ isempty (tobefit_Indx)
% this statement said if tobefit_Indx behind is not empty, execute the if statement, equivalent to the if true then the
% A: fitting coefficient (X, Y) : fitting point nt: number of fitting (polynomial order) R: fitting values
A=polyfit (X, Y, nt); % polyfit function used for polynomial fitting, the return value A for polynomial fitting coefficient, coefficient from high to low order
C=1: size (image, 2); % C is equivalent to take over each pixel point ordinate
R=round (polyval (A, C)); % polyval equivalent to computing the independent variable C value after A given coefficient polynomials,
R1=size (image 1) - R + 1; %
R2=R1 + 1;
R3=R1-1;
C2=C;
C3=C;
Strives for the bosses to give directions here R1, R2, R3 represents what mean